82{
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);
90 return nullptr;
91 }
92
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);
101 return nullptr;
102 }
103
104 TrackInformation *trackInfo = new TrackInformation( generationZeroGenParticle, &baseIsp );
107 aTrack.SetUserInformation( trackInfo );
108
109 return trackInfo;
110}
const TruthBinding * getTruthBinding() const
pointer to the simulation truth - optional, can be 0
std::string description
glabal timer - how long have I taken so far?