35 const G4ThreeVector& g4pos = aTrack.GetPosition();
36 const double gTime = aTrack.GetGlobalTime();
39 const G4ThreeVector& g4mom = aTrack.GetMomentum();
42 const G4ParticleDefinition &particleDefinition = *aTrack.GetDefinition();
43 double mass = particleDefinition.GetPDGMass();
44 double charge = particleDefinition.GetPDGCharge();
45 int pdgID = particleDefinition.GetPDGEncoding();
83 if ( aTrack.GetUserInformation() ) {
85 description << G4String(
"ISFG4Helper::attachTrackInfoToNewG4Track: ")
86 <<
"Trying to attach new TrackInformation object to G4Track which already has a TrackUserInformation attached (trackID: "
87 << aTrack.GetTrackID() <<
", track pos: "<<aTrack.GetPosition() <<
", mom: "<<aTrack.GetMomentum()
88 <<
", parentID " << aTrack.GetParentID() <<
")";
89 G4Exception(
"ISFG4Helper::attachTrackInfoToNewG4Track",
"TrackUserInformationAlreadyExists", FatalException,
description);
94 if ( !truthBinding ) {
96 description << G4String(
"ISFG4Helper::attachTrackInfoToNewG4Track: ")
97 <<
"No TruthBinding present in base ISFParticle (trackID: "
98 << aTrack.GetTrackID() <<
", track pos: "<<aTrack.GetPosition() <<
", mom: "<<aTrack.GetMomentum()
99 <<
", parentID " << aTrack.GetParentID() <<
", ISFParticle: "<<baseIsp<<
")";
100 G4Exception(
"ISFG4Helper::attachTrackInfoToNewG4Track",
"NoISFTruthBinding", FatalException,
description);
105 trackInfo->SetPrimaryGenParticle( truthBinding->getPrimaryGenParticle() );
106 trackInfo->SetClassification( classification );
The generic ISF particle definition,.
const TruthBinding * getTruthBinding() const
pointer to the simulation truth - optional, can be 0
static TrackInformation * attachTrackInfoToNewG4Track(G4Track &aTrack, ISF::ISFParticle &baseIsp, VTrackInformation::TrackClassification classification, HepMC::GenParticlePtr generationZeroGenParticle=nullptr)
attach a new TrackInformation object to the given new (!) G4Track (the G4Track must not have a UserIn...