LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
larg4::ISCalculationCorrelated Class Reference

#include "ISCalculationCorrelated.h"

Inheritance diagram for larg4::ISCalculationCorrelated:
larg4::ISCalculation

Public Member Functions

 ISCalculationCorrelated (detinfo::DetectorPropertiesData const &detProp)
 
void Reset ()
 
void CalculateIonizationAndScintillation (const G4Step *step)
 
double StepSizeLimit () const
 
double EnergyDeposit () const
 
double NumberIonizationElectrons () const
 
double NumberScintillationPhotons () const
 
double VisibleEnergyDeposit () const
 
double EFieldAtStep (double fEfield, const G4Step *step) const
 

Protected Attributes

double fEnergyDeposit
 total energy deposited in the step More...
 
double fNumIonElectrons
 number of ionization electrons for this step More...
 
double fNumScintPhotons
 number of scintillation photons for this step More...
 
double fVisibleEnergyDeposition
 

Private Member Functions

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

Private Attributes

double fStepSize
 maximum step to take More...
 
double fEfield
 value of electric field from LArProperties service More...
 
double fWion
 W_ion (23.6 eV) == 1/fGeVToElectrons. More...
 
double fWph
 W_ph (19.5 eV) More...
 
double fScintPreScale
 scintillation pre-scale 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...
 
double fEllipsModBoxA
 from LArG4Parameters service More...
 
double fEllipsModBoxB
 from LArG4Parameters service More...
 
double fEllipsModBoxR
 from LArG4Parameters service More...
 
bool fUseEllipsModBoxRecomb
 from LArG4Parameters service More...
 
bool fUseModBoxRecomb
 from LArG4Parameters service More...
 
bool fUseModLarqlRecomb
 from LArG4Parameters service More...
 

Detailed Description

Definition at line 30 of file ISCalculationCorrelated.h.

Constructor & Destructor Documentation

larg4::ISCalculationCorrelated::ISCalculationCorrelated ( detinfo::DetectorPropertiesData const &  detProp)
explicit

Definition at line 39 of file ISCalculationCorrelated.cxx.

References detinfo::DetectorPropertiesData::Density(), e, detinfo::DetectorPropertiesData::Efield(), sim::LArG4Parameters::EllipsModBoxA(), sim::LArG4Parameters::EllipsModBoxB(), sim::LArG4Parameters::EllipsModBoxR(), fEfield, fEllipsModBoxA, fEllipsModBoxB, fEllipsModBoxR, fLarqlAlpha, fLarqlBeta, fLarqlChi0A, fLarqlChi0B, fLarqlChi0C, fLarqlChi0D, fModBoxA, fModBoxB, fRecombA, fRecombk, fScintPreScale, fStepSize, fUseEllipsModBoxRecomb, fUseModBoxRecomb, fUseModLarqlRecomb, fWion, fWph, sim::LArG4Parameters::GeVToElectrons(), sim::LArG4Parameters::LarqlAlpha(), sim::LArG4Parameters::LarqlBeta(), sim::LArG4Parameters::LarqlChi0A(), sim::LArG4Parameters::LarqlChi0B(), sim::LArG4Parameters::LarqlChi0C(), sim::LArG4Parameters::LarqlChi0D(), sim::LArG4Parameters::ModBoxA(), sim::LArG4Parameters::ModBoxB(), sim::LArG4Parameters::RecombA(), sim::LArG4Parameters::Recombk(), detinfo::LArProperties::ScintPreScale(), detinfo::DetectorPropertiesData::Temperature(), sim::LArG4Parameters::UseEllipsModBoxRecomb(), sim::LArG4Parameters::UseModBoxRecomb(), sim::LArG4Parameters::UseModLarqlRecomb(), sim::LArVoxelCalculator::VoxelSizeX(), sim::LArVoxelCalculator::VoxelSizeY(), and sim::LArVoxelCalculator::VoxelSizeZ().

