31 const G4Track* track,
const G4ClassificationOfNewTrack& currentTrackClass) {
33 G4int pdgID = track->GetParticleDefinition()->GetPDGEncoding();
36 G4String particleName = track->GetParticleDefinition()->GetParticleName();
40 G4ClassificationOfNewTrack classification = currentTrackClass;
42 if (track->GetTrackID() == 1 && pdgID == 11) {
46 return classification;
51 auto track{step->GetTrack()};
54 if (track->GetParentID() != 0)
return;
58 if (
auto pdgID{track->GetParticleDefinition()->GetPDGEncoding()}; pdgID != 11)
64 track->GetVolume()->GetLogicalVolume()->GetRegion()->GetName()};
65 region.compareTo(
"target") != 0)
87 if (
auto volume{track->GetNextVolume()->GetName()};
88 volume.compareTo(
"recoil_PV") == 0 or volume.compareTo(
"World_PV") == 0) {
91 track->SetTrackStatus(fKillTrackAndSecondaries);
92 G4RunManager::GetRunManager()->AbortEvent();
97 bool hasBremCandidate =
false;
98 if (
auto secondaries = step->GetSecondary(); secondaries->size() == 0) {
99 track->SetTrackStatus(fKillTrackAndSecondaries);
100 G4RunManager::GetRunManager()->AbortEvent();
103 for (
auto& secondary_track : *secondaries) {
104 G4String processName =
105 secondary_track->GetCreatorProcess()->GetProcessName();
107 if (processName.compareTo(
"eBrem") == 0 &&
114 hasBremCandidate =
true;
119 if (!hasBremCandidate) {
120 track->SetTrackStatus(fKillTrackAndSecondaries);
121 G4RunManager::GetRunManager()->AbortEvent();
132 track->SetTrackStatus(fStopAndKill);
134 track->SetTrackStatus(fSuspend);
136 }
else if (step->GetPostStepPoint()->GetKineticEnergy() == 0) {
137 track->SetTrackStatus(fKillTrackAndSecondaries);
138 G4RunManager::GetRunManager()->AbortEvent();