BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
Simulation/BOOST/TruSim/TruSim-00-00-17/TruSim/BesTruthTrack.hh
Go to the documentation of this file.
1//---------------------------------------------------------------------------//
2//////// BOOST --- BESIII Object_Oriented Simulation Tool //
3////////---------------------------------------------------------------------------//
4////////Description:
5////////Author : Dengzy
6////
7//// ////Created: Aug, 2004
8//// ////Modified:
9//// ////Comment:
10//// ////---------------------------------------------------------------------------//
11//// //// $Id:BesTruthTrack.hh
12
13#ifndef BesTruthTrack_h
14#define BesTruthTrack_h 1
15
16#include <iostream>
17#include <vector>
18using namespace std;
19#include "CLHEP/Vector/LorentzVector.h"
20#include "BesTruthVertex.hh"
21
22using namespace CLHEP;
23
24class BesTruthTrack
25{
26 public:
29
30 friend ostream &operator<<(ostream &, const BesTruthTrack&);
31 friend ostream &operator<<(ostream &, const BesTruthTrack*);
32
33 enum { unassigned = -1 };
34
35 //return four momentum at origin
36 HepLorentzVector GetP4() const { return m_fourMomentum; }
37 void SetP4( const HepLorentzVector &p4 ) { m_fourMomentum = p4; }
38
39 //return particle ID (PDG)
40 G4int GetPDGCode() const {return m_PDGCode;}
41 void SetPDGCode(G4int code) {m_PDGCode=code;}
42
43 //return particle charge
44 G4double GetPDGCharge() const {return m_PDGCharge;}
45 void SetPDGCharge(G4double charge) {m_PDGCharge = charge;}
46
47 //return particle name of this track
48 G4String GetParticleName() const {return m_particleName;}
49 void SetParticleName(G4String name) {m_particleName=name;}
50
51 // Access vertex associated with the beginning of the track
52 BesTruthVertex* GetVertex() const {return m_vertex;}
53 void SetVertex(BesTruthVertex* vertex) {m_vertex=vertex;}
54
55 G4int GetBarcodeEndVtx() {return m_barcodeEndVtx;}
56 void SetBarcodeEndVtx(G4int vtx) {m_barcodeEndVtx = vtx;}
57
58 //Access vertex associated with the death of the track,
59 //or return zero if the track exited the detector.
60 BesTruthVertex* GetTerminalVertex() const {return m_terminalVertex;}
61 void SetTerminalVertex(BesTruthVertex* vertex) {m_terminalVertex=vertex;}
62
63 // Returns the index of this track
64 G4int GetIndex() const {return m_index;}
65 void SetIndex(G4int index) {m_index=index;}
66
67 //return the Geant4 trackId of this track
68 G4int GetG4TrackId() const {return m_g4TrackId;}
69 void SetG4TrackId(G4int trackId) {m_g4TrackId = trackId;}
70
71 // Return the youngest parent saved to GTrack. This may or
72 // may not be the immediate parent of the track.
74 {
75 if (m_vertex == 0) return 0;
76 return m_vertex->GetParentTrack();
77 }
78
79 //add an index of one daughter of this track
80 void AddDaughterIndex(G4int index) {m_daughterIndexes.push_back(index);}
81
82 //return indexes of daughters of this track
83 vector<int> GetDaughterIndexes() const {return m_daughterIndexes;}
84
85 void Found() {m_found = true;}
86 G4bool NotFound() {return !m_found;}
87
88 G4String GetSource() {return m_source;}
89 void SetSource(G4String source) {m_source=source;}
90
91 private:
92
93 //the four-momentum of the particle in the
94 //lab frame at the point of origin (as stored in GVertex)
95 HepLorentzVector m_fourMomentum;
96
97 //vertex representing the origin of this particle
98 BesTruthVertex* m_vertex;
99
100 //vertex representing the end of this particle
101 BesTruthVertex* m_terminalVertex;
102
103 G4int m_barcodeEndVtx;
104
105 //particle ID
106 G4int m_PDGCode;
107
108 //particle charge;
109 G4double m_PDGCharge;
110
111 //particle name
112 G4String m_particleName;
113
114 //index in trackList
115 G4int m_index;
116
117 //Geant4 track ID
118 G4int m_g4TrackId;
119
120 //indexes of daughter tracks
121 vector<int> m_daughterIndexes;
122
123 G4bool m_found;
124 G4String m_source;
125};
126
127#endif
friend ostream & operator<<(ostream &, const BesTruthTrack &)