Go to the documentation of this file. 1 #ifndef TRK_HH_INCLUDED
2 #define TRK_HH_INCLUDED
7 #include "TDatabasePDG.h"
64 const double d = (
pos -
t.pos ).dot(
v );
77 double dz =
v.dot(
dir);
78 return v.dot(
v) - dz*dz;
88 TParticlePDG* p = TDatabasePDG::Instance()->GetParticle(
type );
112 const unsigned t = abs(
type);
113 return t == 12 ||
t == 14 ||
t == 16;
125 const unsigned t = abs(
type);
126 return t == 11 ||
t == 13 ||
t == 15;
147 return (
status / 100) % 10 == 1;
160 for(
auto&
t : mctrks )
162 if (
t.mother_id ==
id )
r.push_back( &
t );
174 out <<
"Trk: id=" <<
id <<
" pos=";
pos.
print(out);
176 out <<
" t=" <<
t <<
" E=" <<
E <<
" pdg-type=" <<
type;
Trk()
Default constructor.
std::string name() const
Get the name of the MC particle type.
double distance_to(const Vec &p=Vec()) const
Get distance to given position.
bool is_orphan() const
Check if this is an orphan.
int rec_type
identifyer for the overall fitting algorithm/chain/strategy
bool is_primary() const
Check if this is a primary particle (i.e.
void read(const Trk &t)
Read track (useful in python).
double E
Energy (either MC truth or reconstructed)
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
#define ClassDef(name, version)
std::string comment
use as you like
double t
track time (when the particle is at pos )
double distance_to(const Trk &t) const
Get distance of closes approach to another track.
Vec cross(const Vec r) const
Get cross product.
double len
length, if applicable
bool is_muon() const
Check if this is a muon.
std::vector< int > hit_ids
list of associated hit-ids (corresponds to Hit::id).
int status
MC status code.
int mother_id
MC id of the parent particle.
int type
MC: particle type in PDG encoding.
void print(std::ostream &out) const
Print track.
std::string to_string(const T &value)
Convert value to string.
Vec pos
postion of the track at time t
void write(Trk &t) const
Write track (useful in python).
bool is_neutrino() const
Check if this is a netrino.
std::vector< double > fitinf
place to store additional fit info, for jgandalf, see JFitParameters.hh
bool is_lepton() const
Check if this is a charged lepton.
std::vector< int > rec_stages
list of identifyers of succesfull fitting stages resulting in this track
The Vec class is a straightforward 3-d vector, which also works in pyroot.
double lik
likelihood or lambda value (for aafit, lambda)
AAObject is a base class for I/O-classes that adds the possibility to add 'user' information which wi...
std::vector< double > error_matrix
(5x5) error covariance matrix (stored as linear vector)
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...
void print(std::ostream &out=std::cout) const
Print vector.