9 #include "G4VFastSimulationModel.hh" 10 #include "G4EventManager.hh" 11 #include "G4Electron.hh" 12 #include "GFlashHitMaker.hh" 13 #include "G4Region.hh" 14 #include "G4Material.hh" 15 #include "G4Positron.hh" 16 #include "G4ParticleDefinition.hh" 17 #include "G4PhysicalConstants.hh" 25 fTrackingAction(nullptr),
27 fTailPos(0., 0., 0.) {
31 auto table = G4Material::GetMaterialTable();
32 for (
auto const& mat : *
table) {
34 size_t n = nam.size();
36 G4String sn = nam.substr(
n - 5, 5);
44 edm::LogVerbatim(
"LowEnergyFastSimModel") <<
"LowEGFlash material: <" << nm <<
">";
48 return (11 ==
std::abs(particle.GetPDGEncoding()));
52 const G4Track*
track = fastTrack.GetPrimaryTrack();
75 fastStep.KillPrimaryTrack();
76 fastStep.ProposePrimaryTrackPathLength(0.0);
77 auto track = fastTrack.GetPrimaryTrack();
80 const G4ThreeVector&
pos =
track->GetPosition();
88 const G4ThreeVector& momDir =
track->GetMomentumDirection();
91 GFlashEnergySpot spot;
92 spot.SetEnergy(inPointEnergy);
93 spot.SetPosition(
pos);
97 double wt2 =
track->GetWeight();
103 const G4double etail =
energy - inPointEnergy;
104 const G4int nspots = etail;
105 const G4double tailEnergy = etail * wt2 / (nspots + 1);
114 for (G4int
i = 0;
i <= nspots; ++
i) {
118 const G4double
phi = CLHEP::twopi * G4UniformRand();
123 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 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
std::string noNameSpace(const std::string &name)
G4double GetRadius(G4double energy) const