40  {
41  std::cout << "LegacyLArG4/ISCalculationCorrelated Initialize." << std::endl;
43  const detinfo::LArProperties* larp = lar::providerFrom<detinfo::LArPropertiesService>();
44 
45  double density = detProp.Density(detProp.Temperature());
46  fEfield = detProp.Efield();
47  fScintPreScale = larp->ScintPreScale();
48 
49  // ionization work function
50  fWion = 1. / lgpHandle->GeVToElectrons() * 1e3; // MeV
51 
52  // ion+excitation work function (\todo: get from LArG4Parameters or LArProperties?)
53  fWph = 19.5 * 1e-6; // MeV
54 
55  // the recombination coefficient is in g/(MeVcm^2), but
56  // we report energy depositions in MeV/cm, need to divide
57  // Recombk from the LArG4Parameters service by the density
58  // of the argon we got above.
59  fRecombA = lgpHandle->RecombA();
60  fRecombk = lgpHandle->Recombk() / density;
61  fModBoxA = lgpHandle->ModBoxA();
62  fModBoxB = lgpHandle->ModBoxB() / density;
63  fEllipsModBoxA = lgpHandle->EllipsModBoxA();
64  fEllipsModBoxB = lgpHandle->EllipsModBoxB() / detProp.Density(detProp.Temperature());
65  fEllipsModBoxR = lgpHandle->EllipsModBoxR();
66  fLarqlChi0A = lgpHandle->LarqlChi0A();
67  fLarqlChi0B = lgpHandle->LarqlChi0B();
68  fLarqlChi0C = lgpHandle->LarqlChi0C();
69  fLarqlChi0D = lgpHandle->LarqlChi0D();
70  fLarqlAlpha = lgpHandle->LarqlAlpha();
71  fLarqlBeta = lgpHandle->LarqlBeta();
72  fUseModBoxRecomb = lgpHandle->UseModBoxRecomb();
73  fUseEllipsModBoxRecomb = (bool)lgpHandle->UseEllipsModBoxRecomb();
74 
76 
77  // determine the step size using the voxel sizes
79  double maxsize =
80  std::max(lvc->VoxelSizeX(), std::max(lvc->VoxelSizeY(), lvc->VoxelSizeZ())) * CLHEP::cm;
81 
82  fStepSize = 0.1 * maxsize;
83  }
double fWion
W_ion (23.6 eV) == 1/fGeVToElectrons.
double VoxelSizeX() const
Access to voxel dimensions and offsets.
double ModBoxA() const
double fModBoxA
from LArG4Parameters service
double fLarqlChi0D
from LArG4Parameters service
double fLarqlChi0B
from LArG4Parameters service
double LarqlChi0B() const
double LarqlBeta() const
double LarqlAlpha() const
double fEllipsModBoxR
from LArG4Parameters service
bool UseModBoxRecomb() const
double fLarqlAlpha
from LArG4Parameters service
double LarqlChi0D() const
bool fUseModLarqlRecomb
from LArG4Parameters service
double EllipsModBoxA() const
double EllipsModBoxR() const
double LarqlChi0C() const
bool fUseEllipsModBoxRecomb
from LArG4Parameters service
double fLarqlChi0C
from LArG4Parameters service
bool UseModLarqlRecomb() const
bool fUseModBoxRecomb
from LArG4Parameters service
virtual double ScintPreScale(bool prescale=true) const =0
double RecombA() const
double LarqlChi0A() const
double fEllipsModBoxB
from LArG4Parameters service
double fStepSize
maximum step to take
double fScintPreScale
scintillation pre-scale from LArProperties service
double EllipsModBoxB() const
double ModBoxB() const
double Recombk() const
double fEllipsModBoxA
from LArG4Parameters service
bool UseEllipsModBoxRecomb() const
double fRecombA
from LArG4Parameters service
double fLarqlChi0A
from LArG4Parameters service
Float_t e
Definition: plot.C:35
double fRecombk
from LArG4Parameters service
double fEfield
value of electric field from LArProperties service
double GeVToElectrons() const
double fModBoxB
from LArG4Parameters service
double fLarqlBeta
from LArG4Parameters service

Member Function Documentation

void larg4::ISCalculationCorrelated::CalculateIonizationAndScintillation ( const G4Step *  step)
virtual

Implements larg4::ISCalculation.

Definition at line 98 of file ISCalculationCorrelated.cxx.

