BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/RootEventData/include/RootEventData/TMcParticle.h
Go to the documentation of this file.
1#ifndef RootEventData_TMcParticle_H
2#define RootEventData_TMcParticle_H 1
3
4#include "TObject.h"
5#include <vector>
6
7using namespace std;
8
9class TMcParticle : public TObject {
10
11public:
14 // Get
15 // Get associated id
16 Int_t getParticleID() const { return m_particleID; }
17
18 // Get the track id
19 Int_t getTrackIndex() const { return m_trackIndex; }
20
21 // Get the index for the vertex where the particle starts
22 Int_t getVertexIndex0() const { return m_vertexIndex0; }
23
24 // Get the index for the vertex where the particle stops
25 Int_t getVertexIndex1() const { return m_vertexIndex1; }
26
27 // Get Bit-field status flag
28 UInt_t getStatusFlags() const { return m_statusFlags; }
29
30 // Get the initial position x
31 Double_t getInitialPositionX() const { return m_xInitialPosition; }
32
33 // Get the initial position y
34 Double_t getInitialPositionY() const { return m_yInitialPosition; }
35
36 // Get the initial position z
37 Double_t getInitialPositionZ() const { return m_zInitialPosition; }
38
39 // Get the initial position time
40 Double_t getInitialPositionT() const { return m_tInitialPosition; }
41
42 // Get the final position x
43 Double_t getFinalPositionX() const { return m_xFinalPosition; }
44
45 // Get the final position y
46 Double_t getFinalPositionY() const { return m_yFinalPosition; }
47
48 // Get the final position z
49 Double_t getFinalPositionZ() const { return m_zFinalPosition; }
50
51 // Get the final position time
52 Double_t getFinalPositionT() const { return m_tFinalPosition; }
53
54 // Get the initial momentum x
55 Double_t getInitialMomentumX() const { return m_xInitialMomentum; }
56
57 // Get the initial momentum y
58 Double_t getInitialMomentumY() const { return m_yInitialMomentum; }
59
60 // Get the initial momentum z
61 Double_t getInitialMomentumZ() const { return m_zInitialMomentum; }
62
63 // Get the initial momentum energy
64 Double_t getInitialMomentumE() const { return m_eInitialMomentum; }
65
66 // Get the final momentum x
67 // Double_t getFinalMomentumX() const {return m_xFinalMomentum;}
68
69 // Get the final momentum y
70 // Double_t getFinalMomentumY() const {return m_yFinalMomentum;}
71
72 // Get the final momentum z
73 // Double_t getFinalMomentumZ() const {return m_zFinalMomentum;}
74
75 // Get the final momentum energy
76 // Double_t getFinalMomentumE() const {return m_eFinalMomentum;}
77
78 // Bool_t primaryParticle() const;
79
80 // Get mother index
81 Int_t getMother() const { return m_mother; }
82
83 // Get daughters index
84 vector<Int_t> getDaughters() const { return m_daughters; }
85
86 // helper functions ported from McTruth
88 DECAYED = 1, //! Decayed by generator
89 DECAYFLT = 1 << 1, //! Decayed in flight
90 PRIMARY = 1 << 2, //! primary particle
91 LEAF = 1 << 3, //! this particle is a leaf in the particle tree
92 ERROR = 1 << 4 //! error
93 // MISSED= 1<<2, //! Does not hit detector
94 // NOINTER =1<<3, //! Traverses detector w/o interacting
95 // STOPPED =1<<4, //! Energy below cut; other bits may say why
96 // INTERACT=1<<5, //! Interacted, no further decision to be made
97 // INTSHDEP=1<<6, //! Interacted, further decision depends on ! selection of shower
98 // deposition PRIMARY =1<<7, //! primary particle SWERROR =1<<8, //! Error occurred in
99 // swimming the track BCKSPL=1<<9, //! The particle is backsplashed from the CAL back in
100 // the TKR region POSHIT =1<<10, //! The particle released a hit a PositionHit detector
101 // NOTTRACK=1<<11, //! Not tracked by user request
102 // Swum = 1<<12, //! this particle was produced by the swimmer
103 // LEAF = 1<<13 //! this particle is a leaf in the particle tree
104 };
105
106 // Retrieve whether this is a primary particle
107 bool primaryParticle() const { return ( m_statusFlags & PRIMARY ) == PRIMARY; }
108 // Retrieve whether this is a leave particle
109 bool leafParticle() const { return ( m_statusFlags & LEAF ) == LEAF; }
110 // Retrieve whether decayed from generator
111 bool decayFromGenerator() const { return ( m_statusFlags & DECAYED ) == DECAYED; }
112 // Retrieve wheter decayed in flight
113 bool decayInFlight() const { return ( m_statusFlags & DECAYFLT ) == DECAYFLT; }
114
115 // Set
116 void setParticleID( Int_t particleID ) { m_particleID = particleID; }
117 void setTrackIndex( Int_t trackIndex ) { m_trackIndex = trackIndex; }
118
119 void setVertexIndex0( Int_t vertexIndex0 ) { m_vertexIndex0 = vertexIndex0; }
120 void setVertexIndex1( Int_t vertexIndex1 ) { m_vertexIndex1 = vertexIndex1; }
121 void setStatusFlags( UInt_t statusFlags ) { m_statusFlags = statusFlags; }
122
123 void setInitialPositionX( Double_t positionX ) { m_xInitialPosition = positionX; }
124 void setInitialPositionY( Double_t positionY ) { m_yInitialPosition = positionY; }
125 void setInitialPositionZ( Double_t positionZ ) { m_zInitialPosition = positionZ; }
126 void setInitialPositionT( Double_t positionT ) { m_tInitialPosition = positionT; }
127
128 void setFinalPositionX( Double_t positionX ) { m_xFinalPosition = positionX; }
129 void setFinalPositionY( Double_t positionY ) { m_yFinalPosition = positionY; }
130 void setFinalPositionZ( Double_t positionZ ) { m_zFinalPosition = positionZ; }
131 void setFinalPositionT( Double_t positionT ) { m_tFinalPosition = positionT; }
132
133 void setInitialMomentumX( Double_t momentumX ) { m_xInitialMomentum = momentumX; }
134 void setInitialMomentumY( Double_t momentumY ) { m_yInitialMomentum = momentumY; }
135 void setInitialMomentumZ( Double_t momentumZ ) { m_zInitialMomentum = momentumZ; }
136 void setInitialMomentumE( Double_t momentumE ) { m_eInitialMomentum = momentumE; }
137
138 // void setFinalMomentumX(Double_t momentumX) {m_xFinalMomentum = momentumX;}
139 // void setFinalMomentumY(Double_t momentumY) {m_yFinalMomentum = momentumY;}
140 // void setFinalMomentumZ(Double_t momentumZ) {m_zFinalMomentum = momentumZ;}
141 // void setFinalMomentumE(Double_t momentumE) {m_eFinalMomentum = momentumE;}
142
143 void setMother( Int_t mother ) { m_mother = mother; }
144 void setDaughters( vector<Int_t>& daughters ) { m_daughters = daughters; }
145
146private:
147 Int_t m_particleID;
148
149 Int_t m_trackIndex;
150
151 Int_t m_vertexIndex0;
152
153 Int_t m_vertexIndex1;
154
155 UInt_t m_statusFlags;
156
157 Double_t m_xInitialPosition;
158 Double_t m_yInitialPosition;
159 Double_t m_zInitialPosition;
160 Double_t m_tInitialPosition;
161
162 Double_t m_xFinalPosition;
163 Double_t m_yFinalPosition;
164 Double_t m_zFinalPosition;
165 Double_t m_tFinalPosition;
166
167 Double_t m_xInitialMomentum;
168 Double_t m_yInitialMomentum;
169 Double_t m_zInitialMomentum;
170 Double_t m_eInitialMomentum;
171
172 // Double_t m_xFinalMomentum;
173 // Double_t m_yFinalMomentum;
174 // Double_t m_zFinalMomentum;
175 // Double_t m_eFinalMomentum;
176
177 Int_t m_mother;
178 vector<Int_t> m_daughters;
179
180 ClassDef( TMcParticle, 1 )
181};
182
183#endif // TrackRootData_TMcParticle_H
@ ERROR
this particle is a leaf in the particle tree
void setDaughters(vector< Int_t > &daughters)