10#include "G4SDManager.hh"
11#include "G4VSensitiveDetector.hh"
17 : G4VFastSimulationModel(name, region)
32 G4SDManager *sdm = G4SDManager::GetSDMpointer();
33 G4VSensitiveDetector * vsd = sdm->FindSensitiveDetector(
m_fsSDname );
35 G4cout <<
"NeutronFastSim::IsApplicable WARNING Could not get TrackFastSimSD sensitive detector. If you are not writing track records this is expected." << G4endl;
39 G4cout <<
"NeutronFastSim::IsApplicable WARNING Could not cast the SD. If you are not writing track records this is expected." << G4endl;
49 if (fastTrack.GetPrimaryTrack()->GetDefinition() == G4Neutron::NeutronDefinition() ){
50 return (
m_Energy<0?
true:fastTrack.GetPrimaryTrack()->GetKineticEnergy()<
m_Energy) || fastTrack.GetPrimaryTrack()->GetGlobalTime()>
m_timeCut;
54 TrackHelper trackHelper(fastTrack.GetPrimaryTrack());
56 if (!primaryGenParticle) {
68 if (
m_fsSD)
m_fsSD->WriteTrack( fastTrack.GetPrimaryTrack() ,
false ,
false );
69 fastStep.KillPrimaryTrack();
virtual G4bool ModelTrigger(const G4FastTrack &) override final
void DoIt(const G4FastTrack &, G4FastStep &) override final
G4bool IsApplicable(const G4ParticleDefinition &) override final
NeutronFastSim(const std::string &name, G4Region *region, const std::string &fsSDname, const double etaCut, const double timeCut)
HepMC::GenParticlePtr GetPrimaryGenParticle()
Return the primary truth particle associated with this track.
HepMC3::ConstGenParticlePtr ConstGenParticlePtr
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...