32 const G4ThreeVector& g4pos = aTrack.GetPosition();
33 const double gTime = aTrack.GetGlobalTime();
36 const G4ThreeVector& g4mom = aTrack.GetMomentum();
39 const G4ParticleDefinition &particleDefinition = *aTrack.GetDefinition();
40 double mass = particleDefinition.GetPDGMass();
41 double charge = particleDefinition.GetPDGCharge();
42 int pdgID = particleDefinition.GetPDGEncoding();
80 if ( aTrack.GetUserInformation() ) {
82 description << G4String(
"ISFG4Helper::attachTrackInfoToNewG4Track: ")
83 <<
"Trying to attach new TrackInformation object to G4Track which already has a TrackUserInformation attached (trackID: "
84 << aTrack.GetTrackID() <<
", track pos: "<<aTrack.GetPosition() <<
", mom: "<<aTrack.GetMomentum()
85 <<
", parentID " << aTrack.GetParentID() <<
")";
86 G4Exception(
"ISFG4Helper::attachTrackInfoToNewG4Track",
"TrackUserInformationAlreadyExists", FatalException,
description);
91 if ( !truthBinding ) {
93 description << G4String(
"ISFG4Helper::attachTrackInfoToNewG4Track: ")
94 <<
"No TruthBinding present in base ISFParticle (trackID: "
95 << aTrack.GetTrackID() <<
", track pos: "<<aTrack.GetPosition() <<
", mom: "<<aTrack.GetMomentum()
96 <<
", parentID " << aTrack.GetParentID() <<
", ISFParticle: "<<baseIsp<<
")";
97 G4Exception(
"ISFG4Helper::attachTrackInfoToNewG4Track",
"NoISFTruthBinding", FatalException,
description);
102 trackInfo->SetPrimaryGenParticle( truthBinding->getPrimaryGenParticle() );
103 trackInfo->SetGenerationZeroGenParticle( generationZeroGenParticle );
105 trackInfo->SetCurrentGenParticle( truthBinding->getCurrentGenParticle() );
107 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...