BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesTruthTrack.cc File Reference
#include "TruSim/BesTruthTrack.hh"
#include <iomanip>

Go to the source code of this file.

Functions

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

Function Documentation

◆ operator<<() [1/2]

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

Definition at line 31 of file BesTruthTrack.cc.

31 {
32 // track index
33 if ( track.GetIndex() == BesTruthTrack::unassigned ) stream << " --";
34 else stream << setw( 4 ) << track.GetIndex() << " ";
35
36 // PDGcode
37 if ( track.GetPDGCode() ) stream << setw( 4 ) << track.GetPDGCode() << " ";
38 else stream << " --";
39
40 // particle name
41 if ( track.GetParticleName() ) stream << setw( 10 ) << track.GetParticleName() << " ";
42 else stream << " --";
43
44 // original vertex index
45 if ( track.GetVertex() ) stream << setw( 4 ) << track.GetVertex()->GetIndex();
46 else stream << " --";
47
48 // terminal vertex index
49 if ( track.GetTerminalVertex() )
50 stream << setw( 4 ) << track.GetTerminalVertex()->GetIndex();
51 else stream << " --";
52
53 // four momentum
54 stream << " " << setiosflags( ios::fixed ) << setprecision( 4 ) << setw( 11 )
55 << track.GetP4().x() << setprecision( 4 ) << setw( 11 ) << track.GetP4().y()
56 << setprecision( 4 ) << setw( 11 ) << track.GetP4().z() << setprecision( 4 )
57 << setw( 11 ) << track.GetP4().e();
58
59 // daughter indexes
60 if ( track.GetDaughterIndexes().size() > 0 )
61 {
62 G4int nDaughter = track.GetDaughterIndexes().size();
63 for ( G4int i = 0; i < nDaughter; i++ )
64 stream << " " << ( track.GetDaughterIndexes() )[i] << " ";
65 }
66 return stream;
67}

◆ operator<<() [2/2]

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

Definition at line 69 of file BesTruthTrack.cc.

69 {
70 stream << *track;
71 return stream;
72}