49 auto track{step->GetTrack()};
51 if (G4EventManager::GetEventManager()->GetConstCurrentEvent()->IsAborted())
56 if ((trackInfo !=
nullptr) && !trackInfo->isBremCandidate())
return;
59 auto secondaries{step->GetSecondary()};
64 track->GetVolume()->GetLogicalVolume()->GetRegion()->GetName()};
65 region.compareTo(
"target") != 0) {
69 if (secondaries->size() != 0) {
71 track->SetTrackStatus(fKillTrackAndSecondaries);
72 G4RunManager::GetRunManager()->AbortEvent();
76 track->SetTrackStatus(fSuspend);
78 trackInfo->tagBremCandidate(
false);
87 if (secondaries->size() == 0) {
100 if (
auto volume{track->GetNextVolume()->GetName()};
101 volume.compareTo(
"recoil_PV") == 0 or
102 volume.compareTo(
"World_PV") == 0) {
104 track->SetTrackStatus(fKillTrackAndSecondaries);
105 G4RunManager::GetRunManager()->AbortEvent();
109 track->SetTrackStatus(fSuspend);
111 trackInfo->tagBremCandidate(
false);
118 G4String processName =
119 secondaries->at(0)->GetCreatorProcess()->GetProcessName();
122 if (!processName.contains(
process_)) {
124 track->SetTrackStatus(fKillTrackAndSecondaries);
125 G4RunManager::GetRunManager()->AbortEvent();
129 track->SetTrackStatus(fSuspend);
131 trackInfo->tagBremCandidate(
false);
136 if (G4RunManager::GetRunManager()->GetVerboseLevel() > 1) {
137 std::cout <<
"[ TargetProcessFilter ]: "
138 << G4EventManager::GetEventManager()
139 ->GetConstCurrentEvent()
141 <<
" Brem photon produced " << secondaries->size()
142 <<
" particle via " << processName <<
" process." << std::endl;
144 trackInfo->tagBremCandidate(
false);
145 trackInfo->setSaveFlag(
true);
146 trackInfo->tagPNGamma();