45 CLHEP::RandGauss GaussGen(
fEngine);
46 CLHEP::RandFlat UniformGen(
fEngine);
48 double yieldFactor = 1.0;
49 double excitationRatio =
52 double const energyDeposit = edep.Energy();
53 if (energyDeposit < 1 * CLHEP::eV)
55 return {0., 0., 0., 0.};
58 int pdgcode = edep.PdgCode();
71 DokeBirks[0] = 0.07 * pow((eField / 1.0e3), -0.85);
75 DokeBirks[0] = 0.0003;
79 double Density =
detProp.Density() /
84 double epsilon = 11.5 * (energyDeposit / CLHEP::keV) * pow(LAr_Z, (-7. / 3.));
86 if (pdgcode == 2112 || pdgcode == -2112)
88 yieldFactor = 0.23 * (1 +
exp(-5 * epsilon));
89 excitationRatio = 0.69337 + 0.3065 *
exp(-0.008806 * pow(eField, 0.76313));
95 double MeanNumQuanta = scint_yield * energyDeposit;
96 double sigma = sqrt(resolution_scale * MeanNumQuanta);
97 int NumQuanta = int(floor(GaussGen.fire(MeanNumQuanta, sigma) + 0.5));
98 double LeffVar = GaussGen.fire(yieldFactor, 0.25 * yieldFactor);
99 LeffVar = std::clamp(LeffVar, 0., 1.);
108 if (energyDeposit < 1 / scint_yield || NumQuanta < 0) { NumQuanta = 0; }
111 int NumExcitons =
BinomFluct(NumQuanta, excitationRatio / (1 + excitationRatio));
112 int NumIons = NumQuanta - NumExcitons;
122 if (pdgcode != 11 && pdgcode != -11 && pdgcode != 13 &&
132 dx = dE / (Density * LET);
135 if (
abs(pdgcode) == 2112)
142 dx = std::hypot(startx - endx, starty - endy, startz - endz) / CLHEP::cm;
144 LET = (dE / dx) * (1 / Density);
146 if (LET > 0 && dE > 0 && dx > 0) {
148 if (ratio < 0.7 && pdgcode == 11) {
155 DokeBirks[1] = DokeBirks[0] / (1 - DokeBirks[2]);
156 recombProb = (DokeBirks[0] * LET) / (1 + DokeBirks[1] * LET) +
161 recombProb = std::clamp(recombProb, 0., 1.);
166 int const NumPhotons = NumExcitons +
BinomFluct(NumIons, recombProb);
167 int const NumElectrons = NumQuanta - NumPhotons;
169 return {energyDeposit,
170 static_cast<double>(NumElectrons),
171 static_cast<double>(NumPhotons),
CLHEP::HepRandomEngine & fEngine
double Length_t
Type used for coordinates and distances. They are measured in centimeters.
util::quantities::megaelectronvolt MeV
int BinomFluct(int N0, double prob)
double CalcElectronLET(double E)
double GetScintYieldRatio(sim::SimEnergyDeposit const &edep)
double EFieldAtStep(double efield, sim::SimEnergyDeposit const &edep) override