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::ISCalcSeparate Class Reference

#include <ISCalcSeparate.h>

Inheritance diagram for larg4::ISCalcSeparate:
larg4::ISCalc

Public Member Functions

 ISCalcSeparate ()
 
void Reset ()
 
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 CalcIon (detinfo::DetectorPropertiesData const &detProp, sim::SimEnergyDeposit const &edep)
 
std::pair< double, double > CalcScint (sim::SimEnergyDeposit const &edep)
 

Private Attributes

double fGeVToElectrons
 from LArG4Parameters 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...
 
bool fUseModBoxRecomb
 from LArG4Parameters service More...
 
const spacecharge::SpaceChargefSCE
 

Detailed Description

Definition at line 25 of file ISCalcSeparate.h.

Constructor & Destructor Documentation

larg4::ISCalcSeparate::ISCalcSeparate ( )

Definition at line 29 of file ISCalcSeparate.cxx.

30  {
31  fSCE = lar::providerFrom<spacecharge::SpaceChargeService>();
32 
33  // the recombination coefficient is in g/(MeVcm^2), but we report
34  // energy depositions in MeV/cm, need to divide Recombk from the
35  // LArG4Parameters service by the density of the argon we got
36  // above; this is done in 'CalcIon' function below.
37  art::ServiceHandle<sim::LArG4Parameters const> LArG4PropHandle;
38  fRecombA = LArG4PropHandle->RecombA();
39  fRecombk = LArG4PropHandle->Recombk();
40  fModBoxA = LArG4PropHandle->ModBoxA();
41  fModBoxB = LArG4PropHandle->ModBoxB();
42  fUseModBoxRecomb = (bool)LArG4PropHandle->UseModBoxRecomb();
43  fGeVToElectrons = LArG4PropHandle->GeVToElectrons();
44  }
double fModBoxA
from LArG4Parameters service
static constexpr bool
double fRecombk
from LArG4Parameters service
double fRecombA
from LArG4Parameters service
const spacecharge::SpaceCharge * fSCE
double fGeVToElectrons
from LArG4Parameters service
double fModBoxB
from LArG4Parameters service
bool fUseModBoxRecomb
from LArG4Parameters service

Member Function Documentation

double larg4::ISCalcSeparate::CalcIon ( detinfo::DetectorPropertiesData const &  detProp,
sim::SimEnergyDeposit const &  edep 
)
private

Definition at line 49 of file ISCalcSeparate.cxx.

51  {
52  float e = edep.Energy();
53  float ds = edep.StepLength();
54 
55  double recomb = 0.;
56  double dEdx = (ds <= 0.0) ? 0.0 : e / ds;
57  double EFieldStep = EFieldAtStep(detProp.Efield(), edep);
58 
59  // Guard against spurious values of dE/dx. Note: assumes density of LAr
60  if (dEdx < 1.) { dEdx = 1.; }
61 
62  if (fUseModBoxRecomb) {
63  if (ds > 0) {
64  double const scaled_modboxb = fModBoxB / detProp.Density(detProp.Temperature());
65  double const Xi = scaled_modboxb * dEdx / EFieldStep;
66  recomb = log(fModBoxA + Xi) / Xi;
67  }
68  else {
69  recomb = 0;
70  }
71  }
72  else {
73  double const scaled_recombk = fRecombk / detProp.Density(detProp.Temperature());
74  recomb = fRecombA / (1. + dEdx * scaled_recombk / EFieldStep);
75  }
76 
77  // 1.e-3 converts fEnergyDeposit to GeV
78  auto const numIonElectrons = fGeVToElectrons * 1.e-3 * e * recomb;
79 
80  MF_LOG_DEBUG("ISCalcSeparate")
81  << " Electrons produced for " << edep.Energy() << " MeV deposited with " << recomb
82  << " recombination: " << numIonElectrons << std::endl;
83  return numIonElectrons;
84  }
double fModBoxA
from LArG4Parameters service
double fRecombk
from LArG4Parameters service
double fRecombA
from LArG4Parameters service
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2687
double EFieldAtStep(double efield, sim::SimEnergyDeposit const &edep) override
double fGeVToElectrons
from LArG4Parameters service
do i e
double fModBoxB
from LArG4Parameters service
auto const detProp
bool fUseModBoxRecomb
from LArG4Parameters service
ISCalcData larg4::ISCalcSeparate::CalcIonAndScint ( detinfo::DetectorPropertiesData const &  detProp,
sim::SimEnergyDeposit const &  edep 
)
overridevirtual

Implements larg4::ISCalc.

Definition at line 96 of file ISCalcSeparate.cxx.

98  {
99  auto const numElectrons = CalcIon(detProp, edep);
100  auto const [numPhotons, scintYieldRatio] = CalcScint(edep);
101  return {edep.Energy(), numElectrons, numPhotons, scintYieldRatio};
102  }
std::pair< double, double > CalcScint(sim::SimEnergyDeposit const &edep)
double CalcIon(detinfo::DetectorPropertiesData const &detProp, sim::SimEnergyDeposit const &edep)
auto const detProp
std::pair< double, double > larg4::ISCalcSeparate::CalcScint ( sim::SimEnergyDeposit const &  edep)
private

Definition at line 88 of file ISCalcSeparate.cxx.

89  {
90  double numScintPhotons = GetScintYield(edep, true) * edep.Energy();
91  return {numScintPhotons, GetScintYieldRatio(edep)};
92  }
double GetScintYield(sim::SimEnergyDeposit const &edep, bool prescale)
Definition: ISCalc.cxx:26
double GetScintYieldRatio(sim::SimEnergyDeposit const &edep)
Definition: ISCalc.cxx:47
double larg4::ISCalcSeparate::EFieldAtStep ( double  efield,
sim::SimEnergyDeposit const &  edep 
)
overridevirtual

Implements larg4::ISCalc.

Definition at line 105 of file ISCalcSeparate.cxx.

106  {
107  if (not fSCE->EnableSimEfieldSCE()) { return efield; }
108 
109  auto const eFieldOffsets = fSCE->GetEfieldOffsets(edep.MidPoint());
110  return std::hypot(
111  efield + efield * eFieldOffsets.X(), efield * eFieldOffsets.Y(), efield * eFieldOffsets.Z());
112  }
virtual geo::Vector_t GetEfieldOffsets(geo::Point_t const &point) const =0
const spacecharge::SpaceCharge * fSCE
virtual bool EnableSimEfieldSCE() const =0
void larg4::ISCalcSeparate::Reset ( )

Member Data Documentation

double larg4::ISCalcSeparate::fGeVToElectrons
private

from LArG4Parameters service

Definition at line 37 of file ISCalcSeparate.h.

double larg4::ISCalcSeparate::fModBoxA
private

from LArG4Parameters service

Definition at line 40 of file ISCalcSeparate.h.

double larg4::ISCalcSeparate::fModBoxB
private

from LArG4Parameters service

Definition at line 41 of file ISCalcSeparate.h.

double larg4::ISCalcSeparate::fRecombA
private

from LArG4Parameters service

Definition at line 38 of file ISCalcSeparate.h.

double larg4::ISCalcSeparate::fRecombk
private

from LArG4Parameters service

Definition at line 39 of file ISCalcSeparate.h.

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

Definition at line 44 of file ISCalcSeparate.h.

bool larg4::ISCalcSeparate::fUseModBoxRecomb
private

from LArG4Parameters service

Definition at line 42 of file ISCalcSeparate.h.


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