10 using namespace CLHEP;
19 edm::LogInfo(
"KillSecondaries") <<
"KillSecondariesTrackAction:: Killing" 20 <<
" Flag " << killHeavy <<
" protons below " 21 << kmaxProton <<
" MeV, neutrons below " 22 << kmaxNeutron <<
" MeV and ions below " 23 << kmaxIon <<
" MeV\n";
31 G4Track* theTrack = (G4Track*)((*trk)());
34 int pdg = theTrack->GetDefinition()->GetPDGEncoding();
36 double ke = theTrack->GetKineticEnergy()/
MeV;
37 if ((((pdg/1000000000 == 1 && ((pdg/10000)%100) > 0 &&
38 ((pdg/10)%100) > 0)) && (ke<kmaxIon)) ||
39 ((pdg == 2212) && (ke < kmaxProton)) ||
40 ((pdg == 2112) && (ke < kmaxNeutron))) {
41 theTrack->SetTrackStatus(fStopAndKill);
42 edm::LogInfo(
"KillSecondaries") <<
"Kill Track " << theTrack->GetTrackID()
43 <<
" Type " << theTrack->GetDefinition()->GetParticleName()
44 <<
" Kinetic Energy " << ke <<
" MeV";
T getParameter(std::string const &) const
KillSecondariesTrackAction(edm::ParameterSet const &p)
void update(const BeginOfTrack *trk) override
This routine will be called when the appropriate signal arrives.
~KillSecondariesTrackAction() override