BmnRoot
Loading...
Searching...
No Matches
CbmMCTrack.h
Go to the documentation of this file.
1// -------------------------------------------------------------------------
2// ----- CbmMCTrack header file -----
3// ----- should be replaced by BmnMCTrack -----
4// -------------------------------------------------------------------------
5
15#ifndef CBMMCTRACK_H
16#define CBMMCTRACK_H 1
17
18#include "BmnDetectorList.h"
19#include "TLorentzVector.h"
20#include "TMath.h"
21#include "TObject.h"
22#include "TParticle.h"
23#include "TVector3.h"
24
25class CbmMCTrack : public TObject
26{
27 public:
30
32 CbmMCTrack(Int_t pdgCode,
33 Int_t motherID,
34 Double_t px,
35 Double_t py,
36 Double_t pz,
37 Double_t x,
38 Double_t y,
39 Double_t z,
40 Double_t t,
41 Long64_t nPoints);
42
44 CbmMCTrack(const CbmMCTrack& track);
45
47 CbmMCTrack(TParticle* particle);
48
50 virtual ~CbmMCTrack();
51
53 void Print(Int_t iTrack = 0) const;
54
56 Int_t GetPdgCode() const { return fPdgCode; }
57 Int_t GetMotherId() const { return fMotherId; }
58 Double_t GetPx() const { return fPx; }
59 Double_t GetPy() const { return fPy; }
60 Double_t GetPz() const { return fPz; }
61 Double_t GetStartX() const { return fStartX; }
62 Double_t GetStartY() const { return fStartY; }
63 Double_t GetStartZ() const { return fStartZ; }
64 Double_t GetStartT() const { return fStartT; }
65 Double_t GetMass() const;
66 Double_t GetEnergy() const;
67 Double_t GetPt() const { return TMath::Sqrt(fPx * fPx + fPy * fPy); }
68 Double_t GetP() const { return TMath::Sqrt(fPx * fPx + fPy * fPy + fPz * fPz); }
69 Double_t GetRapidity() const;
70 void GetMomentum(TVector3& momentum) const;
71 void Get4Momentum(TLorentzVector& momentum) const;
72 void GetStartVertex(TVector3& vertex) const;
73
75 Long64_t GetNPoints(DetectorId detId) const;
77 Double_t GetPolar(Int_t indx) { return fPolar[indx]; }
78
80 void SetMotherId(Int_t id) { fMotherId = id; }
81 void SetNPoints(Int_t iDet, Long64_t np);
82 void SetPolar(Int_t indx, Double_t polar) { fPolar[indx] = polar; } // AZ-310822
83
84 private:
86 Int_t fPdgCode;
87
89 Int_t fMotherId;
90
92 Double32_t fPx, fPy, fPz;
93
95 Double32_t fStartX, fStartY, fStartZ, fStartT;
96
125 Long64_t fNPoints;
126 Double32_t fPolar[3]; // AZ-310822 - polarization
127
128 // AZ-310822 ClassDef(CbmMCTrack,2);
129 ClassDef(CbmMCTrack, 3); // AZ-310822
130};
131
132// ========== Inline functions ========================================
133inline Double_t CbmMCTrack::GetEnergy() const
134{
135 Double_t mass = GetMass();
136 return TMath::Sqrt(mass * mass + fPx * fPx + fPy * fPy + fPz * fPz);
137}
138
139inline void CbmMCTrack::GetMomentum(TVector3& momentum) const
140{
141 momentum.SetXYZ(fPx, fPy, fPz);
142}
143
144inline void CbmMCTrack::Get4Momentum(TLorentzVector& momentum) const
145{
146 momentum.SetXYZT(fPx, fPy, fPz, GetEnergy());
147}
148
149inline void CbmMCTrack::GetStartVertex(TVector3& vertex) const
150{
151 vertex.SetXYZ(fStartX, fStartY, fStartZ);
152}
153
154#endif
DetectorId
CbmMCTrack(const CbmMCTrack &track)
Double_t GetMass() const
Double_t GetPy() const
Definition CbmMCTrack.h:59
Double_t GetEnergy() const
Long64_t GetNPoints(DetectorId detId) const
Double_t GetPt() const
Definition CbmMCTrack.h:67
Double_t GetPz() const
Definition CbmMCTrack.h:60
virtual ~CbmMCTrack()
Double_t GetPx() const
Definition CbmMCTrack.h:58
CbmMCTrack(Int_t pdgCode, Int_t motherID, Double_t px, Double_t py, Double_t pz, Double_t x, Double_t y, Double_t z, Double_t t, Long64_t nPoints)
Double_t GetRapidity() const
Double_t GetStartZ() const
Definition CbmMCTrack.h:63
Double_t GetStartY() const
Definition CbmMCTrack.h:62
void GetMomentum(TVector3 &momentum) const
Int_t GetMotherId() const
Definition CbmMCTrack.h:57
void SetNPoints(Int_t iDet, Long64_t np)
Double_t GetP() const
Definition CbmMCTrack.h:68
void SetMotherId(Int_t id)
Definition CbmMCTrack.h:80
void SetPolar(Int_t indx, Double_t polar)
Definition CbmMCTrack.h:82
Double_t GetPolar(Int_t indx)
Definition CbmMCTrack.h:77
Double_t GetStartX() const
Definition CbmMCTrack.h:61
Double_t GetStartT() const
Definition CbmMCTrack.h:64
CbmMCTrack(TParticle *particle)
void Get4Momentum(TLorentzVector &momentum) const
void GetStartVertex(TVector3 &vertex) const
void Print(Int_t iTrack=0) const
Int_t GetPdgCode() const
Definition CbmMCTrack.h:56
Defines unique identifiers (enum) for all BM@N detector systems.