BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
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
6/** CbmMCTrack.h
7 *@author V.Friese <v.friese@gsi.de>
8 **
9 ** Data class for storing Monte Carlo tracks processed by the CbmStack.
10 ** A MCTrack can be a primary track put into the simulation or a
11 ** secondary one produced by the transport through decay or interaction.
12 **
13 **/
14
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:
28 /** Default constructor **/
30
31 /** Standard constructor **/
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
43 /** Copy constructor **/
44 CbmMCTrack(const CbmMCTrack& track);
45
46 /** Constructor from TParticle **/
48
49 /** Destructor **/
50 virtual ~CbmMCTrack();
51
52 /** Output to screen **/
53 void Print(Int_t iTrack = 0) const;
54
55 /** Accessors **/
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; }
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); }
70 void GetMomentum(TVector3& momentum) const;
71 void Get4Momentum(TLorentzVector& momentum) const;
72 void GetStartVertex(TVector3& vertex) const;
73
74 /** Accessors to the number of MCPoints in the detectors **/
76 /**AZ-310822 Get polarization **/
77 Double_t GetPolar(Int_t indx) { return fPolar[indx]; }
78
79 /** Modifiers **/
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:
85 /** PDG particle code **/
87
88 /** Index of mother track. -1 for primary particles. **/
90
91 /** Momentum components at start vertex [GeV] **/
93
94 /** Coordinates of start vertex [cm, ns] **/
96
97 /** Bitvector representing the number of MCPoints for this track in each subdetector.
98 ** The detectors are represented by
99 ** REF: Bit 0 (1 bit, max. value 1)
100 ** BD: Bit 1 (1 bit, max. value 1)
101 ** GEM: Bit 2 - 4 (3 bits, max. value 7) /7
102 ** TOF1: Bit 5 - 6 (2 bit, max. value 3) /1 (3)
103 ** DCH: Bit 7 - 11 (5 bits, max. value 31) /16
104 ** TOF: Bit 12 - 13 (2 bit, max. value 3) /1 (3)
105 ** ZDC: Bit 14 - 20 (7 bit, max. value 127) /64
106 ** VSP: Bit 21 - 23 (3 bit, max. value 7) /4
107 ** MWPC: Bit 24 - 28 (5 bit, max. value 31) /24
108 ** ECAL: Bit 29 - 35 (7 bits, max. value 127) /110
109 ** CSC: Bit 36 - 38 (3 bit, max. value 7) /6
110 ** SILICON: Bit 39 - 41 (3 bit, max. value 7) /4
111 ** LAND: Bit 42 - 47 (6 bit, max. value 63) /60
112 ** FD: Bit 48 (1 bit, max. value 1)
113 ** ARMTRIG: Bit 49 - 50 (2 bit, max. value 3) /2
114 ** BC: Bit 51 (1 bit, max. value 1)
115 ** SCWALL: Bit 52 (1 bit, max. value 1)
116 ** HODO: Bit 53 (1 bit, max. value 1)
117 ** SiMD: Bit 54 (1 bit, max. value 1)
118 ** SiBT: Bit 55 - 56 (2 bit, max. value 3)
119 ** FHCAL: Bit 57 (1 bit, max. value 1)
120 ** NDET: Bit 58 (1 bit, max. value 1)
121 ** SiProf Bit 59 - 60 (2 bit, max. value 3)
122 ** VACWALL: Bit 61 (1 bit, max. value 1)
123 ** The respective point numbers can be accessed and modified with the inline functions.
124 **/
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
int Int_t
double Double32_t
double Double_t
long long Long64_t
#define ClassDef(name, id)
DetectorId
BM@N DetectorID enumerator.
CbmMCTrack.h.
Definition CbmMCTrack.h:26
CbmMCTrack()
Default constructor.
CbmMCTrack(const CbmMCTrack &track)
Copy constructor.
Double_t GetMass() const
Double32_t fPolar[3]
Definition CbmMCTrack.h:126
Double_t GetPy() const
Definition CbmMCTrack.h:59
Double_t GetEnergy() const
Long64_t fNPoints
Bitvector representing the number of MCPoints for this track in each subdetector.
Definition CbmMCTrack.h:125
Long64_t GetNPoints(DetectorId detId) const
Accessors to the number of MCPoints in the detectors.
Double32_t fPx
Momentum components at start vertex [GeV].
Definition CbmMCTrack.h:92
Double32_t fPy
Definition CbmMCTrack.h:92
Double_t GetPt() const
Definition CbmMCTrack.h:67
Double32_t fStartZ
Definition CbmMCTrack.h:95
Double32_t fStartT
Definition CbmMCTrack.h:95
Double_t GetPz() const
Definition CbmMCTrack.h:60
virtual ~CbmMCTrack()
Destructor.
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)
Standard constructor.
Double_t GetRapidity() const
Double_t GetStartZ() const
Definition CbmMCTrack.h:63
Int_t fMotherId
Index of mother track.
Definition CbmMCTrack.h:89
Double_t GetStartY() const
Definition CbmMCTrack.h:62
void GetMomentum(TVector3 &momentum) const
Int_t GetMotherId() const
Definition CbmMCTrack.h:57
Double32_t fStartY
Definition CbmMCTrack.h:95
Int_t fPdgCode
PDG particle code.
Definition CbmMCTrack.h:86
void SetNPoints(Int_t iDet, Long64_t np)
Double_t GetP() const
Definition CbmMCTrack.h:68
void SetMotherId(Int_t id)
Modifiers.
Definition CbmMCTrack.h:80
void SetPolar(Int_t indx, Double_t polar)
Definition CbmMCTrack.h:82
Double_t GetPolar(Int_t indx)
AZ-310822 Get polarization.
Definition CbmMCTrack.h:77
Double32_t fPz
Definition CbmMCTrack.h:92
Double_t GetStartX() const
Definition CbmMCTrack.h:61
Double_t GetStartT() const
Definition CbmMCTrack.h:64
CbmMCTrack(TParticle *particle)
Constructor from TParticle.
void Get4Momentum(TLorentzVector &momentum) const
Double32_t fStartX
Coordinates of start vertex [cm, ns].
Definition CbmMCTrack.h:95
void GetStartVertex(TVector3 &vertex) const
void Print(Int_t iTrack=0) const
Output to screen.
Int_t GetPdgCode() const
Accessors.
Definition CbmMCTrack.h:56
void SetXYZT(Double_t x, Double_t y, Double_t z, Double_t t)
void SetXYZ(Double_t x, Double_t y, Double_t z)
Defines unique identifiers (enum) for all BM@N detector systems.
Double_t Sqrt(Double_t x)