References util::abs(), tca::dEdx(), larg4::ISCalculation::EFieldAtStep(), EscapingEFraction(), fEfield, fEllipsModBoxA, fEllipsModBoxB, fEllipsModBoxR, larg4::ISCalculation::fEnergyDeposit, FieldCorrection(), fModBoxA, fModBoxB, larg4::ISCalculation::fNumIonElectrons, larg4::ISCalculation::fNumScintPhotons, fRecombA, fRecombk, fScintPreScale, fUseEllipsModBoxRecomb, fUseModBoxRecomb, fUseModLarqlRecomb, fWion, fWph, and MF_LOG_DEBUG.

99  {
100  fEnergyDeposit = step->GetTotalEnergyDeposit() / CLHEP::MeV;
101 
102  // calculate total quanta (ions + excitons)
103  double Nq = fEnergyDeposit / fWph;
104 
105  // Get the recombination factor for this voxel - Nucl.Instrum.Meth.A523:275-286,2004
106  // R = A/(1 + (dE/dx)*k)
107  // dE/dx is given by the voxel energy deposition, but have to convert it to MeV/cm
108  // from GeV/voxel width
109  // A = 0.800 +/- 0.003
110  // k = (0.097+/-0.001) g/(MeVcm^2)
111  // the dx depends on the trajectory of the step
112  // k should be divided by the density as our dE/dx is in MeV/cm,
113  // the division is handled in the constructor when we set fRecombk
114  // B.Baller: Add Modified Box recombination - ArgoNeuT result submitted to JINST
115 
116  G4ThreeVector totstep = step->GetPostStepPoint()->GetPosition();
117  totstep -= step->GetPreStepPoint()->GetPosition();
118  double dx = totstep.mag() / CLHEP::cm;
119  double dEdx = (dx == 0.0) ? 0.0 : fEnergyDeposit / dx;
120  double EFieldStep = EFieldAtStep(fEfield, step);
121 
122  // Guard against spurious values of dE/dx. Note: assumes density of LAr
123  if (dEdx < 1.) dEdx = 1.;
124 
125  // calculate the recombination survival fraction
126  double recomb = 0.;
127  if (fUseModBoxRecomb) {
128  if (dx) {
129  double Xi = fModBoxB * dEdx / EFieldStep;
130  recomb = log(fModBoxA + Xi) / Xi;
131  }
132  else
133  recomb = 0;
134  }
135  else if (fUseEllipsModBoxRecomb) {
136 
137  double phi = std::acos(abs(step->GetPreStepPoint()->GetPosition().x() -
138  step->GetPostStepPoint()->GetPosition().x()) /
139  step->GetStepLength());
140 
141  if (phi > std::atan(1) * 2) { phi = std::atan(1) * 4 - phi; }
142 
143  if (phi != phi) {
144  double Xi = fModBoxB * dEdx / EFieldStep;
145  recomb = std::log(fModBoxA + Xi) / Xi;
146  }
147  else {
148  double B_ellips = fEllipsModBoxB * dEdx /
149  (EFieldStep * std::hypot(std::sin(phi), std::cos(phi) / fEllipsModBoxR));
150 
151  recomb = std::log(fEllipsModBoxA + B_ellips) / B_ellips;
152  }
153  }
154  else {
155  recomb = fRecombA / (1. + dEdx * fRecombk / EFieldStep);
156  }
157 
158  if (fUseModLarqlRecomb) { //Use corrections from LArQL model
159  recomb += EscapingEFraction(dEdx) * FieldCorrection(EFieldStep, dEdx); //Correction for low EF
160  }
161 
162  // using this recombination, calculate number of ionization electrons
163  fNumIonElectrons = (fEnergyDeposit / fWion) * recomb;
164 
165  // calculate scintillation photons
167 
168  // apply the scintillation pre-scaling (normally this is already folded into
169  // the particle-specific scintillation yields)
171 
172  MF_LOG_DEBUG("ISCalculationCorrelated")
173  << " Electrons produced for " << fEnergyDeposit << " MeV deposited with " << recomb
174  << " recombination: " << fNumIonElectrons;
175  MF_LOG_DEBUG("ISCalculationCorrelated") << "number photons: " << fNumScintPhotons;
176 
177  return;
178  }
double fWion
W_ion (23.6 eV) == 1/fGeVToElectrons.
double fModBoxA
from LArG4Parameters service
double EFieldAtStep(double fEfield, const G4Step *step) const
double fEllipsModBoxR
from LArG4Parameters service
constexpr auto abs(T v)
Returns the absolute value of the argument.
bool fUseModLarqlRecomb
from LArG4Parameters service
bool fUseEllipsModBoxRecomb
from LArG4Parameters service
double fNumIonElectrons
number of ionization electrons for this step
Definition: ISCalculation.h:33
bool fUseModBoxRecomb
from LArG4Parameters service
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2675
double fEllipsModBoxB
from LArG4Parameters service
double fScintPreScale
scintillation pre-scale from LArProperties service
double EscapingEFraction(double const dEdx)
double fEllipsModBoxA
from LArG4Parameters service
#define MF_LOG_DEBUG(id)
double fNumScintPhotons
number of scintillation photons for this step
Definition: ISCalculation.h:34
double fRecombA
from LArG4Parameters service
double fEnergyDeposit
total energy deposited in the step
Definition: ISCalculation.h:32
double fRecombk
from LArG4Parameters service
double FieldCorrection(double const EF, double const dEdx)
double fEfield
value of electric field from LArProperties service
double fModBoxB
from LArG4Parameters service
double larg4::ISCalculation::EFieldAtStep ( double  fEfield,
const G4Step *  step 
) const
inherited

