diff options
| author | shivesh <s.p.mandalia@qmul.ac.uk> | 2019-08-22 01:37:19 +0100 |
|---|---|---|
| committer | shivesh <s.p.mandalia@qmul.ac.uk> | 2019-08-22 01:37:19 +0100 |
| commit | e3079fb2367c26f767be41e6c313d960c517bbcd (patch) | |
| tree | 509f081184a4179894ab8370ea06425d46729e9a /src/G4BeamTestUserTrackingAction.cxx | |
| parent | ba4dd395d1f163983f7102ff9a6c513cfe17912e (diff) | |
| download | G4BeamTest-e3079fb2367c26f767be41e6c313d960c517bbcd.tar.gz G4BeamTest-e3079fb2367c26f767be41e6c313d960c517bbcd.zip | |
Thu 22 Aug 01:37:19 BST 2019
Diffstat (limited to 'src/G4BeamTestUserTrackingAction.cxx')
| -rw-r--r-- | src/G4BeamTestUserTrackingAction.cxx | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/src/G4BeamTestUserTrackingAction.cxx b/src/G4BeamTestUserTrackingAction.cxx index e41ccc3..09a7e59 100644 --- a/src/G4BeamTestUserTrackingAction.cxx +++ b/src/G4BeamTestUserTrackingAction.cxx @@ -11,36 +11,35 @@ void G4BeamTestUserTrackingAction::PreUserTrackingAction(const G4Track*){} void G4BeamTestUserTrackingAction::PostUserTrackingAction(const G4Track* track) { - const G4LogicalVolume *volume = track->GetLogicalVolumeAtVertex(); - G4UserLimits *limit = volume->GetUserLimits(); - if(!limit) G4cout << "----> G4LogicalVolume: " << volume->GetName() << " has no defined G4UserLimit" << G4endl; - G4double threshold = limit->GetUserMinEkine(*track); - G4double max_threshold = 3.54; - G4TrackVector* secondaries = fpTrackingManager->GimmeSecondaries(); - if(secondaries) - { - size_t nSeco = secondaries->size(); - if(nSeco>0) - { - for(size_t i=0;i<nSeco;i++) - { - //check if secondary particle is a 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){ - // G4cout << "TrackingAction: killing particle " << particle << " with energy " << energy << " < " << threshold << G4endl; - // (*secondaries)[i]->SetTrackStatus(fStopAndKill); - // } + // const G4LogicalVolume *volume = track->GetLogicalVolumeAtVertex(); + // G4UserLimits *limit = volume->GetUserLimits(); + // if(!limit) G4cout << "----> G4LogicalVolume: " << volume->GetName() << " has no defined G4UserLimit" << G4endl; + // G4double threshold = limit->GetUserMinEkine(*track); + // G4double max_threshold = 3.54; + // G4TrackVector* secondaries = fpTrackingManager->GimmeSecondaries(); + // if(secondaries) + // { + // size_t nSeco = secondaries->size(); + // if(nSeco>0) + // { + // for(size_t i=0;i<nSeco;i++) + // { + // //check if secondary particle is a 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){ + // G4cout << "TrackingAction: killing particle " << particle << " with energy " << energy << " < " << threshold << G4endl; + // (*secondaries)[i]->SetTrackStatus(fStopAndKill); + // } // if (energy > max_threshold * CLHEP::eV){ // G4cout << "TrackingAction: killing particle " << particle << " with energy " << energy << " > " << max_threshold << G4endl; - // (*secondaries)[i]->SetTrackStatus(fStopAndKill); - + // (*secondaries)[i]->SetTrackStatus(fStopAndKill); // } - } - } - } - } + // } + // } + // } + // } } |
