All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
larg4::ISCalcCorrelated Class Reference

#include <ISCalcCorrelated.h>

Inheritance diagram for larg4::ISCalcCorrelated:
larg4::ISCalc

Public Member Functions

 ISCalcCorrelated (detinfo::DetectorPropertiesData const &detProp, CLHEP::HepRandomEngine &Engine)
 
double EFieldAtStep (double efield, sim::SimEnergyDeposit const &edep) override
 
ISCalcData CalcIonAndScint (detinfo::DetectorPropertiesData const &detProp, sim::SimEnergyDeposit const &edep) override
 
- Public Member Functions inherited from larg4::ISCalc
 ISCalc ()
 
virtual ~ISCalc ()=default
 
double GetScintYield (sim::SimEnergyDeposit const &edep, bool prescale)
 
double GetScintYieldRatio (sim::SimEnergyDeposit const &edep)
 

Private Member Functions

double EscapingEFraction (double const dEdx) const
 
double FieldCorrection (double const EF, double const dEdx) const
 

Private Attributes

ISTPC fISTPC
 
const spacecharge::SpaceChargefSCE
 
CLHEP::RandBinomial fBinomialGen
 
double fGeVToElectrons
 from LArG4Parameters service More...
 
double fWion
 W_ion (23.6 eV) == 1/fGeVToElectrons. More...
 
double fWph
 from LArG4Parameters service More...
 
double fScintPreScale
 scintillation pre-scaling factor from LArProperties service More...
 
double fRecombA
 from LArG4Parameters service More...
 
double fRecombk
 from LArG4Parameters service More...
 
double fModBoxA
 from LArG4Parameters service More...
 
double fModBoxB
 from LArG4Parameters service More...
 
double fLarqlChi0A
 from LArG4Parameters service More...
 
double fLarqlChi0B
 from LArG4Parameters service More...
 
double fLarqlChi0C
 from LArG4Parameters service More...
 
double fLarqlChi0D
 from LArG4Parameters service More...
 
double fLarqlAlpha
 from LArG4Parameters service More...
 
double fLarqlBeta
 from LArG4Parameters service More...
 
bool fUseModBoxRecomb
 from LArG4Parameters service More...
 
bool fUseModLarqlRecomb
 from LArG4Parameters service More...
 
bool fUseBinomialFlucts
 from LArG4Parameters service More...
 

Detailed Description

Definition at line 33 of file ISCalcCorrelated.h.

Constructor & Destructor Documentation

larg4::ISCalcCorrelated::ISCalcCorrelated ( detinfo::DetectorPropertiesData const &  detProp,
CLHEP::HepRandomEngine &  Engine 
)

Definition at line 34 of file ISCalcCorrelated.cxx.

35  : fISTPC{*(lar::providerFrom<geo::Geometry>())}
36  , fSCE(lar::providerFrom<spacecharge::SpaceChargeService>())
37  , fBinomialGen{CLHEP::RandBinomial(Engine)}
38  {
39  MF_LOG_INFO("ISCalcCorrelated") << "IonizationAndScintillation/ISCalcCorrelated Initialize.";
40 
41  fScintPreScale = lar::providerFrom<detinfo::LArPropertiesService>()->ScintPreScale();
42 
43  art::ServiceHandle<sim::LArG4Parameters const> LArG4PropHandle;
44 
45  // The recombination coefficient is in g/(MeVcm^2), but we report
46  // energy depositions in MeV/cm, need to divide Recombk from the
47  // LArG4Parameters service by the density of the argon we got
48  // above.
49  fRecombA = LArG4PropHandle->RecombA();
50  fRecombk = LArG4PropHandle->Recombk() / detProp.Density(detProp.Temperature());
51  fModBoxA = LArG4PropHandle->ModBoxA();
52  fModBoxB = LArG4PropHandle->ModBoxB() / detProp.Density(detProp.Temperature());
53  fUseModBoxRecomb = (bool)LArG4PropHandle->UseModBoxRecomb();
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();
62  fGeVToElectrons = LArG4PropHandle->GeVToElectrons();
63 
64  // ionization work function
65  fWion = 1. / fGeVToElectrons * 1e3; // MeV
66 
67  // ion+excitation work function
68  fWph = LArG4PropHandle->Wph() * 1e-6; // MeV
69  }
double fModBoxA
from LArG4Parameters service
double fRecombk
from LArG4Parameters service
stream1 stream1 can override from command line with o or output services LArPropertiesService ScintPreScale
double fWion
W_ion (23.6 eV) == 1/fGeVToElectrons.
CLHEP::RandBinomial fBinomialGen
double fGeVToElectrons
from LArG4Parameters service
double fModBoxB
from LArG4Parameters service
bool fUseModLarqlRecomb
from LArG4Parameters service
static constexpr bool
double fScintPreScale
scintillation pre-scaling factor from LArProperties service
double fWph
from LArG4Parameters service
bool fUseBinomialFlucts
from LArG4Parameters service
double fLarqlChi0B
from LArG4Parameters service
double fLarqlChi0D
from LArG4Parameters service
bool fUseModBoxRecomb
from LArG4Parameters service
double fLarqlChi0C
from LArG4Parameters service
double fLarqlChi0A
from LArG4Parameters service
double fLarqlBeta
from LArG4Parameters service
do i e
double fLarqlAlpha
from LArG4Parameters service
const spacecharge::SpaceCharge * fSCE
double fRecombA
from LArG4Parameters service
auto const detProp

