er  dev
ERMCTrack.h
1 /********************************************************************************
2  * Copyright (C) Joint Institute for Nuclear Research *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
18 #ifndef ERMCTRACK_H_
19 #define ERMCTRACK_H_
20 
21 #include "ERDetectorList.h"
22 
23 #include "TObject.h"
24 #include "TMath.h"
25 #include "TVector3.h"
26 #include "TLorentzVector.h"
27 #include "TParticle.h"
28 
29 enum ExpertTrackingStatus{
30  Entering,
31  Exiting,
32  Inside,
33  Stop
34 };
35 
36 class TParticle;
37 
38 class ERMCTrack : public TObject
39 {
40 public:
42  ERMCTrack();
43 
45  ERMCTrack(Int_t pdgCode, Int_t motherID, Double_t px, Double_t py,
46  Double_t pz, Double_t x, Double_t y, Double_t z,
47  Double_t t, Int_t nPoints);
48 
50  ERMCTrack(const ERMCTrack& track);
51 
53  ERMCTrack(TParticle* particle);
54 
55 
57  virtual ~ERMCTrack();
58 
60  void Print(Int_t iTrack=0) const;
61 
62  //Int_t AccNeuRad() const {return GetNPoints(kNEURAD);}
64  Int_t GetPdgCode() const { return fPdgCode; }
65  Int_t GetMotherId() const { return fMotherId; }
66  Double_t GetPx() const { return fPx; }
67  Double_t GetPy() const { return fPy; }
68  Double_t GetPz() const { return fPz; }
69  Double_t GetStartX() const { return fStartX; }
70  Double_t GetStartY() const { return fStartY; }
71  Double_t GetStartZ() const { return fStartZ; }
72  Double_t GetStartT() const { return fStartT; }
73  Double_t GetMass() const;
74  Double_t GetCharge() const;
75  Double_t GetEnergy() const;
76  Double_t GetPt() const { return TMath::Sqrt(fPx*fPx+fPy*fPy); }
77  Double_t GetP() const { return TMath::Sqrt(fPx*fPx+fPy*fPy+fPz*fPz); }
78  Double_t GetRapidity() const;
79  void GetMomentum(TVector3& momentum) const;
80  void Get4Momentum(TLorentzVector& momentum) const;
81  void GetStartVertex(TVector3& vertex) const;
82  TLorentzVector GetVector();
83  Double_t GetTheta();
84  Double_t GetPhi();
85 
86 
88  Int_t GetNPoints(DetectorId detId) const;
89 
90 
92  void SetMotherId(Int_t id) { fMotherId = id; }
93  void SetNPoints(Int_t iDet, Int_t np);
94 
95 private:
96  Double_t CalculateMass();
97  Double_t CalculateEnergy();
98 
99  Int_t fID;
100 
102  Int_t fPdgCode;
103 
105  Int_t fMotherId;
106 
108  Double32_t fPx, fPy, fPz;
109 
111  Double32_t fStartX, fStartY, fStartZ, fStartT;
112 
113  Int_t fNPoints;
114  Double_t fMass;
115  Double_t fEnergy;
116  Double_t fTheta,fPhi;
117 
118  TLorentzVector fMomentum;
119 
120  ClassDef(ERMCTrack,2);
121 
122 };
123 
124 inline Double_t ERMCTrack::GetEnergy() const {
125  return fEnergy;
126 }
127 
128 inline void ERMCTrack::GetMomentum(TVector3& momentum) const {
129  momentum.SetXYZ(fPx,fPy,fPz);
130 }
131 
132 inline void ERMCTrack::Get4Momentum(TLorentzVector& momentum) const {
133  momentum.SetXYZT(fPx,fPy,fPz,fEnergy);
134 }
135 
136 inline void ERMCTrack::GetStartVertex(TVector3& vertex) const {
137  vertex.SetXYZ(fStartX,fStartY,fStartZ);
138 }
139 #endif /* ERMCTRACK_H_ */
Int_t fPdgCode
Definition: ERMCTrack.h:102
Int_t fMotherId
Definition: ERMCTrack.h:105
Int_t GetNPoints(DetectorId detId) const
Definition: ERMCTrack.cxx:129
Double32_t fStartX
Definition: ERMCTrack.h:111
Int_t GetPdgCode() const
Definition: ERMCTrack.h:64
Double32_t fPx
Definition: ERMCTrack.h:108
virtual ~ERMCTrack()
Definition: ERMCTrack.cxx:101
void Print(Int_t iTrack=0) const
Definition: ERMCTrack.cxx:103
void SetMotherId(Int_t id)
Definition: ERMCTrack.h:92