EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PndMCTrack.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PndMCTrack.h
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 #ifndef ROOT_TParticlePDG
27 #include "TParticlePDG.h"
28 #endif
29 #ifndef ROOT_TDatabasePDG
30 #include "TDatabasePDG.h"
31 #endif
32 
33 class PndMCTrack : public TObject
34 {
35 
36  public:
37 
38 
40  PndMCTrack();
41 
42 
44 
45 // PndMCTrack(Int_t pdgCode, Int_t motherID, TVector3 startVvertex,
46 // Double_t startTime, TLorentzVector momentum, Int_t nPoint=0);
47 
48 
50  PndMCTrack(const PndMCTrack& track);
51 
52 
54  PndMCTrack(TParticle* particle);
55 
56 
58  virtual ~PndMCTrack();
59 
60 
62  void Print(Int_t iTrack) const;
63 
64 
66  Int_t GetPdgCode() const { return fPdgCode; }
67  Int_t GetMotherID() const { return fMotherID; }
68  Int_t GetSecondMotherID() const { return fSecondMotherID; }
69  TVector3 GetStartVertex() const { return TVector3(fStartX, fStartY,fStartZ);}
70  Double_t GetStartTime() const { return fStartT; }
71  TVector3 GetMomentum() const { return TVector3(fPx, fPy, fPz); }
72  Double_t GetPt() const { return TMath::Sqrt(fPx*fPx+fPy*fPy); }
73  /*
74  Int_t GetStsPoints() const { return (fPoints & 15 ) ; }
75  */
76 
77  Bool_t IsGeneratorCreated(void) const { return (fGeneratorFlags&0x1)!=0; }
78  Bool_t IsGeneratorDecayed(void) const { return (fGeneratorFlags&0x2)!=0; }
79  Bool_t IsGeneratorLast(void) const { return (fGeneratorFlags&0x1)!=0 && (fGeneratorFlags&0x2)==0; }
80  void SetGeneratorCreated(void) { fGeneratorFlags|=0x1; }
81  void SetGeneratorDecayed(void) { fGeneratorFlags|=0x2; }
82 
83  Int_t GetNPoints(DetectorId detId) const;
86  void SetMotherID(Int_t id) { fMotherID = id; }
87  void SetSecondMotherID(Int_t id) { fSecondMotherID = id; }
88  /*
89  void SetStsPoints(Int_t np);
90  */
91 
92 
94  /*
95  void AddStsPoint() { SetStsPoints( GetStsPoints() + 1 ); }
96  */
97 
98 
99  void SetNPoints(Int_t iDet, Int_t np);
100 
101  TLorentzVector Get4Momentum() const;
102 
103 
104 private:
105 
107  Int_t fPdgCode;
108 
110  Double32_t fPx, fPy, fPz, fE;
111 
113  Int_t fMotherID;
115 
118 
121 
143  Int_t fPoints;
144 
145  ClassDef(PndMCTrack,1);
146 
147 };
148 
149 
150 
151 #endif