BesTruthTrack Class Reference

#include <BesTruthTrack.hh>

List of all members.

Public Types

 unassigned = -1
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)

Private Attributes

HepLorentzVector m_fourMomentum
BesTruthVertexm_vertex
BesTruthVertexm_terminalVertex
G4int m_barcodeEndVtx
G4int m_PDGCode
G4double m_PDGCharge
G4String m_particleName
G4int m_index
G4int m_g4TrackId
vector< int > m_daughterIndexes
G4bool m_found
G4String m_source

Friends

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


Detailed Description

Definition at line 24 of file BesTruthTrack.hh.


Member Enumeration Documentation

anonymous enum

Enumerator:
unassigned 

Definition at line 33 of file BesTruthTrack.hh.

00033 { unassigned = -1 };


Constructor & Destructor Documentation

BesTruthTrack::BesTruthTrack (  ) 

Definition at line 17 of file BesTruthTrack.cc.

References m_found, m_g4TrackId, m_index, m_particleName, m_PDGCharge, m_PDGCode, m_source, m_terminalVertex, m_vertex, and unassigned.

00018 :m_fourMomentum(0),m_daughterIndexes(0)
00019 {
00020   //m_fourMomentum;
00021   m_vertex=0;
00022   m_terminalVertex=0;
00023   m_PDGCode=0;
00024   m_PDGCharge=-99;
00025   m_particleName="";
00026   m_index=unassigned;
00027   m_g4TrackId=-99;
00028   //m_daughterIndexes=0;
00029   m_found=false;
00030   m_source="";
00031 }

BesTruthTrack::~BesTruthTrack (  )  [inline]

Definition at line 28 of file BesTruthTrack.hh.

00028 {};


Member Function Documentation

void BesTruthTrack::AddDaughterIndex ( G4int  index  )  [inline]

Definition at line 80 of file BesTruthTrack.hh.

References m_daughterIndexes.

Referenced by BesSensitiveManager::MakeNewTrack().

00080 {m_daughterIndexes.push_back(index);}

void BesTruthTrack::Found (  )  [inline]

Definition at line 85 of file BesTruthTrack.hh.

References m_found.

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

00085 {m_found = true;}

G4int BesTruthTrack::GetBarcodeEndVtx (  )  [inline]

Definition at line 55 of file BesTruthTrack.hh.

References m_barcodeEndVtx.

Referenced by BesSensitiveManager::SaveParticlesFromGenerator().

00055 {return m_barcodeEndVtx;}

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

Definition at line 83 of file BesTruthTrack.hh.

References m_daughterIndexes.

Referenced by BesSensitiveManager::GetDaughterVertexes(), operator<<(), BesMcTruthWriter::SaveMcParticle(), BesAsciiIO::SaveTrackTruth(), and BesSensitiveManager::UpdatePrimaryTrack().

00083 {return m_daughterIndexes;}

G4int BesTruthTrack::GetG4TrackId (  )  const [inline]

Definition at line 68 of file BesTruthTrack.hh.

References m_g4TrackId.

Referenced by BesSensitiveManager::CheckDecayTrack().

00068 {return m_g4TrackId;}

G4int BesTruthTrack::GetIndex (  )  const [inline]

Definition at line 64 of file BesTruthTrack.hh.

References m_index.

Referenced by BesSensitiveManager::CheckDecayTrack(), BesSensitiveManager::MakeNewTrack(), operator<<(), BesMcTruthWriter::SaveMcParticle(), BesSensitiveManager::SaveParticlesFromGenerator(), BesAsciiIO::SaveTrackTruth(), BesAsciiIO::SaveVertexTruth(), and BesSensitiveManager::UpdatePrimaryTrack().

00064 {return m_index;}

HepLorentzVector BesTruthTrack::GetP4 (  )  const [inline]

Definition at line 36 of file BesTruthTrack.hh.

References m_fourMomentum.

Referenced by BesSensitiveManager::CheckDecayTrack(), operator<<(), BesMcTruthWriter::SaveMcParticle(), BesAsciiIO::SaveTrackTruth(), and BesSensitiveManager::UpdatePrimaryTrack().

00036 { return m_fourMomentum; }

BesTruthTrack* BesTruthTrack::GetParentTrack (  )  [inline]

Definition at line 73 of file BesTruthTrack.hh.

References BesTruthVertex::GetParentTrack(), and m_vertex.

00074     {
00075       if (m_vertex == 0) return 0; 
00076       return m_vertex->GetParentTrack();
00077     }