Member Function Documentation

ISCalcData larg4::ISCalcCorrelated::CalcIonAndScint ( detinfo::DetectorPropertiesData const &  detProp,
sim::SimEnergyDeposit const &  edep 
)
overridevirtual

Implements larg4::ISCalc.

Definition at line 73 of file ISCalcCorrelated.cxx.

75  {
76 
77  double const energy_deposit = edep.Energy();
78 
79  // calculate total quanta (ions + excitons)
80  double num_ions = energy_deposit / fWion;
81  double num_quanta = energy_deposit / fWph;
82 
83  double ds = edep.StepLength();
84  double dEdx = (ds <= 0.0) ? 0.0 : energy_deposit / ds;
85  dEdx = (dEdx < 1.) ? 1. : dEdx;
86  double EFieldStep = EFieldAtStep(detProp.Efield(), edep);
87  double recomb = 0.;
88 
89  //calculate recombination survival fraction value inside, otherwise zero
90  if(EFieldStep > 0.) {
91  // calculate recombination survival fraction
92  // ...using Modified Box model
93  if (fUseModBoxRecomb) {
94  double Xi = fModBoxB * dEdx / EFieldStep;
95  recomb = std::log(fModBoxA + Xi) / Xi;
96  }
97  // ... or using Birks/Doke
98  else {
99  recomb = fRecombA / (1. + dEdx * fRecombk / EFieldStep);
100  }
101  }
102 
103  if(fUseModLarqlRecomb){ //Use corrections from LArQL model
104  recomb += EscapingEFraction(dEdx)*FieldCorrection(EFieldStep, dEdx); //Correction for low EF
105  }
106 
107  // Guard against unphysical recombination values
108  if (recomb < 0.){
109  mf::LogWarning("ISCalcCorrelated")
110  << "Recombination survival fraction is lower than 0.: " << recomb
111  << ", fixing it to 0.";
112  recomb = 0.;
113  }
114  else if (recomb > 1.){
115  mf::LogWarning("ISCalcCorrelated")
116  << "Recombination survival fraction is higher than 1.: " << recomb
117  << ", fixing it to 1.";
118  recomb = 1.;
119  }
120 
121  // using this recombination, calculate number of ionization electrons
122  double num_electrons = (fUseBinomialFlucts) ?
123  fBinomialGen.fire(num_ions, recomb) : (num_ions * recomb);
124 
125  // calculate scintillation photons
126  double num_photons = (num_quanta - num_electrons) * fScintPreScale;
127 
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.";
132 
133  return {energy_deposit, num_electrons, num_photons, GetScintYieldRatio(edep)};
134  }
double FieldCorrection(double const EF, double const dEdx) const
double EscapingEFraction(double const dEdx) const
double fModBoxA
from LArG4Parameters service
double fRecombk
from LArG4Parameters service
double fWion
W_ion (23.6 eV) == 1/fGeVToElectrons.
CLHEP::RandBinomial fBinomialGen
double fModBoxB
from LArG4Parameters service
bool fUseModLarqlRecomb
from LArG4Parameters service
double fScintPreScale
scintillation pre-scaling factor from LArProperties service
double EFieldAtStep(double efield, sim::SimEnergyDeposit const &edep) override
double fWph
from LArG4Parameters service
bool fUseBinomialFlucts
from LArG4Parameters service
bool fUseModBoxRecomb
from LArG4Parameters service
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2687
double fRecombA
from LArG4Parameters service
double GetScintYieldRatio(sim::SimEnergyDeposit const &edep)
Definition: ISCalc.cxx:47
auto const detProp
double larg4::ISCalcCorrelated::EFieldAtStep ( double  efield,
sim::SimEnergyDeposit const &  edep 
)
overridevirtual