Definition at line 18 of file ISCalculation.cxx.

Referenced by larg4::ISCalculationSeparate::CalculateIonizationAndScintillation(), CalculateIonizationAndScintillation(), and larg4::ISCalculation::VisibleEnergyDeposit().

19  {
20  auto const* SCE = lar::providerFrom<spacecharge::SpaceChargeService>();
21  if (!SCE->EnableSimEfieldSCE()) return efield;
22  geo::Point_t midPoint{
23  (step->GetPreStepPoint()->GetPosition() + step->GetPostStepPoint()->GetPosition()) * 0.5 /
24  CLHEP::cm};
25  auto const eFieldOffsets = SCE->GetEfieldOffsets(midPoint);
26  return efield * std::hypot(1 + eFieldOffsets.X(), eFieldOffsets.Y(), eFieldOffsets.Z());
27  }
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:180
double larg4::ISCalculation::EnergyDeposit ( ) const
inlineinherited

Definition at line 22 of file ISCalculation.h.

References larg4::ISCalculation::fEnergyDeposit.

22 { return fEnergyDeposit; }
double fEnergyDeposit
total energy deposited in the step
Definition: ISCalculation.h:32
double larg4::ISCalculationCorrelated::EscapingEFraction ( double const  dEdx)
private

Definition at line 180 of file ISCalculationCorrelated.cxx.

References fLarqlChi0A, fLarqlChi0B, fLarqlChi0C, and fLarqlChi0D.

Referenced by CalculateIonizationAndScintillation().

181  { //LArQL chi0 function = fraction of escaping electrons
182  return fLarqlChi0A / (fLarqlChi0B + exp(fLarqlChi0C + fLarqlChi0D * dEdx));
183  }
double fLarqlChi0D
from LArG4Parameters service
double fLarqlChi0B
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:2675
double fLarqlChi0A
from LArG4Parameters service
double larg4::ISCalculationCorrelated::FieldCorrection ( double const  EF,
double const  dEdx 
)
private

Definition at line 185 of file ISCalculationCorrelated.cxx.

References fLarqlAlpha, and fLarqlBeta.

Referenced by CalculateIonizationAndScintillation().

186  { //LArQL f_corr function = correction factor for electric field dependence
187  return exp(-EF / (fLarqlAlpha * log(dEdx) + fLarqlBeta));
188  }
double fLarqlAlpha
from LArG4Parameters service
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2675
double fLarqlBeta
from LArG4Parameters service
double larg4::ISCalculation::NumberIonizationElectrons ( ) const
inlineinherited

Definition at line 23 of file ISCalculation.h.

References larg4::ISCalculation::fNumIonElectrons.

23 { return fNumIonElectrons; }
double fNumIonElectrons
number of ionization electrons for this step
Definition: ISCalculation.h:33
double larg4::ISCalculation::NumberScintillationPhotons ( ) const
inlineinherited

Definition at line 24 of file ISCalculation.h.

References larg4::ISCalculation::fNumScintPhotons.