G4String BesTruthTrack::GetParticleName (  )  const [inline]

Definition at line 48 of file BesTruthTrack.hh.

References m_particleName.

Referenced by operator<<().

00048 {return m_particleName;}

G4double BesTruthTrack::GetPDGCharge (  )  const [inline]

Definition at line 44 of file BesTruthTrack.hh.

References m_PDGCharge.

Referenced by BesAsciiIO::SaveTrackTruth().

00044 {return m_PDGCharge;}

G4int BesTruthTrack::GetPDGCode (  )  const [inline]

Definition at line 40 of file BesTruthTrack.hh.

References m_PDGCode.

Referenced by BesSensitiveManager::CheckDecayTrack(), operator<<(), BesMcTruthWriter::SaveMcParticle(), BesAsciiIO::SaveTrackTruth(), and BesSensitiveManager::UpdatePrimaryTrack().

00040 {return m_PDGCode;}

G4String BesTruthTrack::GetSource (  )  [inline]

Definition at line 88 of file BesTruthTrack.hh.

References m_source.

Referenced by BesMcTruthWriter::SaveMcParticle().

00088 {return m_source;}

BesTruthVertex* BesTruthTrack::GetTerminalVertex (  )  const [inline]

Definition at line 60 of file BesTruthTrack.hh.

References m_terminalVertex.

Referenced by BesSensitiveManager::CheckDecayTrack(), BesSensitiveManager::EndOfTrack(), operator<<(), BesMcTruthWriter::SaveMcParticle(), BesAsciiIO::SaveTrackTruth(), and BesSensitiveManager::UpdateVertex().

00060 {return m_terminalVertex;}

BesTruthVertex* BesTruthTrack::GetVertex (  )  const [inline]

Definition at line 52 of file BesTruthTrack.hh.

References m_vertex.

Referenced by BesSensitiveManager::CheckDecayTrack(), BesSensitiveManager::MakeNewTrack(), operator<<(), BesMcTruthWriter::SaveMcParticle(), and BesAsciiIO::SaveTrackTruth().

00052 {return m_vertex;}

G4bool BesTruthTrack::NotFound (  )  [inline]

Definition at line 86 of file BesTruthTrack.hh.

References m_found.

Referenced by BesSensitiveManager::UpdatePrimaryTrack().

00086 {return !m_found;} 

void BesTruthTrack::SetBarcodeEndVtx ( G4int  vtx  )  [inline]

Definition at line 56 of file BesTruthTrack.hh.

References m_barcodeEndVtx.

Referenced by BesSensitiveManager::SaveParticlesFromGenerator().

00056 {m_barcodeEndVtx = vtx;}

void BesTruthTrack::SetG4TrackId ( G4int  trackId  )  [inline]

Definition at line 69 of file BesTruthTrack.hh.

References m_g4TrackId.

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

00069 {m_g4TrackId = trackId;}

void BesTruthTrack::SetIndex ( G4int  index  )  [inline]

Definition at line 65 of file BesTruthTrack.hh.

References m_index.

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

00065 {m_index=index;}

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

Definition at line 37 of file BesTruthTrack.hh.

References m_fourMomentum.

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

00037 { m_fourMomentum = p4; }

void BesTruthTrack::SetParticleName ( G4String  name  )  [inline]

Definition at line 49 of file BesTruthTrack.hh.

References m_particleName.

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

00049 {m_particleName=name;}

void BesTruthTrack::SetPDGCharge ( G4double  charge  )  [inline]

Definition at line 45 of file BesTruthTrack.hh.

References m_PDGCharge.

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

00045 {m_PDGCharge = charge;}

void BesTruthTrack::SetPDGCode ( G4int  code  )  [inline]

Definition at line 41 of file BesTruthTrack.hh.

References m_PDGCode.

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

00041 {m_PDGCode=code;}

void BesTruthTrack::SetSource ( G4String  source  )  [inline]

Definition at line 89 of file BesTruthTrack.hh.

References m_source.

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

00089 {m_source=source;}

void BesTruthTrack::SetTerminalVertex ( BesTruthVertex vertex  )  [inline]

Definition at line 61 of file BesTruthTrack.hh.

References m_terminalVertex.

Referenced by BesSensitiveManager::SaveParticlesFromGenerator().

00061 {m_terminalVertex=vertex;}

void BesTruthTrack::SetVertex ( BesTruthVertex vertex  )  [inline]

Definition at line 53 of file BesTruthTrack.hh.

References m_vertex.

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

00053 {m_vertex=vertex;}


