EDepSimUserStackingAction.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////
2 // $Id: EDepSim::UserStackingAction.cc,v 1.4 2011/09/06 18:58:35 mcgrew Exp $
3 //
4 
6 #include "EDepSimLog.hh"
7 
8 #include <globals.hh>
9 #include <G4ParticleDefinition.hh>
10 
11 #include <G4SystemOfUnits.hh>
12 #include <G4PhysicalConstants.hh>
13 
15 
17 
18 G4ClassificationOfNewTrack
20  // Get the particle type of the new track.
21  const G4ParticleDefinition* particle = aTrack->GetDefinition();
22 
23  // if (aTrack->GetCurrentStepNumber() > 0) return fUrgent;
24 
25  if (aTrack->GetParentID() <= 0) return fUrgent;
26 
27  // This is where we can throw away particles that we don't want to track.
28  // Drop photons below the "lowest" nuclear lines. The lowest I know if is
29  // about 6 keV, and atomic shells start messing with the cross section at
30  // about 70 keV.
31  if (particle->GetParticleName() == "gamma") {
32  if (aTrack->GetKineticEnergy() < 10.*CLHEP::keV) return fKill;
33  }
34 
35  if (particle->GetParticleName() == "opticalphoton") {
36  return fKill;
37  }
38 
39  if (particle->GetParticleName() == "thermalelectron") {
40  return fKill;
41  }
42 
43  return G4UserStackingAction::ClassifyNewTrack(aTrack);
44 }
static constexpr double keV
Definition: Units.h:128
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *)
Check if a new track should be tracked.