Skip to content

Commit 88137b9

Browse files
authored
Merge pull request #60 from rest-for-physics/lobis-track-creator-process
Added creator process to TRestGeant4Track
2 parents f23dcf7 + 83d4a6c commit 88137b9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/TrackingAction.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ void TrackingAction::PreUserTrackingAction(const G4Track* track) {
6464
restTrack->SetParticleName(name);
6565
restTrack->SetGlobalTrackTime(track->GetGlobalTime() / second);
6666

67+
TString creatorProcessName = "PrimaryGenerator";
68+
if (track->GetCreatorProcess() != nullptr) {
69+
creatorProcessName = track->GetCreatorProcess()->GetProcessName();
70+
}
71+
restTrack->SetCreatorProcess(creatorProcessName);
72+
6773
G4ThreeVector trkOrigin = track->GetPosition();
6874
restTrack->SetTrackOrigin(trkOrigin.x(), trkOrigin.y(), trkOrigin.z());
6975

0 commit comments

Comments
 (0)