Track.h
Go to the documentation of this file.
1 /*
2  * Track.h
3  *
4  * Created on: Feb 22, 2021
5  * Author: chilgenb
6  */
7 
8 #ifndef GARANA_TRACK_H_
9 #define GARANA_TRACK_H_
10 
11 #include <TLorentzVector.h>
12 #include <TVector3.h>
13 
14 #include <climits>
15 #include <vector>
16 #include <utility>
17 
18 using std::pair;
19 using std::vector;
20 
21 namespace garana {
22  class Track {
23 
24  public:
25 
26  Track();
27 
28  #ifndef __GCCXML__
29 
30  Track(const float& lenFw, const float& lenBk, const float& pBeg, const float& pEnd,
31  const TLorentzVector& vtx, const TLorentzVector& end, const TVector3& vtxDir, const TVector3& endDir,
32  const float& chiFwd, const float& chiBac, const size_t& nHit,
33  const float* trkParBeg, const float* trkParEnd, const float* covarBeg, const float* covarEnd,
34  const int& chargeFwd, const int& chargeBac, const vector<pair<int,float>>& pidf, const vector<pair<int,float>>& pidb,
35  const float& ionf, const float& ionb, const vector<pair<UInt_t,TLorentzVector>>& truePosVtx,
36  const vector<pair<UInt_t,TLorentzVector>>& truePosEnd, const vector<pair<UInt_t,TLorentzVector>>& trueMomVtx,
37  const vector<pair<UInt_t,TLorentzVector>>& trueMomEnd, const vector<std::pair<int,float>>& trueEnergy);
38  #endif
39 
40  /*int TruthMatchID(); ///< returns the G4 track ID for the particle contributing the most energy to this track
41  float TruthMatchEDep(); ///< returns the total energy deposited by the particle contributing the most energy to this track
42  float TruthMatchEDepFrac();*/ ///< returns the fraction of the total energy contributed to this track that was deposited by the particle contributing the most energy to this track
43 
44  //private:
45 
46  float fLenFwd; ///< length of the track in cm from forwards fit
47  float fLenBac; ///< length of the track in cm from backwards fit
48  float fMomBeg; ///< momentum of the track at the vertex in GeV/c
49  float fMomEnd; ///< momentum of the track at the end in GeV/c
50  TLorentzVector fVtx; ///< track vertex position 4-vector [cm,ns] (vtx vs. end arbitrary)
51  TLorentzVector fEnd; ///< track end position 4-vector [cm,ns] (vtx vs. end arbitrary)
52  TVector3 fVtxDir; ///< track vertex direction
53  TVector3 fEndDir; ///< track end direction
54  float fChiFwd; ///< chisquared forward fit
55  float fChiBac; ///< chisquared backward fit
56  size_t fNHits; ///< number of hits
57 
58  float fTrackParBeg[5]; ///< Track parameters at beginning of track y, z, curvature, phi, lambda -- 5-param track (cm, cm, cm-1, rad, rad)
59  float fTrackParEnd[5]; ///< Track parameters at end of track y, z, curvature, phi, lambda -- 5-param track (cm, cm, cm-1, rad, rad)
60  float fCovMatBeg[15]; ///< covariance matrix at beginning of track -- packed in a 1D array, assuming symmetry
61  float fCovMatEnd[15]; ///< covariance matrix at end of track
62 
63  int fChgFwd;
64  int fChgBac;
65  float fIonFwd;
66  float fIonBac;
67  vector<pair<int,float>> fPidFwd;
68  vector<pair<int,float>> fPidBac;
69 
70  vector<pair<UInt_t,TLorentzVector>> fTruePosVtx; ///< 4-position for each assc'd MCParticle at track vertex
71  vector<pair<UInt_t,TLorentzVector>> fTruePosEnd; ///< 4-position for each assc'd MCParticle at track end
72  vector<pair<UInt_t,TLorentzVector>> fTrueMomVtx; ///< 4-momentum for each assc'd MCParticle at track vertex
73  vector<pair<UInt_t,TLorentzVector>> fTrueMomEnd; ///< 4-momentum for each assc'd MCParticle at track end
74  vector<std::pair<int,float>> fTrueEnergy; ///< true energy (second) [GeV] deposited by MCParticle with trackID (first)
75 
76  }; //class
77 }//namespace
78 
79 #endif /* GARANA_TRACK_H_ */
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
float fCovMatEnd[15]
covariance matrix at end of track
Definition: Track.h:61
int fChgFwd
Definition: Track.h:63
vector< pair< int, float > > fPidBac
Definition: Track.h:68
float fTrackParBeg[5]
Track parameters at beginning of track y, z, curvature, phi, lambda – 5-param track (cm...
Definition: Track.h:58
float fCovMatBeg[15]
covariance matrix at beginning of track – packed in a 1D array, assuming symmetry ...
Definition: Track.h:60
int fChgBac
Definition: Track.h:64
struct vector vector
vector< pair< UInt_t, TLorentzVector > > fTrueMomEnd
4-momentum for each assc&#39;d MCParticle at track end
Definition: Track.h:73
TVector3 fVtxDir
track vertex direction
Definition: Track.h:52
float fIonBac
Definition: Track.h:66
float fMomBeg
momentum of the track at the vertex in GeV/c
Definition: Track.h:48
float fLenBac
length of the track in cm from backwards fit
Definition: Track.h:47
size_t fNHits
number of hits
Definition: Track.h:56
vector< pair< UInt_t, TLorentzVector > > fTruePosVtx
4-position for each assc&#39;d MCParticle at track vertex
Definition: Track.h:70
float fTrackParEnd[5]
Track parameters at end of track y, z, curvature, phi, lambda – 5-param track (cm, cm, cm-1, rad, rad)
Definition: Track.h:59
float fChiBac
chisquared backward fit
Definition: Track.h:55
vector< pair< int, float > > fPidFwd
Definition: Track.h:67
float fLenFwd
< returns the fraction of the total energy contributed to this track that was deposited by the partic...
Definition: Track.h:46
vector< pair< UInt_t, TLorentzVector > > fTruePosEnd
4-position for each assc&#39;d MCParticle at track end
Definition: Track.h:71
float fIonFwd
Definition: Track.h:65
float fMomEnd
momentum of the track at the end in GeV/c
Definition: Track.h:49
vector< pair< UInt_t, TLorentzVector > > fTrueMomVtx
4-momentum for each assc&#39;d MCParticle at track vertex
Definition: Track.h:72
TLorentzVector fVtx
track vertex position 4-vector cm,ns
Definition: Track.h:50
TLorentzVector fEnd
track end position 4-vector cm,ns
Definition: Track.h:51
TVector3 fEndDir
track end direction
Definition: Track.h:53
vector< std::pair< int, float > > fTrueEnergy
true energy (second) [GeV] deposited by MCParticle with trackID (first)
Definition: Track.h:74
float fChiFwd
chisquared forward fit
Definition: Track.h:54