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
double twomass = 2 * CLHEP::electron_mass_c2;
17 : G4VFastSimulationModel(
name,
region), fRegion(
region), fTrackingAction(nullptr) {
22 return (11 ==
std::abs(particle.GetPDGEncoding()));
26 const G4Track*
track = fastTrack.GetPrimaryTrack();
28 fTrackingAction = static_cast<const TrackingAction*>(G4EventManager::GetEventManager()->GetUserTrackingAction());
31 if (pdgMother == 11 || pdgMother == 22)
38 fastStep.KillPrimaryTrack();
39 fastStep.SetPrimaryTrackPathLength(0.0);
40 double energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
42 const G4ThreeVector&
pos = fastTrack.GetPrimaryTrack()->GetPosition();
47 if (-11 == fastTrack.GetPrimaryTrack()->GetDefinition()->GetPDGEncoding())
50 const G4ThreeVector& momDir = fastTrack.GetPrimaryTrack()->GetMomentumDirection();
51 const G4ThreeVector& ortho = momDir.orthogonal();
52 const G4ThreeVector&
cross = momDir.
cross(ortho);
55 GFlashEnergySpot spot;
56 spot.SetEnergy(inPointEnergy);
57 spot.SetPosition(
pos);
61 G4double etail =
energy - inPointEnergy;
62 const G4int nspots =
int(etail) + 1;
63 const G4double tailEnergy = etail / (G4double)nspots;
64 for (G4int
i = 0;
i < nspots; ++
i) {
68 const G4double
phi = CLHEP::twopi * G4UniformRand();
71 spot.SetEnergy(tailEnergy);
72 spot.SetPosition(tailPos);