Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-31 22:26:11

0001 #include "SimG4Core/KillSecondaries/interface/KillSecondariesStackingAction.h"
0002 #include "SimG4Core/Notification/interface/CurrentG4Track.h"
0003 #include "SimG4Core/Notification/interface/NewTrackAction.h"
0004 
0005 #include "G4Track.hh"
0006 
0007 G4ClassificationOfNewTrack KillSecondariesStackingAction::ClassifyNewTrack(const G4Track *aTrack) {
0008   NewTrackAction newTA;
0009   auto track = const_cast<G4Track *>(aTrack);
0010   if (aTrack->GetCreatorProcess() == nullptr || aTrack->GetParentID() == 0) {
0011     newTA.primary(track);
0012     return fUrgent;
0013   } else {
0014     const G4Track *mother = CurrentG4Track::track();
0015     newTA.secondary(track, *mother, 0);
0016     return fKill;
0017   }
0018 }