00001 //---------------------------------------------------------------------------// 00012 00013 #ifndef BesTruthTrack_h 00014 #define BesTruthTrack_h 1 00015 00016 #include <iostream> 00017 #include <vector> 00018 using namespace std; 00019 #include "CLHEP/Vector/LorentzVector.h" 00020 #include "BesTruthVertex.hh" 00021 00022 using namespace CLHEP; 00023 00024 class BesTruthTrack 00025 { 00026 public: 00027 BesTruthTrack(); 00028 ~BesTruthTrack() {}; 00029 00030 friend ostream &operator<<(ostream &, const BesTruthTrack&); 00031 friend ostream &operator<<(ostream &, const BesTruthTrack*); 00032 00033 enum { unassigned = -1 }; 00034 00035 //return four momentum at origin 00036 HepLorentzVector GetP4() const { return m_fourMomentum; } 00037 void SetP4( const HepLorentzVector &p4 ) { m_fourMomentum = p4; } 00038 00039 //return particle ID (PDG) 00040 G4int GetPDGCode() const {return m_PDGCode;} 00041 void SetPDGCode(G4int code) {m_PDGCode=code;} 00042 00043 //return particle charge 00044 G4double GetPDGCharge() const {return m_PDGCharge;} 00045 void SetPDGCharge(G4double charge) {m_PDGCharge = charge;} 00046 00047 //return particle name of this track 00048 G4String GetParticleName() const {return m_particleName;} 00049 void SetParticleName(G4String name) {m_particleName=name;} 00050 00051 // Access vertex associated with the beginning of the track 00052 BesTruthVertex* GetVertex() const {return m_vertex;} 00053 void SetVertex(BesTruthVertex* vertex) {m_vertex=vertex;} 00054 00055 G4int GetBarcodeEndVtx() {return m_barcodeEndVtx;} 00056 void SetBarcodeEndVtx(G4int vtx) {m_barcodeEndVtx = vtx;} 00057 00058 //Access vertex associated with the death of the track, 00059 //or return zero if the track exited the detector. 00060 BesTruthVertex* GetTerminalVertex() const {return m_terminalVertex;} 00061 void SetTerminalVertex(BesTruthVertex* vertex) {m_terminalVertex=vertex;} 00062 00063 // Returns the index of this track 00064 G4int GetIndex() const {return m_index;} 00065 void SetIndex(G4int index) {m_index=index;} 00066 00067 //return the Geant4 trackId of this track 00068 G4int GetG4TrackId() const {return m_g4TrackId;} 00069 void SetG4TrackId(G4int trackId) {m_g4TrackId = trackId;} 00070 00071 // Return the youngest parent saved to GTrack. This may or 00072 // may not be the immediate parent of the track. 00073 BesTruthTrack* GetParentTrack() 00074 { 00075 if (m_vertex == 0) return 0; 00076 return m_vertex->GetParentTrack(); 00077 } 00078 00079 //add an index of one daughter of this track 00080 void AddDaughterIndex(G4int index) {m_daughterIndexes.push_back(index);} 00081 00082 //return indexes of daughters of this track 00083 vector<int> GetDaughterIndexes() const {return m_daughterIndexes;} 00084 00085 void Found() {m_found = true;} 00086 G4bool NotFound() {return !m_found;} 00087 00088 G4String GetSource() {return m_source;} 00089 void SetSource(G4String source) {m_source=source;} 00090 00091 private: 00092 00093 //the four-momentum of the particle in the 00094 //lab frame at the point of origin (as stored in GVertex) 00095 HepLorentzVector m_fourMomentum; 00096 00097 //vertex representing the origin of this particle 00098 BesTruthVertex* m_vertex; 00099 00100 //vertex representing the end of this particle 00101 BesTruthVertex* m_terminalVertex; 00102 00103 G4int m_barcodeEndVtx; 00104 00105 //particle ID 00106 G4int m_PDGCode; 00107 00108 //particle charge; 00109 G4double m_PDGCharge; 00110 00111 //particle name 00112 G4String m_particleName; 00113 00114 //index in trackList 00115 G4int m_index; 00116 00117 //Geant4 track ID 00118 G4int m_g4TrackId; 00119 00120 //indexes of daughter tracks 00121 vector<int> m_daughterIndexes; 00122 00123 G4bool m_found; 00124 G4String m_source; 00125 }; 00126 00127 #endif