1 #ifndef TRK_HH_INCLUDED
2 #define TRK_HH_INCLUDED
7 #include "TDatabasePDG.h"
67 const double d = (
pos - t.
pos ).dot( v );
81 return v.
dot(v) - dz*dz;
91 TParticlePDG* p = TDatabasePDG::Instance()->GetParticle(
type );
115 const unsigned t = abs(
type);
116 return t == 12 || t == 14 || t == 16;
128 const unsigned t = abs(
type);
129 return t == 11 || t == 13 || t == 15;
150 return (
status / 100) % 10 == 1;
163 for(
auto&
t : mctrks )
165 if (
t.mother_id ==
id ) r.push_back( &
t );
175 void print(std::ostream& out=std::cout)
const
177 out <<
"Trk: id=" <<
id <<
" pos=";
pos.
print(out);
179 out <<
" t=" <<
t <<
" E=" <<
E <<
" pdg-type=" <<
type;
std::vector< Trk * > get_daughters(std::vector< Trk > &mctrks)
Get list of of pointers to tracks, all of which have their mother identifier set to identifier of thi...
double t
track time [ns] (when the particle is at pos )
bool is_neutrino() const
Check if this is a netrino.
double distance_to(const Vec &p=Vec()) const
Get distance to given position.
std::string comment
use as you like
bool is_primary() const
Check if this is a primary particle (i.e.
double E
Energy [GeV] (either MC truth or reconstructed)
double len() const
Get length.
std::string name() const
Get the name of the MC particle type.
bool is_lepton() const
Check if this is a charged lepton.
int mother_id
MC id of the parent particle.
double dot(const Vec &v) const
Get dot product.
void read(const Trk &t)
Read track (useful in python).
The Vec class is a straightforward 3-d vector, which also works in pyroot.
std::vector< int > hit_ids
list of associated hit-ids (corresponds to Hit::id).
then print_variable DETECTOR INPUT_FILE INTERMEDIATE_FILE check_input_file $DETECTOR $INPUT_FILE check_output_file $INTERMEDIATE_FILE $OUTPUT_FILE JMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
std::vector< double > fitinf
place to store additional fit info, for jgandalf, see JFitParameters.hh
double len
length, if applicable [m]
bool is_muon() const
Check if this is a muon.
void write(Trk &t) const
Write track (useful in python).
Vec cross(const Vec r) const
Get cross product.
int type
MC: particle type in PDG encoding.
int status
MC status code.
#define ClassDef(name, version)
Vec pos
postion of the track at time t [m]
AAObject is a base class for I/O-classes that adds the possibility to add 'user' information which wi...
std::vector< int > rec_stages
list of identifyers of succesfull fitting stages resulting in this track
std::vector< double > error_matrix
(NxN) error covariance matrix for fit parameters (stored as linear vector)
double lik
likelihood or lambda value (for aafit, lambda)
std::string to_string(const T &value)
Convert value to string.
void print(std::ostream &out=std::cout) const
Print vector.
Trk()
Default constructor.
void print(std::ostream &out=std::cout) const
Print track.
double distance_to(const Trk &t) const
Get distance of closes approach to another track.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
bool is_orphan() const
Check if this is an orphan.
int rec_type
identifyer for the overall fitting algorithm/chain/strategy