8 #include "G4VFastSimulationModel.hh" 9 #include "G4EventManager.hh" 10 #include "G4Electron.hh" 11 #include "GFlashHitMaker.hh" 12 #include "G4Region.hh" 13 #include "G4Material.hh" 14 #include "G4Positron.hh" 15 #include "G4ParticleDefinition.hh" 16 #include "G4PhysicalConstants.hh" 18 constexpr G4double
twomass = 2 * CLHEP::electron_mass_c2;
24 fTrackingAction(nullptr),
26 fTailPos(0., 0., 0.) {
30 auto table = G4Material::GetMaterialTable();
31 for (
auto& mat : *
table) {
32 G4String nam = mat->GetName();
33 size_t n = nam.size();
35 G4String sn = nam.substr(
n - 5, 5);
43 edm::LogVerbatim(
"LowEnergyFastSimModel") <<
"LowEGFlash material: <" << nm <<
">";
47 return (11 ==
std::abs(particle.GetPDGEncoding()));
51 const G4Track*
track = fastTrack.GetPrimaryTrack();
68 int pdgMother = mother->GetDefinition()->GetPDGEncoding();
69 if (
std::abs(pdgMother) == 11 || pdgMother == 22)
77 fastStep.KillPrimaryTrack();
78 fastStep.SetPrimaryTrackPathLength(0.0);
79 auto track = fastTrack.GetPrimaryTrack();
82 const G4ThreeVector&
pos =
track->GetPosition();
90 const G4ThreeVector& momDir =
track->GetMomentumDirection();
93 GFlashEnergySpot spot;
94 spot.SetEnergy(inPointEnergy);
95 spot.SetPosition(
pos);
99 const G4double etail =
energy - inPointEnergy;
100 const G4int nspots = etail;
101 const G4double tailEnergy = etail / (nspots + 1);
110 for (G4int
i = 0;
i <= nspots; ++
i) {
114 const G4double
phi = CLHEP::twopi * G4UniformRand();
119 spot.SetEnergy(tailEnergy);
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
const G4ParticleDefinition * fPositron
G4bool IsApplicable(const G4ParticleDefinition &particle) override
constexpr G4double twomass
Sin< T >::type sin(const T &t)
LowEnergyFastSimParam fParam
const G4Material * fMaterial
G4double GetInPointEnergyFraction(G4double energy) const
const G4Track * geant4Track() const
const TrackingAction * fTrackingAction
Cos< T >::type cos(const T &t)
LowEnergyFastSimModel(const G4String &name, G4Region *region, const edm::ParameterSet &parSet)
Abs< T >::type abs(const T &t)
constexpr G4double scaleFactor
void DoIt(const G4FastTrack &fastTrack, G4FastStep &fastStep) override
G4bool ModelTrigger(const G4FastTrack &fastTrack) override
G4double GetRadius(G4double energy) const