44 CLHEP::RandGauss GaussGen(
fEngine);
45 CLHEP::RandFlat UniformGen(
fEngine);
47 double yieldFactor = 1.0;
48 double excitationRatio =
51 double const energyDeposit = edep.Energy();
54 return {0., 0., 0., 0.};
70 DokeBirks[0] = 0.07 *
pow((eField / 1.0e3), -0.85);
74 DokeBirks[0] = 0.0003;
78 double Density = detProp.Density() /
83 double epsilon = 11.5 * (energyDeposit /
CLHEP::keV) *
pow(LAr_Z, (-7. / 3.));
85 if (pdgcode == 2112 || pdgcode == -2112)
87 yieldFactor = 0.23 * (1 + exp(-5 * epsilon));
88 excitationRatio = 0.69337 + 0.3065 * exp(-0.008806 *
pow(eField, 0.76313));
94 double MeanNumQuanta = scint_yield * energyDeposit;
95 double sigma = sqrt(resolution_scale * MeanNumQuanta);
96 int NumQuanta =
int(floor(GaussGen.fire(MeanNumQuanta, sigma) + 0.5));
97 double LeffVar = GaussGen.fire(yieldFactor, 0.25 * yieldFactor);
98 LeffVar = std::clamp(LeffVar, 0., 1.);
107 if (energyDeposit < 1 / scint_yield || NumQuanta < 0) { NumQuanta = 0; }
110 int NumExcitons =
BinomFluct(NumQuanta, excitationRatio / (1 + excitationRatio));
111 int NumIons = NumQuanta - NumExcitons;
121 if (pdgcode != 11 && pdgcode != -11 && pdgcode != 13 &&
131 dx = dE / (Density * LET);
134 if (
abs(pdgcode) == 2112)
143 LET = (dE / dx) * (1 / Density);
145 if (LET > 0 && dE > 0 && dx > 0) {
147 if (ratio < 0.7 && pdgcode == 11) {
154 DokeBirks[1] = DokeBirks[0] / (1 - DokeBirks[2]);
155 recombProb = (DokeBirks[0] * LET) / (1 + DokeBirks[1] * LET) +
160 recombProb = std::clamp(recombProb, 0., 1.);
165 int const NumPhotons = NumExcitons +
BinomFluct(NumIons, recombProb);
166 int const NumElectrons = NumQuanta - NumPhotons;
168 return {energyDeposit,
169 static_cast<double>(NumElectrons),
170 static_cast<double>(NumPhotons),
static constexpr double cm
CLHEP::HepRandomEngine & fEngine
static constexpr double keV
static constexpr double g
static constexpr double cm3
static constexpr double MeV
std::enable_if_t< std::is_arithmetic_v< T >, T > hypot(T x, T y)
static constexpr double eV
int BinomFluct(int N0, double prob)
double GetScintYieldRatio(sim::SimEnergyDeposit const &edep)
double Length_t
Type used for coordinates and distances. They are measured in centimeters.
double CalcElectronLET(double E)
double EFieldAtStep(double efield, sim::SimEnergyDeposit const &edep) override