Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:25

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