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)
 
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
virtual ~ISCalc ()=default
 

Private Member Functions

void CalcIon (sim::SimEnergyDeposit const &edep)
 
void CalcScint (sim::SimEnergyDeposit const &edep)
 
double GetScintYieldRatio (sim::SimEnergyDeposit const &edep)
 
double EscapingEFraction (double const dEdx)
 
double FieldCorrection (double const EF, double const dEdx)
 

Private Attributes

double fGeVToElectrons
 from LArG4Parameters service More...
 
double fWion
 W_ion (23.6 eV) == 1/fGeVToElectrons. More...
 
double fWph
 W_ph (19.5 eV) 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...
 
const spacecharge::SpaceChargefSCE
 
const detinfo::LArPropertiesfLArProp
 
ISTPC fISTPC
 

Detailed Description

Definition at line 35 of file ISCalcCorrelated.h.

Constructor & Destructor Documentation

larg4::ISCalcCorrelated::ISCalcCorrelated ( detinfo::DetectorPropertiesData const &  detProp)

Definition at line 21 of file ISCalcCorrelated.cxx.

22  : fISTPC{*(lar::providerFrom<geo::Geometry>())}
23  {
24  std::cout << "IonizationAndScintillation/ISCalcCorrelated Initialize." << std::endl;
26 
27  fSCE = lar::providerFrom<spacecharge::SpaceChargeService>();
28  fLArProp = lar::providerFrom<detinfo::LArPropertiesService>();
29  fScintPreScale = fLArProp->ScintPreScale();
30 
31  //the recombination coefficient is in g/(MeVcm^2), but we report energy depositions in MeV/cm,
32  //need to divide Recombk from the LArG4Parameters service by the density of the argon we got above.
33  fRecombA = LArG4PropHandle->RecombA();
34  fRecombk = LArG4PropHandle->Recombk() / detProp.Density(detProp.Temperature());
35  fModBoxA = LArG4PropHandle->ModBoxA();
36  fModBoxB = LArG4PropHandle->ModBoxB() / detProp.Density(detProp.Temperature());
37  fUseModBoxRecomb = (bool)LArG4PropHandle->UseModBoxRecomb();
38  fUseModLarqlRecomb = (bool)LArG4PropHandle->UseModLarqlRecomb();
39  fLarqlChi0A = LArG4PropHandle->LarqlChi0A();
40  fLarqlChi0B = LArG4PropHandle->LarqlChi0B();
41  fLarqlChi0C = LArG4PropHandle->LarqlChi0C();
42  fLarqlChi0D = LArG4PropHandle->LarqlChi0D();
43  fLarqlAlpha = LArG4PropHandle->LarqlAlpha();
44  fLarqlBeta = LArG4PropHandle->LarqlBeta();
45  fGeVToElectrons = LArG4PropHandle->GeVToElectrons();
46 
47  // ionization work function
48  fWion = 1. / fGeVToElectrons * 1e3; // MeV
49 
50  // ion+excitation work function (\todo: get from LArG4Parameters or LArProperties?)
51  fWph = 19.5 * 1e-6; // MeV
52  }
double fModBoxA
from LArG4Parameters service
double ModBoxA() const
double fRecombk
from LArG4Parameters service
double fWion
W_ion (23.6 eV) == 1/fGeVToElectrons.
double fGeVToElectrons
from LArG4Parameters service
double LarqlChi0B() const
double fModBoxB
from LArG4Parameters service
bool fUseModLarqlRecomb
from LArG4Parameters service
double LarqlBeta() const
double LarqlAlpha() const
bool UseModBoxRecomb() const
double LarqlChi0D() const
double fScintPreScale
scintillation pre-scaling factor from LArProperties service
double LarqlChi0C() const
double fWph
W_ph (19.5 eV)
const double e
bool UseModLarqlRecomb() const
double fLarqlChi0B
from LArG4Parameters service
double fLarqlChi0D
from LArG4Parameters service
bool fUseModBoxRecomb
from LArG4Parameters service
double RecombA() const
double fLarqlChi0C
from LArG4Parameters service
double LarqlChi0A() const
double fLarqlChi0A
from LArG4Parameters service
double ModBoxB() const
double Recombk() const
double fLarqlBeta
from LArG4Parameters service
double fLarqlAlpha
from LArG4Parameters service
const detinfo::LArProperties * fLArProp
const spacecharge::SpaceCharge * fSCE
double fRecombA
from LArG4Parameters service
int bool
Definition: qglobal.h:345
double GeVToElectrons() const
QTextStream & endl(QTextStream &s)

