#include <G4MCTSimParticle.hh>
Definition at line 48 of file G4MCTSimParticle.hh.
G4MCTSimParticle::G4MCTSimParticle | ( | ) |
Definition at line 47 of file G4MCTSimParticle.cc.
00048 : parentParticle(0), pdgID(0), 00049 trackID(0), parentTrackID(0), 00050 primaryFlag(false), 00051 vertex(0), storeFlag(false) 00053 { 00054 }
G4MCTSimParticle::G4MCTSimParticle | ( | std::string | aname, | |
int | apcode, | |||
int | atid, | |||
int | ptid, | |||
const G4LorentzVector & | p | |||
) |
Definition at line 57 of file G4MCTSimParticle.cc.
00060 : parentParticle(0), 00061 name(aname), pdgID(apcode), 00062 trackID(atid), parentTrackID(ptid), 00063 primaryFlag(false),momentumAtVertex(p), 00064 vertex(0), storeFlag(false) 00066 { 00067 }
G4MCTSimParticle::G4MCTSimParticle | ( | std::string | aname, | |
int | apcode, | |||
int | atid, | |||
int | ptid, | |||
const G4LorentzVector & | p, | |||
const G4MCTSimVertex * | v | |||
) |
Definition at line 70 of file G4MCTSimParticle.cc.
00074 : parentParticle(0), 00075 name(aname), pdgID(apcode), 00076 trackID(atid), parentTrackID(ptid), 00077 primaryFlag(false),momentumAtVertex(p), 00078 vertex(const_cast<G4MCTSimVertex*>(v)), storeFlag(false) 00080 { 00081 }
G4MCTSimParticle::~G4MCTSimParticle | ( | ) | [virtual] |
Definition at line 84 of file G4MCTSimParticle.cc.
References associatedParticleList.
00086 { 00087 associatedParticleList.clear(); 00088 }
G4MCTSimParticle::G4MCTSimParticle | ( | const G4MCTSimParticle & | right | ) | [inline] |
int G4MCTSimParticle::AssociateParticle | ( | G4MCTSimParticle * | p | ) |
Definition at line 91 of file G4MCTSimParticle.cc.
References associatedParticleList, and SetParentParticle().
00093 { 00094 associatedParticleList.push_back(p); 00095 p-> SetParentParticle(this); 00096 return associatedParticleList.size(); 00097 }
G4MCTSimParticle * G4MCTSimParticle::GetAssociatedParticle | ( | int | i | ) | const |
Definition at line 107 of file G4MCTSimParticle.cc.
00109 { 00110 int size= associatedParticleList.size(); 00111 if(i>=0 && i< size) return associatedParticleList[i]; 00112 else return 0; 00113 }
const G4LorentzVector & G4MCTSimParticle::GetMomentumAtVertex | ( | ) | const [inline] |
Definition at line 171 of file G4MCTSimParticle.hh.
References momentumAtVertex.
00172 { return momentumAtVertex; }
int G4MCTSimParticle::GetNofAssociatedParticles | ( | ) | const |
Definition at line 100 of file G4MCTSimParticle.cc.
References associatedParticleList.
00102 { 00103 return associatedParticleList.size(); 00104 }
G4MCTSimParticle * G4MCTSimParticle::GetParentParticle | ( | ) | const [inline] |
Definition at line 141 of file G4MCTSimParticle.hh.
References parentParticle.
Referenced by GetTreeLevel().
00142 { return parentParticle; }
int G4MCTSimParticle::GetParentTrackID | ( | ) | const [inline] |
Definition at line 165 of file G4MCTSimParticle.hh.
References parentTrackID.
00166 { return parentTrackID; }
const std::string & G4MCTSimParticle::GetParticleName | ( | ) | const [inline] |
int G4MCTSimParticle::GetPdgID | ( | ) | const [inline] |
G4bool G4MCTSimParticle::GetPrimaryFlag | ( | ) | const [inline] |
Definition at line 160 of file G4MCTSimParticle.hh.
References primaryFlag.
00160 { return primaryFlag; }
G4bool G4MCTSimParticle::GetStoreFlag | ( | ) | const [inline] |
Definition at line 182 of file G4MCTSimParticle.hh.
References storeFlag.
00182 { return storeFlag; }
int G4MCTSimParticle::GetTrackID | ( | ) | const [inline] |
Definition at line 156 of file G4MCTSimParticle.hh.
References trackID.
Referenced by G4MCTSimVertex::AddOutParticle().
00156 { return trackID; }
int G4MCTSimParticle::GetTreeLevel | ( | ) | const |
Definition at line 116 of file G4MCTSimParticle.cc.
References GetParentParticle().
00118 { 00119 const G4MCTSimParticle* p= this; 00120 int nlevel; 00121 for(nlevel=1;;nlevel++) { 00122 p= p-> GetParentParticle(); 00123 if(p==0) return nlevel; 00124 } 00125 }
G4MCTSimVertex * G4MCTSimParticle::GetVertex | ( | ) | const [inline] |
const G4MCTSimParticle & G4MCTSimParticle::operator= | ( | const G4MCTSimParticle & | right | ) | [inline] |
Definition at line 122 of file G4MCTSimParticle.hh.
References associatedParticleList, momentumAtVertex, name, parentParticle, parentTrackID, pdgID, primaryFlag, trackID, and vertex.
00123 { 00124 parentParticle= right.parentParticle; 00125 associatedParticleList= right.associatedParticleList; // shallow copy 00126 00127 name= right.name; 00128 pdgID= right.pdgID; 00129 trackID= right.trackID; 00130 parentTrackID= right.parentTrackID; 00131 primaryFlag= right.primaryFlag; 00132 momentumAtVertex= right.momentumAtVertex; 00133 vertex= right.vertex; 00134 00135 return *this; 00136 }
void G4MCTSimParticle::Print | ( | std::ostream & | ostr = std::cout , |
|
G4bool | qrevorder = false | |||
) | const |
Definition at line 194 of file G4MCTSimParticle.cc.
00196 { 00197 PrintSingle(ostr); 00198 00199 // recursively print associated particles 00200 if (!qrevorder) { // parent -> child 00201 SimParticleList::const_iterator itr; 00202 for(itr= associatedParticleList.begin(); 00203 itr!= associatedParticleList.end(); ++itr) { 00204 (*itr)-> Print(ostr); 00205 } 00206 } else { // child -> parent 00207 if(parentParticle) parentParticle-> Print(ostr, true); 00208 } 00209 }
void G4MCTSimParticle::PrintSingle | ( | std::ostream & | ostr = std::cout |
) | const |
Definition at line 139 of file G4MCTSimParticle.cc.
00141 { 00142 std::ostringstream os; 00143 char cqp=' '; 00144 if(storeFlag) cqp='+'; 00145 os << cqp << trackID << '\0'; 00146 std::string stid(os.str()); 00147 ostr << std::setw(6) << stid; 00148 //ostr << std::setw(4) << trackID; 00149 00150 if(primaryFlag) ostr << "*"; 00151 else ostr << " "; 00152 ostr << "<" << std::setw(5) << parentTrackID; 00153 ostr.setf(std::ios::fixed); 00154 ostr << ": P(" 00155 << std::setw(7) << std::setprecision(3) << momentumAtVertex.x()/GeV 00156 << "," << std::setw(7) << std::setprecision(3) 00157 << momentumAtVertex.y()/GeV 00158 << "," << std::setw(7) << std::setprecision(3) 00159 << momentumAtVertex.z()/GeV 00160 << "," << std::setw(7) << std::setprecision(3) 00161 << momentumAtVertex.e()/GeV << ") @"; 00162 ostr << name << "(" << pdgID << ")"; 00163 00164 if(vertex) { 00165 ostr << " %" << vertex-> GetCreatorProcessName() << G4endl; 00166 00167 std::ostringstream osv; 00168 char cqv=' '; 00169 if(vertex->GetStoreFlag()) cqv='+'; 00170 osv << cqv << vertex-> GetID() << '\0'; 00171 std::string svid(osv.str()); 00172 ostr << " " << std::setw(6) << svid; 00173 //ostr << " " << std::setw(4) << vertex-> GetID(); 00174 ostr.unsetf(std::ios::fixed); 00175 ostr.setf(std::ios::scientific|std::ios::right|std::ios::showpoint); 00176 ostr << "- X(" << std::setw(9) << std::setprecision(2) 00177 << vertex-> GetPosition().x()/mm 00178 << "," << std::setw(9) << std::setprecision(2) 00179 << vertex-> GetPosition().y()/mm 00180 << "," << std::setw(9) << std::setprecision(2) 00181 << vertex-> GetPosition().z()/mm 00182 << "," << std::setw(9) << std::setprecision(2) 00183 << vertex-> GetTime()/ns << ")"; 00184 ostr.unsetf(std::ios::scientific); 00185 00186 ostr << " @" << vertex-> GetVolumeName() 00187 << "-" << vertex-> GetVolumeNumber(); 00188 } 00189 ostr << G4endl; 00190 00191 }
void G4MCTSimParticle::SetMomentumAtVertex | ( | const G4LorentzVector & | p | ) | [inline] |
Definition at line 168 of file G4MCTSimParticle.hh.
References momentumAtVertex.
00169 { momentumAtVertex= p; }
void G4MCTSimParticle::SetParentParticle | ( | const G4MCTSimParticle * | p | ) | [inline] |
Definition at line 138 of file G4MCTSimParticle.hh.
References parentParticle.
Referenced by AssociateParticle().
00139 { parentParticle= const_cast<G4MCTSimParticle*>(p); }
void G4MCTSimParticle::SetParentTrackID | ( | int | id | ) | [inline] |
Definition at line 162 of file G4MCTSimParticle.hh.
References parentTrackID.
00163 { parentTrackID= id; }
void G4MCTSimParticle::SetParticleName | ( | std::string | aname | ) | [inline] |
void G4MCTSimParticle::SetPdgID | ( | int | id | ) | [inline] |
void G4MCTSimParticle::SetPrimaryFlag | ( | G4bool | q | ) | [inline] |
Definition at line 158 of file G4MCTSimParticle.hh.
References primaryFlag.
00158 { primaryFlag= q; }
void G4MCTSimParticle::SetStoreFlag | ( | G4bool | q | ) | [inline] |
Definition at line 180 of file G4MCTSimParticle.hh.
References storeFlag.
Referenced by SetStoreFlagToParentTree().
00180 { storeFlag= q; }
void G4MCTSimParticle::SetStoreFlagToParentTree | ( | G4bool | q = true |
) |
Definition at line 128 of file G4MCTSimParticle.cc.
References parentParticle, primaryFlag, SetStoreFlag(), storeFlag, and vertex.
00130 { 00131 storeFlag=q; 00132 if(vertex) vertex-> SetStoreFlag(q); 00133 if(primaryFlag) return; 00134 if(parentParticle) parentParticle-> SetStoreFlagToParentTree(q); 00135 }
void G4MCTSimParticle::SetTrackID | ( | int | id | ) | [inline] |
void G4MCTSimParticle::SetVertex | ( | const G4MCTSimVertex * | v | ) | [inline] |
Definition at line 174 of file G4MCTSimParticle.hh.
References vertex.
00175 { vertex= const_cast<G4MCTSimVertex*>(v); }
std::vector<G4MCTSimParticle*> G4MCTSimParticle::associatedParticleList [protected] |
Definition at line 51 of file G4MCTSimParticle.hh.
Referenced by AssociateParticle(), GetNofAssociatedParticles(), operator=(), and ~G4MCTSimParticle().
G4LorentzVector G4MCTSimParticle::momentumAtVertex [protected] |
Definition at line 58 of file G4MCTSimParticle.hh.
Referenced by GetMomentumAtVertex(), operator=(), and SetMomentumAtVertex().
std::string G4MCTSimParticle::name [protected] |
Definition at line 53 of file G4MCTSimParticle.hh.
Referenced by GetParticleName(), operator=(), and SetParticleName().
G4MCTSimParticle* G4MCTSimParticle::parentParticle [protected] |
Definition at line 50 of file G4MCTSimParticle.hh.
Referenced by GetParentParticle(), operator=(), SetParentParticle(), and SetStoreFlagToParentTree().
int G4MCTSimParticle::parentTrackID [protected] |
Definition at line 56 of file G4MCTSimParticle.hh.
Referenced by GetParentTrackID(), operator=(), and SetParentTrackID().
int G4MCTSimParticle::pdgID [protected] |
Definition at line 54 of file G4MCTSimParticle.hh.
Referenced by GetPdgID(), operator=(), and SetPdgID().
G4bool G4MCTSimParticle::primaryFlag [protected] |
Definition at line 57 of file G4MCTSimParticle.hh.
Referenced by GetPrimaryFlag(), operator=(), SetPrimaryFlag(), and SetStoreFlagToParentTree().
G4bool G4MCTSimParticle::storeFlag [protected] |
Definition at line 60 of file G4MCTSimParticle.hh.
Referenced by GetStoreFlag(), SetStoreFlag(), and SetStoreFlagToParentTree().
int G4MCTSimParticle::trackID [protected] |
Definition at line 55 of file G4MCTSimParticle.hh.
Referenced by GetTrackID(), operator=(), and SetTrackID().
G4MCTSimVertex* G4MCTSimParticle::vertex [protected] |
Definition at line 59 of file G4MCTSimParticle.hh.
Referenced by GetVertex(), operator=(), SetStoreFlagToParentTree(), and SetVertex().