48 : parentParticle(0), pdgID(0),
49 trackID(0), parentTrackID(0),
51 vertex(0), storeFlag(false)
61 name(aname), pdgID(apcode),
62 trackID(atid), parentTrackID(ptid),
63 primaryFlag(false),momentumAtVertex(p),
64 vertex(0), storeFlag(false)
75 name(aname), pdgID(apcode),
76 trackID(atid), parentTrackID(ptid),
77 primaryFlag(false),momentumAtVertex(p),
110 int size= associatedParticleList.size();
111 if(i>=0 && i< size)
return associatedParticleList[i];
121 for(nlevel=1;;nlevel++) {
123 if(p==0)
return nlevel;
142 std::ostringstream os;
144 if(storeFlag) cqp=
'+';
145 os << cqp << trackID <<
'\0';
146 std::string stid(os.str());
147 ostr << std::setw(6) << stid;
150 if(primaryFlag) ostr <<
"*";
152 ostr <<
"<" << std::setw(5) << parentTrackID;
153 ostr.setf(std::ios::fixed);
155 << std::setw(7) << std::setprecision(3) << momentumAtVertex.x()/
GeV
156 <<
"," << std::setw(7) << std::setprecision(3)
157 << momentumAtVertex.y()/
GeV
158 <<
"," << std::setw(7) << std::setprecision(3)
159 << momentumAtVertex.z()/
GeV
160 <<
"," << std::setw(7) << std::setprecision(3)
161 << momentumAtVertex.e()/
GeV <<
") @";
162 ostr <<
name <<
"(" << pdgID <<
")";
165 ostr <<
" %" << vertex-> GetCreatorProcessName() <<
G4endl;
167 std::ostringstream osv;
169 if(vertex->GetStoreFlag()) cqv=
'+';
170 osv << cqv << vertex-> GetID() <<
'\0';
171 std::string svid(osv.str());
172 ostr <<
" " << std::setw(6) << svid;
174 ostr.unsetf(std::ios::fixed);
176 ostr <<
"- X(" << std::setw(9) << std::setprecision(2)
177 << vertex-> GetPosition().x()/
mm
178 <<
"," << std::setw(9) << std::setprecision(2)
179 << vertex-> GetPosition().y()/
mm
180 <<
"," << std::setw(9) << std::setprecision(2)
181 << vertex-> GetPosition().z()/
mm
182 <<
"," << std::setw(9) << std::setprecision(2)
183 << vertex-> GetTime()/
ns <<
")";
184 ostr.unsetf(std::ios::scientific);
186 ostr <<
" @" << vertex-> GetVolumeName()
187 <<
"-" << vertex-> GetVolumeNumber();
201 SimParticleList::const_iterator itr;
202 for(itr= associatedParticleList.begin();
203 itr!= associatedParticleList.end(); ++itr) {
204 (*itr)->
Print(ostr);
207 if(parentParticle) parentParticle->
Print(ostr,
true);
G4MCTSimParticle * GetAssociatedParticle(int i) const
static constexpr double mm
void SetStoreFlag(G4bool q)
void PrintSingle(std::ostream &ostr=std::cout) const
void SetStoreFlagToParentTree(G4bool q=true)
void Print(std::ostream &ostr=std::cout, G4bool qrevorder=false) const
const G4ThreeVector const G4double const
G4MCTSimParticle * parentParticle
void Print(const std::vector< T > &data)
void SetParentParticle(const G4MCTSimParticle *p)
int AssociateParticle(G4MCTSimParticle *p)
int GetNofAssociatedParticles() const
static constexpr double GeV
std::vector< G4MCTSimParticle * > associatedParticleList
G4MCTSimParticle * GetParentParticle() const
virtual ~G4MCTSimParticle()