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