Skip to content

Commit a28fc72

Browse files
return tracks to GPU if no nuclear attached
1 parent e8e6981 commit a28fc72

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/AdePTGeant4Integration.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,9 @@ void AdePTGeant4Integration::ReturnTrack(adeptint::TrackData const &track, unsig
711711
// Since we do not give back the track to G4, we have to delete it here
712712
delete leakedTrack;
713713
delete step;
714+
} else {
715+
// no gamma nuclear process attached, just give back the track to G4 to put it back on GPU
716+
G4EventManager::GetEventManager()->GetStackManager()->PushOneTrack(leakedTrack);
714717
}
715718
} else {
716719
// case LeakStatus::LeptonNuclear
@@ -732,6 +735,9 @@ void AdePTGeant4Integration::ReturnTrack(adeptint::TrackData const &track, unsig
732735
G4EventManager::GetEventManager()->StackTracks(&secondaries);
733736
// Give updated primary after lepton nuclear reacton to G4
734737
G4EventManager::GetEventManager()->GetStackManager()->PushOneTrack(leakedTrack);
738+
} else {
739+
// no lepton nuclear process attached, just give back the track to G4 to put it back on GPU
740+
G4EventManager::GetEventManager()->GetStackManager()->PushOneTrack(leakedTrack);
735741
}
736742
}
737743
} else {

0 commit comments

Comments
 (0)