FairRoot/PandaRoot
PndMCTrack.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndMCTrack header file -----
3 // ----- Created 03/08/04 by V. Friese -----
4 // ----- Adapted to Panda M. Al-Turany -----
5 // -------------------------------------------------------------------------
6 
7 
17 #ifndef CBMMCTRACK_H
18 #define CBMMCTRACK_H 1
19 
20 #include "PndDetectorList.h"
21 #include "TObject.h"
22 #include "TParticle.h"
23 #include "TVector3.h"
24 #include "TLorentzVector.h"
25 
26 #include <iostream>
27 
28 #ifndef ROOT_TParticlePDG
29 #include "TParticlePDG.h"
30 #endif
31 #ifndef ROOT_TDatabasePDG
32 #include "TDatabasePDG.h"
33 #endif
34 
35 class PndMCTrack : public TObject
36 {
37 
38  public:
39 
40 
42  PndMCTrack();
43 
44 
46 // PndMCTrack(Int_t pdgCode, Int_t motherID, TVector3 startVvertex,
48 // Double_t startTime, TLorentzVector momentum, Int_t nPoint=0);
49 
50 
52  PndMCTrack(const PndMCTrack& track);
53 
54 
56  PndMCTrack(TParticle* particle);
57 
58 
60  virtual ~PndMCTrack();
61 
62 
64  void Print(Int_t iTrack = 0) const;
65 
67  track.Print();
68  return out;
69  }
70 
71 
73  Int_t GetPdgCode() const { return fPdgCode; }
74  Int_t GetMotherID() const { return fMotherID; }
75  Int_t GetSecondMotherID() const { return fSecondMotherID; }
76  TVector3 GetStartVertex() const { return TVector3(fStartX, fStartY,fStartZ);}
77  Double_t GetStartTime() const { return fStartT; }
78  TVector3 GetMomentum() const { return TVector3(fPx, fPy, fPz); }
79  Double_t GetPt() const { return TMath::Sqrt(fPx*fPx+fPy*fPy); }
80  /*
81  Int_t GetStsPoints() const { return (fPoints & 15 ) ; }
82  */
83 
84  Bool_t IsGeneratorCreated(void) const { return (fGeneratorFlags&0x1)!=0; }
85  Bool_t IsGeneratorDecayed(void) const { return (fGeneratorFlags&0x2)!=0; }
86  Bool_t IsGeneratorLast(void) const { return (fGeneratorFlags&0x1)!=0 && (fGeneratorFlags&0x2)==0; }
87  void SetGeneratorCreated(void) { fGeneratorFlags|=0x1; }
88  void SetGeneratorDecayed(void) { fGeneratorFlags|=0x2; }
89 
90  Int_t GetNPoints(DetectorId detId) const;
93  void SetMotherID(Int_t id) { fMotherID = id; }
94  void SetSecondMotherID(Int_t id) { fSecondMotherID = id; }
95  /*
96  void SetStsPoints(Int_t np);
97  */
98 
99 
101  /*
102  void AddStsPoint() { SetStsPoints( GetStsPoints() + 1 ); }
103  */
104 
105 
106  void SetNPoints(Int_t iDet, Int_t np);
107 
108  TLorentzVector Get4Momentum() const;
109 
110 
111 private:
112 
114  Int_t fPdgCode;
115 
117  Double32_t fPx, fPy, fPz, fE;
118 
120  Int_t fMotherID;
122 
125 
128 
150  Int_t fPoints;
151 
152  ClassDef(PndMCTrack,1);
153 
154 };
155 
156 
157 
158 #endif
ClassDef(PndMCTrack, 1)
Int_t fPoints
Definition: PndMCTrack.h:150
Int_t GetNPoints(DetectorId detId) const
Definition: PndMCTrack.cxx:120
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
Int_t GetPdgCode() const
Definition: PndMCTrack.h:73
void SetNPoints(Int_t iDet, Int_t np)
Definition: PndMCTrack.cxx:143
Double32_t fE
Definition: PndMCTrack.h:117
Double32_t fPx
Definition: PndMCTrack.h:117
TVector3 GetMomentum() const
Definition: PndMCTrack.h:78
Double32_t fPy
Definition: PndMCTrack.h:117
Double32_t fStartX
Definition: PndMCTrack.h:127
void SetGeneratorDecayed(void)
Definition: PndMCTrack.h:88
Bool_t IsGeneratorCreated(void) const
Definition: PndMCTrack.h:84
TLorentzVector Get4Momentum() const
Definition: PndMCTrack.cxx:102
Double32_t fPz
Definition: PndMCTrack.h:117
const int particle
Int_t fMotherID
Definition: PndMCTrack.h:120
Double32_t fStartT
Definition: PndMCTrack.h:127
Double_t GetPt() const
Definition: PndMCTrack.h:79
Double_t
Int_t fSecondMotherID
Definition: PndMCTrack.h:121
PndMCTrack * track
Definition: anaLmdCluster.C:89
Bool_t IsGeneratorDecayed(void) const
Definition: PndMCTrack.h:85
Double32_t fStartZ
Definition: PndMCTrack.h:127
void Print(Int_t iTrack=0) const
Definition: PndMCTrack.cxx:95
Double32_t fStartY
Definition: PndMCTrack.h:127
TFile * out
Definition: reco_muo.C:20
Bool_t IsGeneratorLast(void) const
Definition: PndMCTrack.h:86
Int_t GetSecondMotherID() const
Definition: PndMCTrack.h:75
friend std::ostream & operator<<(std::ostream &out, PndMCTrack &track)
Definition: PndMCTrack.h:66
void SetSecondMotherID(Int_t id)
Definition: PndMCTrack.h:94
void SetGeneratorCreated(void)
Definition: PndMCTrack.h:87
void SetMotherID(Int_t id)
Definition: PndMCTrack.h:93
TVector3 GetStartVertex() const
Definition: PndMCTrack.h:76
Int_t GetMotherID() const
Definition: PndMCTrack.h:74
virtual ~PndMCTrack()
Definition: PndMCTrack.cxx:89
Int_t fPdgCode
Definition: PndMCTrack.h:114
Int_t fGeneratorFlags
Definition: PndMCTrack.h:124
Double_t GetStartTime() const
Definition: PndMCTrack.h:77