Friends And Related Function Documentation

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

Definition at line 83 of file BesTruthTrack.cc.

00084 {
00085   stream << *track;
00086   return stream;
00087 }

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

Definition at line 33 of file BesTruthTrack.cc.

00034 {
00035   //track index
00036   if(track.GetIndex() == BesTruthTrack::unassigned)
00037     stream << "  --";
00038   else
00039     stream << setw(4) << track.GetIndex() << " ";
00040   
00041   //PDGcode
00042   if(track.GetPDGCode())
00043     stream << setw(4) << track.GetPDGCode()<<" ";
00044   else
00045     stream <<"  --";
00046   
00047   //particle name
00048   if(track.GetParticleName())
00049     stream << setw(10) << track.GetParticleName()<<" ";
00050   else
00051     stream <<"      --";
00052   
00053   //original vertex index
00054   if(track.GetVertex())
00055     stream << setw(4) << track.GetVertex()->GetIndex();
00056   else
00057     stream << "  --";
00058 
00059   //terminal vertex index
00060   if(track.GetTerminalVertex())
00061     stream << setw(4) << track.GetTerminalVertex()->GetIndex();
00062   else
00063     stream << "  --";
00064 
00065   
00066   //four momentum
00067   stream << " " << setiosflags(ios::fixed)
00068          <<setprecision(4) << setw(11) << track.GetP4().x()
00069          <<setprecision(4) << setw(11) << track.GetP4().y()
00070          <<setprecision(4) << setw(11) << track.GetP4().z()
00071          <<setprecision(4) << setw(11) << track.GetP4().e();
00072   
00073   //daughter indexes
00074   if(track.GetDaughterIndexes().size()>0)
00075   {
00076     G4int nDaughter = track.GetDaughterIndexes().size();
00077     for(G4int i=0;i<nDaughter;i++)
00078      stream <<"  "<<( track.GetDaughterIndexes() )[i]<<"  ";
00079   }
00080   return stream;
00081 }


Member Data Documentation

G4int BesTruthTrack::m_barcodeEndVtx [private]

Definition at line 103 of file BesTruthTrack.hh.

Referenced by GetBarcodeEndVtx(), and SetBarcodeEndVtx().

vector<int> BesTruthTrack::m_daughterIndexes [private]

Definition at line 121 of file BesTruthTrack.hh.

Referenced by AddDaughterIndex(), and GetDaughterIndexes().

G4bool BesTruthTrack::m_found [private]

Definition at line 123 of file BesTruthTrack.hh.

Referenced by BesTruthTrack(), Found(), and NotFound().

HepLorentzVector BesTruthTrack::m_fourMomentum [private]

Definition at line 95 of file BesTruthTrack.hh.

Referenced by GetP4(), and SetP4().

G4int BesTruthTrack::m_g4TrackId [private]

Definition at line 118 of file BesTruthTrack.hh.

Referenced by BesTruthTrack(), GetG4TrackId(), and SetG4TrackId().

G4int BesTruthTrack::m_index [private]

Definition at line 115 of file BesTruthTrack.hh.

Referenced by BesTruthTrack(), GetIndex(), and SetIndex().

G4String BesTruthTrack::m_particleName [private]

Definition at line 112 of file BesTruthTrack.hh.

Referenced by BesTruthTrack(), GetParticleName(), and SetParticleName().

G4double BesTruthTrack::m_PDGCharge [private]

Definition at line 109 of file BesTruthTrack.hh.

Referenced by BesTruthTrack(), GetPDGCharge(), and SetPDGCharge().

G4int BesTruthTrack::m_PDGCode [private]

Definition at line 106 of file BesTruthTrack.hh.

Referenced by BesTruthTrack(), GetPDGCode(), and SetPDGCode().

G4String BesTruthTrack::m_source [private]

Definition at line 124 of file BesTruthTrack.hh.

Referenced by BesTruthTrack(), GetSource(), and SetSource().

BesTruthVertex* BesTruthTrack::m_terminalVertex [private]

Definition at line 101 of file BesTruthTrack.hh.

Referenced by BesTruthTrack(), GetTerminalVertex(), and SetTerminalVertex().

BesTruthVertex* BesTruthTrack::m_vertex [private]

Definition at line 98 of file BesTruthTrack.hh.

Referenced by BesTruthTrack(), GetParentTrack(), GetVertex(), and SetVertex().


Generated on Tue Nov 29 23:17:37 2016 for BOSS_7.0.2 by  doxygen 1.4.7