BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
BesTruthTrack.cc
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.cc
12
13#include "BesTruthTrack.hh"
14#include <iomanip>
15using namespace std;
16
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}
32
33ostream &operator<<(ostream &stream, const BesTruthTrack &track)
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}
82
83ostream &operator<<(ostream &stream, const BesTruthTrack *track)
84{
85 stream << *track;
86 return stream;
87}
88
89
90
91
ostream & operator<<(ostream &stream, const BesTruthTrack &track)
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