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