CMS 3D CMS Logo

LowEnergyFastSimParam.h
Go to the documentation of this file.
1 #ifndef LowEnergyFastSimParam_h
2 #define LowEnergyFastSimParam_h
3 
4 #include "G4Types.hh"
5 #include "Randomize.hh"
6 #include "G4Log.hh"
7 
9 public:
10  G4double GetInPointEnergyFraction(G4double energy) const {
11  // normalisation of fit parameters to have the result
12  constexpr const G4double a0 = 1.02186764;
13  constexpr const G4double a1 = 2.14064635e-02 / a0;
14  constexpr const G4double a2 = 1.96988997e-04 / a0;
15  constexpr const G4double a3 = -6.42310317e-07 / a0;
16  const G4double e2 = energy * energy;
17  const G4double e3 = e2 * energy;
18  return a3 * e3 + a2 * e2 - a1 * energy + 1.0;
19  }
20 
21  G4double GetRadius(G4double energy) const {
22  constexpr const G4double r1 = 156.52094133;
23  constexpr const G4double r2 = -1.02220543;
24  const G4double r0 = r1 + r2 * energy;
25  return std::sqrt(r0 / G4UniformRand() - r0);
26  }
27 
28  G4double GetZ() const {
29  constexpr const G4double alpha = 1.0 / 0.02211515;
30  constexpr const G4double t = 0.66968625;
31  return -G4Log(G4UniformRand()) * alpha + t;
32  }
33 };
34 
35 #endif
G4double GetInPointEnergyFraction(G4double energy) const
T sqrt(T t)
Definition: SSEVec.h:19
static constexpr float a0
G4double GetRadius(G4double energy) const