00001 #ifndef RootEventData_TMcParticle_H 00002 #define RootEventData_TMcParticle_H 1 00003 00004 #include "TObject.h" 00005 #include <vector> 00006 00007 using namespace std; 00008 00009 class TMcParticle : public TObject { 00010 00011 public: 00012 00013 TMcParticle(); 00014 ~TMcParticle(); 00015 //Get 00016 // Get associated id 00017 Int_t getParticleID() const {return m_particleID; } 00018 00019 // Get the track id 00020 Int_t getTrackIndex() const {return m_trackIndex; } 00021 00022 // Get the index for the vertex where the particle starts 00023 Int_t getVertexIndex0() const {return m_vertexIndex0; } 00024 00025 // Get the index for the vertex where the particle stops 00026 Int_t getVertexIndex1() const {return m_vertexIndex1; } 00027 00028 // Get Bit-field status flag 00029 UInt_t getStatusFlags() const {return m_statusFlags; } 00030 00031 // Get the initial position x 00032 Double_t getInitialPositionX() const {return m_xInitialPosition;} 00033 00034 // Get the initial position y 00035 Double_t getInitialPositionY() const {return m_yInitialPosition;} 00036 00037 // Get the initial position z 00038 Double_t getInitialPositionZ() const {return m_zInitialPosition;} 00039 00040 // Get the initial position time 00041 Double_t getInitialPositionT() const {return m_tInitialPosition;} 00042 00043 // Get the final position x 00044 Double_t getFinalPositionX() const {return m_xFinalPosition;} 00045 00046 // Get the final position y 00047 Double_t getFinalPositionY() const {return m_yFinalPosition;} 00048 00049 // Get the final position z 00050 Double_t getFinalPositionZ() const {return m_zFinalPosition;} 00051 00052 // Get the final position time 00053 Double_t getFinalPositionT() const {return m_tFinalPosition;} 00054 00055 // Get the initial momentum x 00056 Double_t getInitialMomentumX() const {return m_xInitialMomentum;} 00057 00058 // Get the initial momentum y 00059 Double_t getInitialMomentumY() const {return m_yInitialMomentum;} 00060 00061 // Get the initial momentum z 00062 Double_t getInitialMomentumZ() const {return m_zInitialMomentum;} 00063 00064 // Get the initial momentum energy 00065 Double_t getInitialMomentumE() const {return m_eInitialMomentum;} 00066 00067 // Get the final momentum x 00068 //Double_t getFinalMomentumX() const {return m_xFinalMomentum;} 00069 00070 // Get the final momentum y 00071 //Double_t getFinalMomentumY() const {return m_yFinalMomentum;} 00072 00073 // Get the final momentum z 00074 //Double_t getFinalMomentumZ() const {return m_zFinalMomentum;} 00075 00076 // Get the final momentum energy 00077 //Double_t getFinalMomentumE() const {return m_eFinalMomentum;} 00078 00079 // Bool_t primaryParticle() const; 00080 00081 // Get mother index 00082 Int_t getMother() const { return m_mother; } 00083 00084 // Get daughters index 00085 vector<Int_t> getDaughters() const { return m_daughters; } 00086 00087 // helper functions ported from McTruth 00088 enum StatusBits{ 00089 DECAYED =1 , 00090 DECAYFLT=1<<1, 00091 PRIMARY =1<<2, 00092 LEAF = 1<<3, 00093 ERROR = 1<<4 00094 //MISSED= 1<<2, //! Does not hit detector 00095 //NOINTER =1<<3, //! Traverses detector w/o interacting 00096 //STOPPED =1<<4, //! Energy below cut; other bits may say why 00097 //INTERACT=1<<5, //! Interacted, no further decision to be made 00098 //INTSHDEP=1<<6, //! Interacted, further decision depends on ! selection of shower deposition 00099 //PRIMARY =1<<7, //! primary particle 00100 //SWERROR =1<<8, //! Error occurred in swimming the track 00101 //BCKSPL=1<<9, //! The particle is backsplashed from the CAL back in the TKR region 00102 //POSHIT =1<<10, //! The particle released a hit a PositionHit detector 00103 //NOTTRACK=1<<11, //! Not tracked by user request 00104 //Swum = 1<<12, //! this particle was produced by the swimmer 00105 //LEAF = 1<<13 //! this particle is a leaf in the particle tree 00106 }; 00107 00108 // Retrieve whether this is a primary particle 00109 bool primaryParticle() const { return (m_statusFlags & PRIMARY)==PRIMARY;} 00110 // Retrieve whether this is a leave particle 00111 bool leafParticle() const { return (m_statusFlags & LEAF)==LEAF;} 00112 // Retrieve whether decayed from generator 00113 bool decayFromGenerator() const { return (m_statusFlags & DECAYED)==DECAYED;} 00114 // Retrieve wheter decayed in flight 00115 bool decayInFlight() const { return (m_statusFlags & DECAYFLT)==DECAYFLT;} 00116 00117 00118 00119 00120 //Set 00121 void setParticleID(Int_t particleID) {m_particleID = particleID;} 00122 void setTrackIndex(Int_t trackIndex) {m_trackIndex = trackIndex;} 00123 00124 void setVertexIndex0(Int_t vertexIndex0) {m_vertexIndex0 = vertexIndex0; } 00125 void setVertexIndex1(Int_t vertexIndex1) {m_vertexIndex1 = vertexIndex1; } 00126 void setStatusFlags(UInt_t statusFlags) {m_statusFlags = statusFlags; } 00127 00128 void setInitialPositionX(Double_t positionX) {m_xInitialPosition = positionX;} 00129 void setInitialPositionY(Double_t positionY) {m_yInitialPosition = positionY;} 00130 void setInitialPositionZ(Double_t positionZ) {m_zInitialPosition = positionZ;} 00131 void setInitialPositionT(Double_t positionT) {m_tInitialPosition = positionT;} 00132 00133 void setFinalPositionX(Double_t positionX) {m_xFinalPosition = positionX;} 00134 void setFinalPositionY(Double_t positionY) {m_yFinalPosition = positionY;} 00135 void setFinalPositionZ(Double_t positionZ) {m_zFinalPosition = positionZ;} 00136 void setFinalPositionT(Double_t positionT) {m_tFinalPosition = positionT;} 00137 00138 void setInitialMomentumX(Double_t momentumX) {m_xInitialMomentum = momentumX;} 00139 void setInitialMomentumY(Double_t momentumY) {m_yInitialMomentum = momentumY;} 00140 void setInitialMomentumZ(Double_t momentumZ) {m_zInitialMomentum = momentumZ;} 00141 void setInitialMomentumE(Double_t momentumE) {m_eInitialMomentum = momentumE;} 00142 00143 //void setFinalMomentumX(Double_t momentumX) {m_xFinalMomentum = momentumX;} 00144 //void setFinalMomentumY(Double_t momentumY) {m_yFinalMomentum = momentumY;} 00145 //void setFinalMomentumZ(Double_t momentumZ) {m_zFinalMomentum = momentumZ;} 00146 //void setFinalMomentumE(Double_t momentumE) {m_eFinalMomentum = momentumE;} 00147 00148 00149 void setMother(Int_t mother) {m_mother = mother; } 00150 void setDaughters(vector<Int_t>& daughters) { m_daughters = daughters; } 00151 00152 private: 00153 00154 Int_t m_particleID; 00155 00156 Int_t m_trackIndex; 00157 00158 Int_t m_vertexIndex0; 00159 00160 Int_t m_vertexIndex1; 00161 00162 UInt_t m_statusFlags; 00163 00164 Double_t m_xInitialPosition; 00165 Double_t m_yInitialPosition; 00166 Double_t m_zInitialPosition; 00167 Double_t m_tInitialPosition; 00168 00169 Double_t m_xFinalPosition; 00170 Double_t m_yFinalPosition; 00171 Double_t m_zFinalPosition; 00172 Double_t m_tFinalPosition; 00173 00174 Double_t m_xInitialMomentum; 00175 Double_t m_yInitialMomentum; 00176 Double_t m_zInitialMomentum; 00177 Double_t m_eInitialMomentum; 00178 00179 //Double_t m_xFinalMomentum; 00180 //Double_t m_yFinalMomentum; 00181 //Double_t m_zFinalMomentum; 00182 //Double_t m_eFinalMomentum; 00183 00184 Int_t m_mother; 00185 vector<Int_t> m_daughters; 00186 00187 ClassDef(TMcParticle,1) 00188 }; 00189 00190 00191 #endif //TrackRootData_TMcParticle_H 00192