Implements larg4::ISCalc.

Definition at line 138 of file ISCalcCorrelated.cxx.

140  {
141  // electric field outside active volume set to zero
142  if(!fISTPC.isScintInActiveVolume(edep.MidPoint())) return 0.;
143 
144  // electric field inside active volume
145  if (!fSCE->EnableSimEfieldSCE()) return efield;
146 
147  auto const eFieldOffsets = fSCE->GetEfieldOffsets(edep.MidPoint());
148  return efield * std::hypot(1 + eFieldOffsets.X(), eFieldOffsets.Y(), eFieldOffsets.Z());
149  }
virtual geo::Vector_t GetEfieldOffsets(geo::Point_t const &point) const =0
const spacecharge::SpaceCharge * fSCE
bool isScintInActiveVolume(geo::Point_t const &ScintPoint)
Definition: ISTPC.cxx:43
virtual bool EnableSimEfieldSCE() const =0
double larg4::ISCalcCorrelated::EscapingEFraction ( double const  dEdx) const
private

Definition at line 155 of file ISCalcCorrelated.cxx.

156  {
158  }
double fLarqlChi0B
from LArG4Parameters service
double fLarqlChi0D
from LArG4Parameters service
double fLarqlChi0C
from LArG4Parameters service
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2687
double fLarqlChi0A
from LArG4Parameters service
double larg4::ISCalcCorrelated::FieldCorrection ( double const  EF,
double const  dEdx 
) const
private

Definition at line 162 of file ISCalcCorrelated.cxx.

164  {
165  return std::exp(-EF/(fLarqlAlpha*std::log(dEdx)+fLarqlBeta));
166  }
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2687
double fLarqlBeta
from LArG4Parameters service
double fLarqlAlpha
from LArG4Parameters service

Member Data Documentation

CLHEP::RandBinomial larg4::ISCalcCorrelated::fBinomialGen
private

Definition at line 46 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fGeVToElectrons
private

from LArG4Parameters service

Definition at line 48 of file ISCalcCorrelated.h.

ISTPC larg4::ISCalcCorrelated::fISTPC
private

Definition at line 44 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fLarqlAlpha
private

from LArG4Parameters service

Definition at line 60 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fLarqlBeta
private

from LArG4Parameters service

Definition at line 61 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fLarqlChi0A
private

from LArG4Parameters service

Definition at line 56 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fLarqlChi0B
private

from LArG4Parameters service

Definition at line 57 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fLarqlChi0C
private

from LArG4Parameters service

Definition at line 58 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fLarqlChi0D
private

from LArG4Parameters service

Definition at line 59 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fModBoxA
private

from LArG4Parameters service

Definition at line 54 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fModBoxB
private

from LArG4Parameters service

Definition at line 55 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fRecombA
private

from LArG4Parameters service

Definition at line 52 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fRecombk
private

from LArG4Parameters service

Definition at line 53 of file ISCalcCorrelated.h.

const spacecharge::SpaceCharge* larg4::ISCalcCorrelated::fSCE
private

Definition at line 45 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fScintPreScale
private

scintillation pre-scaling factor from LArProperties service

Definition at line 51 of file ISCalcCorrelated.h.

bool larg4::ISCalcCorrelated::fUseBinomialFlucts
private

from LArG4Parameters service

Definition at line 64 of file ISCalcCorrelated.h.

bool larg4::ISCalcCorrelated::fUseModBoxRecomb
private

from LArG4Parameters service

Definition at line 62 of file ISCalcCorrelated.h.

bool larg4::ISCalcCorrelated::fUseModLarqlRecomb
private

from LArG4Parameters service

Definition at line 63 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fWion
private

W_ion (23.6 eV) == 1/fGeVToElectrons.

Definition at line 49 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fWph
private

from LArG4Parameters service

Definition at line 50 of file ISCalcCorrelated.h.


The documentation for this class was generated from the following files: