BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
BesTruthTrack Class Reference

#include <BesTruthTrack.hh>

Public Types

enum  { unassigned = -1 }
 

Public Member Functions

 BesTruthTrack ()
 
 ~BesTruthTrack ()
 
HepLorentzVector GetP4 () const
 
void SetP4 (const HepLorentzVector &p4)
 
G4int GetPDGCode () const
 
void SetPDGCode (G4int code)
 
G4double GetPDGCharge () const
 
void SetPDGCharge (G4double charge)
 
G4String GetParticleName () const
 
void SetParticleName (G4String name)
 
BesTruthVertexGetVertex () const
 
void SetVertex (BesTruthVertex *vertex)
 
G4int GetBarcodeEndVtx ()
 
void SetBarcodeEndVtx (G4int vtx)
 
BesTruthVertexGetTerminalVertex () const
 
void SetTerminalVertex (BesTruthVertex *vertex)
 
G4int GetIndex () const
 
void SetIndex (G4int index)
 
G4int GetG4TrackId () const
 
void SetG4TrackId (G4int trackId)
 
BesTruthTrackGetParentTrack ()
 
void AddDaughterIndex (G4int index)
 
vector< int > GetDaughterIndexes () const
 
void Found ()
 
G4bool NotFound ()
 
G4String GetSource ()
 
void SetSource (G4String source)
 

Friends

ostream & operator<< (ostream &, const BesTruthTrack &)
 
ostream & operator<< (ostream &, const BesTruthTrack *)
 

Detailed Description

Definition at line 24 of file BesTruthTrack.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
unassigned 

Definition at line 33 of file BesTruthTrack.hh.

33{ unassigned = -1 };

Constructor & Destructor Documentation

◆ BesTruthTrack()

BesTruthTrack::BesTruthTrack ( )

Definition at line 17 of file BesTruthTrack.cc.

18:m_fourMomentum(0),m_daughterIndexes(0)
19{
20 //m_fourMomentum;
21 m_vertex=0;
22 m_terminalVertex=0;
23 m_PDGCode=0;
24 m_PDGCharge=-99;
25 m_particleName="";
26 m_index=unassigned;
27 m_g4TrackId=-99;
28 //m_daughterIndexes=0;
29 m_found=false;
30 m_source="";
31}

◆ ~BesTruthTrack()

BesTruthTrack::~BesTruthTrack ( )
inline

Definition at line 28 of file BesTruthTrack.hh.

28{};

Member Function Documentation

◆ AddDaughterIndex()

void BesTruthTrack::AddDaughterIndex ( G4int  index)
inline

Definition at line 80 of file BesTruthTrack.hh.

80{m_daughterIndexes.push_back(index);}

Referenced by BesSensitiveManager::MakeNewTrack().

◆ Found()

void BesTruthTrack::Found ( )
inline

Definition at line 85 of file BesTruthTrack.hh.

85{m_found = true;}

Referenced by BesSensitiveManager::CheckDecayTrack(), and BesSensitiveManager::UpdatePrimaryTrack().

◆ GetBarcodeEndVtx()

G4int BesTruthTrack::GetBarcodeEndVtx ( )
inline

Definition at line 55 of file BesTruthTrack.hh.

55{return m_barcodeEndVtx;}

Referenced by BesSensitiveManager::SaveParticlesFromGenerator().

◆ GetDaughterIndexes()

vector< int > BesTruthTrack::GetDaughterIndexes ( ) const
inline

◆ GetG4TrackId()

G4int BesTruthTrack::GetG4TrackId ( ) const
inline

Definition at line 68 of file BesTruthTrack.hh.

68{return m_g4TrackId;}

Referenced by BesSensitiveManager::CheckDecayTrack().

◆ GetIndex()

◆ GetP4()

HepLorentzVector BesTruthTrack::GetP4 ( ) const
inline

◆ GetParentTrack()

BesTruthTrack * BesTruthTrack::GetParentTrack ( )
inline

Definition at line 73 of file BesTruthTrack.hh.

74 {
75 if (m_vertex == 0) return 0;
76 return m_vertex->GetParentTrack();
77 }
BesTruthTrack * GetParentTrack() const

◆ GetParticleName()

G4String BesTruthTrack::GetParticleName ( ) const
inline

Definition at line 48 of file BesTruthTrack.hh.

48{return m_particleName;}

Referenced by BesEmcSD::ProcessHits().

◆ GetPDGCharge()

G4double BesTruthTrack::GetPDGCharge ( ) const
inline

Definition at line 44 of file BesTruthTrack.hh.

44{return m_PDGCharge;}

Referenced by BesEmcSD::ProcessHits(), and BesAsciiIO::SaveTrackTruth().

◆ GetPDGCode()

G4int BesTruthTrack::GetPDGCode ( ) const
inline

◆ GetSource()

G4String BesTruthTrack::GetSource ( )
inline

Definition at line 88 of file BesTruthTrack.hh.

88{return m_source;}

Referenced by BesMcTruthWriter::SaveMcParticle().

◆ GetTerminalVertex()

◆ GetVertex()

◆ NotFound()

G4bool BesTruthTrack::NotFound ( )
inline

Definition at line 86 of file BesTruthTrack.hh.

86{return !m_found;}

Referenced by BesSensitiveManager::UpdatePrimaryTrack().

◆ SetBarcodeEndVtx()

void BesTruthTrack::SetBarcodeEndVtx ( G4int  vtx)
inline

Definition at line 56 of file BesTruthTrack.hh.

56{m_barcodeEndVtx = vtx;}

Referenced by BesSensitiveManager::SaveParticlesFromGenerator().

◆ SetG4TrackId()

void BesTruthTrack::SetG4TrackId ( G4int  trackId)
inline

◆ SetIndex()

void BesTruthTrack::SetIndex ( G4int  index)
inline

Definition at line 65 of file BesTruthTrack.hh.

65{m_index=index;}

Referenced by BesSensitiveManager::MakeNewTrack(), and BesSensitiveManager::SaveParticlesFromGenerator().

◆ SetP4()

void BesTruthTrack::SetP4 ( const HepLorentzVector &  p4)
inline

Definition at line 37 of file BesTruthTrack.hh.

37{ m_fourMomentum = p4; }

Referenced by BesSensitiveManager::MakeNewTrack(), and BesSensitiveManager::SaveParticlesFromGenerator().

◆ SetParticleName()

void BesTruthTrack::SetParticleName ( G4String  name)
inline

◆ SetPDGCharge()

void BesTruthTrack::SetPDGCharge ( G4double  charge)
inline

◆ SetPDGCode()

void BesTruthTrack::SetPDGCode ( G4int  code)
inline

Definition at line 41 of file BesTruthTrack.hh.

41{m_PDGCode=code;}

Referenced by BesSensitiveManager::MakeNewTrack(), and BesSensitiveManager::SaveParticlesFromGenerator().

◆ SetSource()

void BesTruthTrack::SetSource ( G4String  source)
inline

Definition at line 89 of file BesTruthTrack.hh.

89{m_source=source;}

Referenced by BesSensitiveManager::MakeNewTrack(), and BesSensitiveManager::SaveParticlesFromGenerator().

◆ SetTerminalVertex()

void BesTruthTrack::SetTerminalVertex ( BesTruthVertex vertex)
inline

Definition at line 61 of file BesTruthTrack.hh.

61{m_terminalVertex=vertex;}

Referenced by BesSensitiveManager::SaveParticlesFromGenerator().

◆ SetVertex()

void BesTruthTrack::SetVertex ( BesTruthVertex vertex)
inline

Definition at line 53 of file BesTruthTrack.hh.

53{m_vertex=vertex;}

Referenced by BesSensitiveManager::MakeNewTrack(), and BesSensitiveManager::SaveParticlesFromGenerator().

Friends And Related Function Documentation

◆ operator<< [1/2]

ostream & operator<< ( ostream &  stream,
const BesTruthTrack track 
)
friend

Definition at line 33 of file BesTruthTrack.cc.

34{
35 //track index
37 stream << " --";
38 else
39 stream << setw(4) << track.GetIndex() << " ";
40
41 //PDGcode
42 if(track.GetPDGCode())
43 stream << setw(4) << track.GetPDGCode()<<" ";
44 else
45 stream <<" --";
46
47 //particle name
48 if(track.GetParticleName())
49 stream << setw(10) << track.GetParticleName()<<" ";
50 else
51 stream <<" --";
52
53 //original vertex index
54 if(track.GetVertex())
55 stream << setw(4) << track.GetVertex()->GetIndex();
56 else
57 stream << " --";
58
59 //terminal vertex index
60 if(track.GetTerminalVertex())
61 stream << setw(4) << track.GetTerminalVertex()->GetIndex();
62 else
63 stream << " --";
64
65
66 //four momentum
67 stream << " " << setiosflags(ios::fixed)
68 <<setprecision(4) << setw(11) << track.GetP4().x()
69 <<setprecision(4) << setw(11) << track.GetP4().y()
70 <<setprecision(4) << setw(11) << track.GetP4().z()
71 <<setprecision(4) << setw(11) << track.GetP4().e();
72
73 //daughter indexes
74 if(track.GetDaughterIndexes().size()>0)
75 {
76 G4int nDaughter = track.GetDaughterIndexes().size();
77 for(G4int i=0;i<nDaughter;i++)
78 stream <<" "<<( track.GetDaughterIndexes() )[i]<<" ";
79 }
80 return stream;
81}
G4int GetPDGCode() const
HepLorentzVector GetP4() const
BesTruthVertex * GetTerminalVertex() const
BesTruthVertex * GetVertex() const
vector< int > GetDaughterIndexes() const
G4int GetIndex() const
G4String GetParticleName() const
G4int GetIndex() const

◆ operator<< [2/2]

ostream & operator<< ( ostream &  stream,
const BesTruthTrack track 
)
friend

Definition at line 83 of file BesTruthTrack.cc.

84{
85 stream << *track;
86 return stream;
87}

The documentation for this class was generated from the following files: