26 #include "art/Framework/Services/Registry/ServiceHandle.h"
27 #include "CLHEP/Random/RandBinomial.h"
28 #include "messagefacility/MessageLogger/MessageLogger.h"
35 : fISTPC{*(lar::providerFrom<geo::Geometry>())}
36 , fSCE(lar::providerFrom<spacecharge::SpaceChargeService>())
37 , fBinomialGen{CLHEP::RandBinomial(Engine)}
39 MF_LOG_INFO(
"ISCalcCorrelated") <<
"IonizationAndScintillation/ISCalcCorrelated Initialize.";
41 fScintPreScale = lar::providerFrom<detinfo::LArPropertiesService>()->
ScintPreScale();
43 art::ServiceHandle<sim::LArG4Parameters const> LArG4PropHandle;
49 fRecombA = LArG4PropHandle->RecombA();
51 fModBoxA = LArG4PropHandle->ModBoxA();
54 fUseModLarqlRecomb = (
bool)LArG4PropHandle->UseModLarqlRecomb();
55 fUseBinomialFlucts = (
bool)LArG4PropHandle->UseBinomialFlucts();
56 fLarqlChi0A = LArG4PropHandle->LarqlChi0A();
57 fLarqlChi0B = LArG4PropHandle->LarqlChi0B();
58 fLarqlChi0C = LArG4PropHandle->LarqlChi0C();
59 fLarqlChi0D = LArG4PropHandle->LarqlChi0D();
60 fLarqlAlpha = LArG4PropHandle->LarqlAlpha();
61 fLarqlBeta = LArG4PropHandle->LarqlBeta();
68 fWph = LArG4PropHandle->Wph() * 1
e-6;
77 double const energy_deposit = edep.
Energy();
80 double num_ions = energy_deposit /
fWion;
81 double num_quanta = energy_deposit /
fWph;
84 double dEdx = (ds <= 0.0) ? 0.0 : energy_deposit /
ds;
85 dEdx = (dEdx < 1.) ? 1. :
dEdx;
94 double Xi =
fModBoxB * dEdx / EFieldStep;
95 recomb = std::log(
fModBoxA + Xi) / Xi;
109 mf::LogWarning(
"ISCalcCorrelated")
110 <<
"Recombination survival fraction is lower than 0.: " << recomb
111 <<
", fixing it to 0.";
114 else if (recomb > 1.){
115 mf::LogWarning(
"ISCalcCorrelated")
116 <<
"Recombination survival fraction is higher than 1.: " << recomb
117 <<
", fixing it to 1.";
123 fBinomialGen.fire(num_ions, recomb) : (num_ions * recomb);
126 double num_photons = (num_quanta - num_electrons) *
fScintPreScale;
128 MF_LOG_DEBUG(
"ISCalcCorrelated")
129 <<
"With " << energy_deposit <<
" MeV of deposited energy, "
130 <<
"and a recombination of " << recomb <<
", \nthere are "
131 << num_electrons <<
" electrons, and " << num_photons <<
" photons.";
148 return efield * std::hypot(1 + eFieldOffsets.X(), eFieldOffsets.Y(), eFieldOffsets.Z());
163 double const dEdx)
const
Store parameters for running LArG4.
geo::Length_t StepLength() const
Utilities related to art service access.
stream1 stream1 can override from command line with o or output services LArPropertiesService ScintPreScale
double Efield(unsigned int planegap=0) const
kV/cm
virtual geo::Vector_t GetEfieldOffsets(geo::Point_t const &point) const =0
geo::Point_t MidPoint() const
createEngine fGeVToElectrons
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
contains information for a single step in the detector simulation
Energy deposition in the active material.
createEngine fUseModBoxRecomb
bool isScintInActiveVolume(geo::Point_t const &ScintPoint)
double GetScintYieldRatio(sim::SimEnergyDeposit const &edep)
virtual bool EnableSimEfieldSCE() const =0
art framework interface to geometry description