aboutsummaryrefslogtreecommitdiffstats
path: root/src/G4BeamTestUserTrackingAction.cxx
diff options
context:
space:
mode:
authorshivesh <s.p.mandalia@qmul.ac.uk>2018-11-20 17:26:02 +0000
committershivesh <s.p.mandalia@qmul.ac.uk>2018-11-20 17:26:02 +0000
commitd0533d03d0c85f2f993f1793a6b9ea2af3391207 (patch)
tree682c2fefe2d113319f21c07bded00fed5245e19b /src/G4BeamTestUserTrackingAction.cxx
parent738c2f88939a041fbc8b6b9cfa3c547b86bc6e42 (diff)
downloadG4BeamTest-d0533d03d0c85f2f993f1793a6b9ea2af3391207.tar.gz
G4BeamTest-d0533d03d0c85f2f993f1793a6b9ea2af3391207.zip
Tue 20 Nov 17:26:02 GMT 2018
Diffstat (limited to 'src/G4BeamTestUserTrackingAction.cxx')
-rw-r--r--src/G4BeamTestUserTrackingAction.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/G4BeamTestUserTrackingAction.cxx b/src/G4BeamTestUserTrackingAction.cxx
index c6317df..f7c053b 100644
--- a/src/G4BeamTestUserTrackingAction.cxx
+++ b/src/G4BeamTestUserTrackingAction.cxx
@@ -24,11 +24,15 @@ void G4BeamTestUserTrackingAction::PostUserTrackingAction(const G4Track* track)
for(size_t i=0;i<nSeco;i++)
{
//check if secondary particle is a gamma
- if((*secondaries)[i]->GetDefinition()->GetParticleName() == "gamma")
+ G4String particle = (*secondaries)[i]->GetDefinition()->GetParticleName();
+ if(particle == "gamma" || particle == "opticalphoton")
{
//check if particle energy is below threshold; if true, kill the particle
G4double energy = (*secondaries)[i]->GetTotalEnergy();
- if(energy < threshold) (*secondaries)[i]->SetTrackStatus(fStopAndKill);
+ if(energy < threshold){
+ G4cout << "TrackingAction: killing particle " << particle << " with energy " << energy << " < " << threshold << G4endl;
+ (*secondaries)[i]->SetTrackStatus(fStopAndKill);
+ }
}
}
}