7 #include "G4VFastSimulationModel.hh"
8 #include "G4EventManager.hh"
9 #include "G4Electron.hh"
10 #include "GFlashHitMaker.hh"
11 #include "G4Region.hh"
12 #include "G4PhysicalConstants.hh"
14 constexpr G4double
twomass = 2 * CLHEP::electron_mass_c2;
19 fTrackingAction(nullptr),
21 fTailPos(0., 0., 0.) {
26 return (11 ==
std::abs(particle.GetPDGEncoding()));
30 const G4Track*
track = fastTrack.GetPrimaryTrack();
33 fTrackingAction = static_cast<const TrackingAction*>(G4EventManager::GetEventManager()->GetUserTrackingAction());
36 if (pdgMother == 11 || pdgMother == 22)
44 fastStep.KillPrimaryTrack();
45 fastStep.SetPrimaryTrackPathLength(0.0);
46 G4double
energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
48 const G4ThreeVector&
pos = fastTrack.GetPrimaryTrack()->GetPosition();
53 if (-11 == fastTrack.GetPrimaryTrack()->GetDefinition()->GetPDGEncoding())
56 const G4ThreeVector& momDir = fastTrack.GetPrimaryTrack()->GetMomentumDirection();
59 GFlashEnergySpot spot;
60 spot.SetEnergy(inPointEnergy);
61 spot.SetPosition(
pos);
65 G4double etail =
energy - inPointEnergy;
66 const G4int nspots = (G4int)(etail) + 1;
67 const G4double tailEnergy = etail / (G4double)nspots;
68 for (G4int
i = 0;
i < nspots; ++
i) {
72 const G4double
phi = CLHEP::twopi * G4UniformRand();
77 spot.SetEnergy(tailEnergy);