LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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
 
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.

References fGeVToElectrons, fModBoxA, fModBoxB, fRecombA, fRecombk, fSCE, and fUseModBoxRecomb.

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.
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
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 48 of file ISCalcSeparate.cxx.

References tca::dEdx(), detinfo::DetectorPropertiesData::Density(), e, edep, detinfo::DetectorPropertiesData::Efield(), EFieldAtStep(), sim::SimEnergyDeposit::Energy(), fGeVToElectrons, fModBoxA, fModBoxB, fRecombA, fRecombk, fUseModBoxRecomb, MF_LOG_DEBUG, sim::SimEnergyDeposit::StepLength(), and detinfo::DetectorPropertiesData::Temperature().

Referenced by CalcIonAndScint().

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

Implements larg4::ISCalc.

Definition at line 93 of file ISCalcSeparate.cxx.

References CalcIon(), CalcScint(), and sim::SimEnergyDeposit::Energy().

Referenced by spacecharge::ShiftEdepSCE::produce(), and phot::PhotonLibraryPropagation::produce().

95  {
96  auto const numElectrons = CalcIon(detProp, edep);
97  auto const [numPhotons, scintYieldRatio] = CalcScint(edep);
98  return {edep.Energy(), numElectrons, numPhotons, scintYieldRatio};
99  }
std::pair< double, double > CalcScint(sim::SimEnergyDeposit const &edep)
double CalcIon(detinfo::DetectorPropertiesData const &detProp, sim::SimEnergyDeposit const &edep)
Double_t edep
Definition: macro.C:13
std::pair< double, double > larg4::ISCalcSeparate::CalcScint ( sim::SimEnergyDeposit const &  edep)
private

Definition at line 86 of file ISCalcSeparate.cxx.

References sim::SimEnergyDeposit::Energy(), larg4::ISCalc::GetScintYield(), and larg4::ISCalc::GetScintYieldRatio().

Referenced by CalcIonAndScint().

87  {
88  double numScintPhotons = GetScintYield(edep, true) * edep.Energy();
89  return {numScintPhotons, GetScintYieldRatio(edep)};
90  }
Double_t edep
Definition: macro.C:13
double GetScintYield(sim::SimEnergyDeposit const &edep, bool prescale)
Definition: ISCalc.cxx:21
double GetScintYieldRatio(sim::SimEnergyDeposit const &edep)
Definition: ISCalc.cxx:41
double larg4::ISCalcSeparate::EFieldAtStep ( double  efield,
sim::SimEnergyDeposit const &  edep 
)
overridevirtual

Implements larg4::ISCalc.

Definition at line 101 of file ISCalcSeparate.cxx.

References spacecharge::SpaceCharge::EnableSimEfieldSCE(), fSCE, spacecharge::SpaceCharge::GetEfieldOffsets(), and sim::SimEnergyDeposit::MidPoint().

Referenced by CalcIon().

102  {
103  if (not fSCE->EnableSimEfieldSCE()) { return efield; }
104 
105  auto const eFieldOffsets = fSCE->GetEfieldOffsets(edep.MidPoint());
106  return std::hypot(
107  efield + efield * eFieldOffsets.X(), efield * eFieldOffsets.Y(), efield * eFieldOffsets.Z());
108  }
virtual bool EnableSimEfieldSCE() const =0
Double_t edep
Definition: macro.C:13
virtual geo::Vector_t GetEfieldOffsets(geo::Point_t const &point) const =0
const spacecharge::SpaceCharge * fSCE
double larg4::ISCalc::GetScintYield ( sim::SimEnergyDeposit const &  edep,
bool  prescale 
)
inherited

Definition at line 21 of file ISCalc.cxx.

References detinfo::LArProperties::AlphaScintYield(), detinfo::LArProperties::ElectronScintYield(), larg4::ISCalc::fLArProp, detinfo::LArProperties::KaonScintYield(), detinfo::LArProperties::MuonScintYield(), sim::SimEnergyDeposit::PdgCode(), detinfo::LArProperties::PionScintYield(), detinfo::LArProperties::ProtonScintYield(), detinfo::LArProperties::ScintByParticleType(), and detinfo::LArProperties::ScintYield().

Referenced by CalcScint().

