1 #ifndef TRK_HH_INCLUDED
2 #define TRK_HH_INCLUDED
5 #include "TDatabasePDG.h"
67 TParticlePDG* p = TDatabasePDG::Instance()->GetParticle(
type );
111 return type == kElectron ||
type == kPositron;
123 return type == kMuonMinus ||
type == kMuonPlus;
135 return type == kTauMinus ||
type == kTauPlus;
170 for(
auto&
t : mctrks )
172 if (
t.mother_id ==
id )
r.push_back( &
t );
182 void print(std::ostream& out=std::cout)
const
184 out <<
"Trk: id=" <<
id <<
" pos=";
pos.
print(out);
186 out <<
" t=" <<
t <<
" E=" <<
E <<
" pdg-type=" <<
type;
#define ClassDef(name, version)
std::string to_string(const T &value)
Convert value to string.
AAObject is a base class for I/O-classes that adds the possibility to add 'user' information which wi...
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
void print(std::ostream &out=std::cout) const
Print track.
bool is_neutrino() const
Check if this is a netrino.
bool is_tau() const
Check if this is a tau.
bool is_primary() const
Check if this is a primary particle.
int status
MC status code, see km3net-dataformat/definitions/trkmembers.csv for values.
int type
MC: particle type in PDG encoding.
void read(const Trk &t)
Read track (useful in python).
std::vector< int > hit_ids
list of associated hit-ids (corresponds to Hit::id).
std::vector< double > error_matrix
(NxN) error covariance matrix for fit parameters (stored as linear vector)
std::vector< double > fitinf
place to store additional fit info, see km3net-dataformat/definitions/fitparameters....
void write(Trk &t) const
Write track (useful in python).
std::string comment
use as you like
std::vector< int > rec_stages
list of identifyers of succesfull fitting stages resulting in this track
bool is_finalstate() const
Test whether given particle is a final state inside the detector.
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...
bool is_lepton() const
Check if this is a charged lepton.
double E
Energy [GeV] (either MC truth or reconstructed)
int counter
used by CORSIKA7 MC generation to store interaction counters, see CORSIKA Userguide
bool is_e() const
Check if this is an electron or positron.
double t
track time [ns] (when the particle is at pos )
bool is_orphan() const
Check if this is an orphan (i.e.
double len
length, if applicable [m]
int rec_type
identifier of the fitting algorithm/chain/strategy, see km3net-dataformat/definitions/reconstruction....
std::string name() const
Get the name of the MC particle type.
int mother_id
MC id of the parent particle.
double lik
likelihood or lambda value (for aafit, lambda)
bool is_muon() const
Check if this is a muon.
Vec pos
postion [m] of the track at time t
Trk()
Default constructor.
The Vec class is a straightforward 3-d vector, which also works in pyroot.
void print(std::ostream &out=std::cout) const
Print vector.
static const int TRK_ST_FINALSTATE
for MC: the particle must be processed by detector simulation ('track_in' tag in evt files)....
static const int TRK_MOTHER_UNDEFINED
KM3NeT Data Definitions v3.4.0-8-ge14cb17 https://git.km3net.de/common/km3net-dataformat.
static const int TRK_ST_PRIMARYCOSMIC
initial state cosmic ray ('track_primary' tag in evt files from corant).
static const int TRK_ST_PRIMARYNEUTRINO
initial state neutrino ('neutrino' tag in evt files from gseagen and genhen).
static const int TRK_ST_UNDEFINED
status was not defined for this MC track (all reco tracks have this value)
static const int TRK_MOTHER_NONE
mother id of a particle if it has no parent