24 { return fNumScintPhotons; }
double fNumScintPhotons
number of scintillation photons for this step
Definition: ISCalculation.h:34
void larg4::ISCalculationCorrelated::Reset ( )
virtual

Implements larg4::ISCalculation.

Definition at line 87 of file ISCalculationCorrelated.cxx.

References larg4::ISCalculation::fEnergyDeposit, larg4::ISCalculation::fNumIonElectrons, and larg4::ISCalculation::fNumScintPhotons.

88  {
89  fEnergyDeposit = 0.;
90  fNumScintPhotons = 0.;
91  fNumIonElectrons = 0.;
92 
93  return;
94  }
double fNumIonElectrons
number of ionization electrons for this step
Definition: ISCalculation.h:33
double fNumScintPhotons
number of scintillation photons for this step
Definition: ISCalculation.h:34
double fEnergyDeposit
total energy deposited in the step
Definition: ISCalculation.h:32
double larg4::ISCalculationCorrelated::StepSizeLimit ( ) const
inlinevirtual

Implements larg4::ISCalculation.

Definition at line 36 of file ISCalculationCorrelated.h.

36 { return fStepSize; }
double fStepSize
maximum step to take
double larg4::ISCalculation::VisibleEnergyDeposit ( ) const
inlineinherited

Member Data Documentation

double larg4::ISCalculationCorrelated::fEfield
private

value of electric field from LArProperties service

Definition at line 40 of file ISCalculationCorrelated.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fEllipsModBoxA
private

from LArG4Parameters service

Definition at line 54 of file ISCalculationCorrelated.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fEllipsModBoxB
private

from LArG4Parameters service

Definition at line 55 of file ISCalculationCorrelated.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fEllipsModBoxR
private

from LArG4Parameters service

Definition at line 56 of file ISCalculationCorrelated.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fLarqlAlpha
private

from LArG4Parameters service

Definition at line 52 of file ISCalculationCorrelated.h.

Referenced by FieldCorrection(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fLarqlBeta
private

from LArG4Parameters service

Definition at line 53 of file ISCalculationCorrelated.h.

Referenced by FieldCorrection(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fLarqlChi0A
private

from LArG4Parameters service

Definition at line 48 of file ISCalculationCorrelated.h.

Referenced by EscapingEFraction(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fLarqlChi0B
private

from LArG4Parameters service

Definition at line 49 of file ISCalculationCorrelated.h.

Referenced by EscapingEFraction(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fLarqlChi0C
private

from LArG4Parameters service

Definition at line 50 of file ISCalculationCorrelated.h.

Referenced by EscapingEFraction(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fLarqlChi0D
private

from LArG4Parameters service

Definition at line 51 of file ISCalculationCorrelated.h.

Referenced by EscapingEFraction(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fModBoxA
private

from LArG4Parameters service

Definition at line 46 of file ISCalculationCorrelated.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fModBoxB
private

from LArG4Parameters service

Definition at line 47 of file ISCalculationCorrelated.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fRecombA
private

from LArG4Parameters service

Definition at line 44 of file ISCalculationCorrelated.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fRecombk
private

from LArG4Parameters service

Definition at line 45 of file ISCalculationCorrelated.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fScintPreScale
private

scintillation pre-scale from LArProperties service

Definition at line 43 of file ISCalculationCorrelated.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fStepSize
private

maximum step to take

Definition at line 39 of file ISCalculationCorrelated.h.

Referenced by ISCalculationCorrelated().

bool larg4::ISCalculationCorrelated::fUseEllipsModBoxRecomb
private

from LArG4Parameters service

Definition at line 57 of file ISCalculationCorrelated.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationCorrelated().

bool larg4::ISCalculationCorrelated::fUseModBoxRecomb
private

from LArG4Parameters service

Definition at line 58 of file ISCalculationCorrelated.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationCorrelated().

bool larg4::ISCalculationCorrelated::fUseModLarqlRecomb
private

from LArG4Parameters service

Definition at line 59 of file ISCalculationCorrelated.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fWion
private

W_ion (23.6 eV) == 1/fGeVToElectrons.

Definition at line 41 of file ISCalculationCorrelated.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationCorrelated().

double larg4::ISCalculationCorrelated::fWph
private

W_ph (19.5 eV)

Definition at line 42 of file ISCalculationCorrelated.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationCorrelated().


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