Member Function Documentation

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

Implements larg4::ISCalc.

Definition at line 56 of file ISCalcCorrelated.cxx.

58  {
59  double const energy_deposit = edep.Energy();
60 
61  // calculate total quanta (ions + excitons)
62  double Nq = energy_deposit / fWph;
63 
64  float ds = edep.StepLength();
65  double dEdx = (ds <= 0.0) ? 0.0 : energy_deposit / ds;
66  double EFieldStep = EFieldAtStep(detProp.Efield(), edep);
67  double recomb = 0.;
68 
69  //calculate recombination survival fraction value inside, otherwise zero
70 
71  if(EFieldStep > 0) {
72  // Guard against spurious values of dE/dx. Note: assumes density of LAr
73  if (dEdx < 1.) dEdx = 1.;
74 
75  // calculate recombination survival fraction
76  if (fUseModBoxRecomb) {
77  if (ds > 0) {
78  double Xi = fModBoxB * dEdx / EFieldStep;
79  recomb = log(fModBoxA + Xi) / Xi;
80  }
81  else {
82  recomb = 0;
83  }
84  }
85  else {
86  recomb = fRecombA / (1. + dEdx * fRecombk / EFieldStep);
87  }
88 
89  }//Efield
90 
91  if(fUseModLarqlRecomb){ //Use corrections from LArQL model
92  recomb += EscapingEFraction(dEdx)*FieldCorrection(EFieldStep, dEdx); //Correction for low EF
93  }
94 
95 
96 
97 
98  // using this recombination, calculate number of ionization electrons
99  double const num_electrons = (energy_deposit / fWion) * recomb;
100 
101  // calculate scintillation photons
102  double const num_photons = (Nq - num_electrons) * fScintPreScale;
103 
104  MF_LOG_DEBUG("ISCalcCorrelated")
105  << " Electrons produced for " << energy_deposit << " MeV deposited with " << recomb
106  << " recombination: " << num_electrons << std::endl;
107  MF_LOG_DEBUG("ISCalcCorrelated") << "number photons: " << num_photons;
108 
109  return {energy_deposit, num_electrons, num_photons, GetScintYieldRatio(edep)};
110  }
double fModBoxA
from LArG4Parameters service
double fRecombk
from LArG4Parameters service
double fWion
W_ion (23.6 eV) == 1/fGeVToElectrons.
double fModBoxB
from LArG4Parameters service
bool fUseModLarqlRecomb
from LArG4Parameters service
double EscapingEFraction(double const dEdx)
double fScintPreScale
scintillation pre-scaling factor from LArProperties service
double EFieldAtStep(double efield, sim::SimEnergyDeposit const &edep) override
double fWph
W_ph (19.5 eV)
double dEdx(float dqdx, float Efield)
Definition: doAna.cpp:21
bool fUseModBoxRecomb
from LArG4Parameters service
#define MF_LOG_DEBUG(id)
double GetScintYieldRatio(sim::SimEnergyDeposit const &edep)
double fRecombA
from LArG4Parameters service
QTextStream & endl(QTextStream &s)
double FieldCorrection(double const EF, double const dEdx)
void larg4::ISCalcCorrelated::CalcScint ( sim::SimEnergyDeposit const &  edep)
private
double larg4::ISCalcCorrelated::EFieldAtStep ( double  efield,
sim::SimEnergyDeposit const &  edep 
)
overridevirtual

Implements larg4::ISCalc.

Definition at line 143 of file ISCalcCorrelated.cxx.

144  {
145  //electric field outside active volume set to zero
146  if(!fISTPC.isScintInActiveVolume(edep.MidPoint())) return 0;
147 
148  //electric field inside active volume
149  if (!fSCE->EnableSimEfieldSCE()) return efield;
150 
151  auto const eFieldOffsets = fSCE->GetEfieldOffsets(edep.MidPoint());
152  return efield * std::hypot(1 + eFieldOffsets.X(), eFieldOffsets.Y(), eFieldOffsets.Z());
153  }
virtual bool EnableSimEfieldSCE() const =0
std::enable_if_t< std::is_arithmetic_v< T >, T > hypot(T x, T y)
Definition: hypot.h:60
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:41
double larg4::ISCalcCorrelated::EscapingEFraction ( double const  dEdx)
private

Definition at line 157 of file ISCalcCorrelated.cxx.

