79{
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);
87 return nullptr;
88 }
89
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);
98 return nullptr;
99 }
100
101 TrackInformation *trackInfo = new TrackInformation( nullptr, &baseIsp );
106 }
108 aTrack.SetUserInformation( trackInfo );
109
110 return trackInfo;
111}
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?