22  {
23  if (!fLArProp->ScintByParticleType()) return fLArProp->ScintYield(true);
24  switch (edep.PdgCode()) {
25  case 2212: return fLArProp->ProtonScintYield(true);
26  case 13:
27  case -13: return fLArProp->MuonScintYield(true);
28  case 211:
29  case -211: return fLArProp->PionScintYield(true);
30  case 321:
31  case -321: return fLArProp->KaonScintYield(true);
32  case 1000020040: return fLArProp->AlphaScintYield(true);
33  case 11:
34  case -11:
35  case 22: return fLArProp->ElectronScintYield(true);
36  default: return fLArProp->ElectronScintYield(true);
37  }
38  }
virtual double AlphaScintYield(bool prescale=false) const =0
virtual double ProtonScintYield(bool prescale=false) const =0
const detinfo::LArProperties * fLArProp
Definition: ISCalc.h:33
virtual double ElectronScintYield(bool prescale=false) const =0
virtual double PionScintYield(bool prescale=false) const =0
Double_t edep
Definition: macro.C:13
virtual double MuonScintYield(bool prescale=false) const =0
virtual double KaonScintYield(bool prescale=false) const =0
virtual double ScintYield(bool prescale=false) const =0
virtual bool ScintByParticleType() const =0
double larg4::ISCalc::GetScintYieldRatio ( sim::SimEnergyDeposit const &  edep)
inherited

Definition at line 41 of file ISCalc.cxx.

References detinfo::LArProperties::AlphaScintYieldRatio(), detinfo::LArProperties::ElectronScintYieldRatio(), larg4::ISCalc::fLArProp, detinfo::LArProperties::KaonScintYieldRatio(), detinfo::LArProperties::MuonScintYieldRatio(), sim::SimEnergyDeposit::PdgCode(), detinfo::LArProperties::PionScintYieldRatio(), detinfo::LArProperties::ProtonScintYieldRatio(), detinfo::LArProperties::ScintByParticleType(), and detinfo::LArProperties::ScintYieldRatio().

Referenced by larg4::ISCalcNESTLAr::CalcIonAndScint(), larg4::ISCalcCorrelated::CalcIonAndScint(), and CalcScint().

42  {
43  // ScintByParticleType option only controls the scintillation
44  // yield ratio, which is the ratio of fast light (singlet
45  // component) to the total light (singlet+triplet components).
46 
48 
49  switch (edep.PdgCode()) {
50  case 2212: return fLArProp->ProtonScintYieldRatio();
51  case 13:
52  case -13: return fLArProp->MuonScintYieldRatio();
53  case 211:
54  case -211: return fLArProp->PionScintYieldRatio();
55  case 321:
56  case -321: return fLArProp->KaonScintYieldRatio();
57  case 1000020040: return fLArProp->AlphaScintYieldRatio();
58  case 11:
59  case -11:
60  case 22: return fLArProp->ElectronScintYieldRatio();
61  default: return fLArProp->ElectronScintYieldRatio();
62  }
63  }
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
const detinfo::LArProperties * fLArProp
Definition: ISCalc.h:33
Double_t edep
Definition: macro.C:13
virtual double MuonScintYieldRatio() const =0
virtual double KaonScintYieldRatio() const =0
virtual bool ScintByParticleType() 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.

Referenced by CalcIon(), and ISCalcSeparate().

double larg4::ISCalcSeparate::fModBoxA
private

from LArG4Parameters service

Definition at line 40 of file ISCalcSeparate.h.

Referenced by CalcIon(), and ISCalcSeparate().

double larg4::ISCalcSeparate::fModBoxB
private

from LArG4Parameters service

Definition at line 41 of file ISCalcSeparate.h.

Referenced by CalcIon(), and ISCalcSeparate().

double larg4::ISCalcSeparate::fRecombA
private

from LArG4Parameters service

Definition at line 38 of file ISCalcSeparate.h.

Referenced by CalcIon(), and ISCalcSeparate().

double larg4::ISCalcSeparate::fRecombk
private

from LArG4Parameters service

Definition at line 39 of file ISCalcSeparate.h.

Referenced by CalcIon(), and ISCalcSeparate().

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

Definition at line 44 of file ISCalcSeparate.h.

Referenced by EFieldAtStep(), and ISCalcSeparate().

bool larg4::ISCalcSeparate::fUseModBoxRecomb
private

from LArG4Parameters service

Definition at line 42 of file ISCalcSeparate.h.

Referenced by CalcIon(), and ISCalcSeparate().


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