157  { //LArQL chi0 function = fraction of escaping electrons
159  }
double dEdx(float dqdx, float Efield)
Definition: doAna.cpp:21
double fLarqlChi0B
from LArG4Parameters service
double fLarqlChi0D
from LArG4Parameters service
double fLarqlChi0C
from LArG4Parameters service
double fLarqlChi0A
from LArG4Parameters service
double larg4::ISCalcCorrelated::FieldCorrection ( double const  EF,
double const  dEdx 
)
private

Definition at line 161 of file ISCalcCorrelated.cxx.

161  { //LArQL f_corr function = correction factor for electric field dependence
162  return exp(-EF/(fLarqlAlpha*log(dEdx)+fLarqlBeta));
163  }
double dEdx(float dqdx, float Efield)
Definition: doAna.cpp:21
double fLarqlBeta
from LArG4Parameters service
double fLarqlAlpha
from LArG4Parameters service
double larg4::ISCalcCorrelated::GetScintYieldRatio ( sim::SimEnergyDeposit const &  edep)
private

Definition at line 114 of file ISCalcCorrelated.cxx.

115  {
116  // For ISCalcCorrelated, the ScintByParticleType option only controls
117  // the scintillation yield ratio, which is the ratio of fast light (singlet
118  // component) to the total light (singlet+triplet components).
119  //
120  // TODO: move this to ISCalc, since it is the same function used in the
121  // other ionization/scintillation calculation algs
122 
124 
125  switch (edep.PdgCode()) {
126  case 2212: return fLArProp->ProtonScintYieldRatio();
127  case 13:
128  case -13: return fLArProp->MuonScintYieldRatio();
129  case 211:
130  case -211: return fLArProp->PionScintYieldRatio();
131  case 321:
132  case -321: return fLArProp->KaonScintYieldRatio();
133  case 1000020040: return fLArProp->AlphaScintYieldRatio();
134  case 11:
135  case -11:
136  case 22: return fLArProp->ElectronScintYieldRatio();
137  default: return fLArProp->ElectronScintYieldRatio();
138  }
139  }
virtual double ElectronScintYieldRatio() const =0
virtual double ScintYieldRatio() const =0
virtual double AlphaScintYieldRatio() const =0
virtual double ProtonScintYieldRatio() const =0
virtual double PionScintYieldRatio() const =0
virtual double MuonScintYieldRatio() const =0
const detinfo::LArProperties * fLArProp
virtual double KaonScintYieldRatio() const =0
virtual bool ScintByParticleType() const =0

Member Data Documentation

double larg4::ISCalcCorrelated::fGeVToElectrons
private

from LArG4Parameters service

Definition at line 46 of file ISCalcCorrelated.h.

ISTPC larg4::ISCalcCorrelated::fISTPC
private

Definition at line 71 of file ISCalcCorrelated.h.

const detinfo::LArProperties* larg4::ISCalcCorrelated::fLArProp
private

Definition at line 64 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fLarqlAlpha
private

from LArG4Parameters service

Definition at line 58 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fLarqlBeta
private

from LArG4Parameters service

Definition at line 59 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fLarqlChi0A
private

from LArG4Parameters service

Definition at line 54 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fLarqlChi0B
private

from LArG4Parameters service

Definition at line 55 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fLarqlChi0C
private

from LArG4Parameters service

Definition at line 56 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fLarqlChi0D
private

from LArG4Parameters service

Definition at line 57 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fModBoxA
private

from LArG4Parameters service

Definition at line 52 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fModBoxB
private

from LArG4Parameters service

Definition at line 53 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fRecombA
private

from LArG4Parameters service

Definition at line 50 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fRecombk
private

from LArG4Parameters service

Definition at line 51 of file ISCalcCorrelated.h.

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

Definition at line 63 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fScintPreScale
private

scintillation pre-scaling factor from LArProperties service

Definition at line 49 of file ISCalcCorrelated.h.

bool larg4::ISCalcCorrelated::fUseModBoxRecomb
private

from LArG4Parameters service

Definition at line 60 of file ISCalcCorrelated.h.

bool larg4::ISCalcCorrelated::fUseModLarqlRecomb
private

from LArG4Parameters service

Definition at line 61 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fWion
private

W_ion (23.6 eV) == 1/fGeVToElectrons.

Definition at line 47 of file ISCalcCorrelated.h.

double larg4::ISCalcCorrelated::fWph
private

W_ph (19.5 eV)

Definition at line 48 of file ISCalcCorrelated.h.


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