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

Private Member Functions

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

Detailed Description

Definition at line 31 of file ISCalcSeparate.h.

Constructor & Destructor Documentation

larg4::ISCalcSeparate::ISCalcSeparate ( )

Definition at line 22 of file ISCalcSeparate.cxx.

23  {
24  fSCE = lar::providerFrom<spacecharge::SpaceChargeService>();
25  fLArProp = lar::providerFrom<detinfo::LArPropertiesService>();
26 
27  // the recombination coefficient is in g/(MeVcm^2), but we report
28  // energy depositions in MeV/cm, need to divide Recombk from the
29  // LArG4Parameters service by the density of the argon we got
30  // above; this is done in 'CalcIon' function below.
32  fRecombA = LArG4PropHandle->RecombA();
33  fRecombk = LArG4PropHandle->Recombk();
34  fModBoxA = LArG4PropHandle->ModBoxA();
35  fModBoxB = LArG4PropHandle->ModBoxB();
36  fUseModBoxRecomb = (bool)LArG4PropHandle->UseModBoxRecomb();
37  fGeVToElectrons = LArG4PropHandle->GeVToElectrons();
38  }
const detinfo::LArProperties * fLArProp
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
int bool
Definition: qglobal.h:345
bool fUseModBoxRecomb
from LArG4Parameters service

Member Function Documentation

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

Definition at line 43 of file ISCalcSeparate.cxx.

45  {
46  float e = edep.Energy();
47  float ds = edep.StepLength();
48 
49  double recomb = 0.;
50  double dEdx = (ds <= 0.0) ? 0.0 : e / ds;
51  double EFieldStep = EFieldAtStep(detProp.Efield(), edep);
52 
53  // Guard against spurious values of dE/dx. Note: assumes density of LAr
54  if (dEdx < 1.) { dEdx = 1.; }
55 
56  if (fUseModBoxRecomb) {
57  if (ds > 0) {
58  double const scaled_modboxb = fModBoxB / detProp.Density(detProp.Temperature());
59  double const Xi = scaled_modboxb * dEdx / EFieldStep;
60  recomb = log(fModBoxA + Xi) / Xi;
61  }
62  else {
63  recomb = 0;
64  }
65  }
66  else {
67  double const scaled_recombk = fRecombk / detProp.Density(detProp.Temperature());
68  recomb = fRecombA / (1. + dEdx * scaled_recombk / EFieldStep);
69  }
70 
71  // 1.e-3 converts fEnergyDeposit to GeV
72  auto const numIonElectrons = fGeVToElectrons * 1.e-3 * e * recomb;
73 
74  MF_LOG_DEBUG("ISCalcSeparate")
75  << " Electrons produced for " << edep.Energy() << " MeV deposited with " << recomb
76  << " recombination: " << numIonElectrons << std::endl;
77  return numIonElectrons;
78  }
double fModBoxA
from LArG4Parameters service
double fRecombk
from LArG4Parameters service
double dEdx(float dqdx, float Efield)
Definition: doAna.cpp:21
const double e
double fRecombA
from LArG4Parameters service
double EFieldAtStep(double efield, sim::SimEnergyDeposit const &edep) override
#define MF_LOG_DEBUG(id)
double fGeVToElectrons
from LArG4Parameters service
double fModBoxB
from LArG4Parameters service
QTextStream & endl(QTextStream &s)
bool fUseModBoxRecomb
from LArG4Parameters service
ISCalcData larg4::ISCalcSeparate::CalcIonAndScint ( detinfo::DetectorPropertiesData const &  detProp,
sim::SimEnergyDeposit const &  edep 
)
overridevirtual

Implements larg4::ISCalc.

Definition at line 118 of file ISCalcSeparate.cxx.

120  {
121  auto const numElectrons = CalcIon(detProp, edep);
122  auto const [numPhotons, scintYieldRatio] = CalcScint(edep);
123  return {edep.Energy(), numElectrons, numPhotons, scintYieldRatio};
124  }
std::pair< double, double > CalcScint(sim::SimEnergyDeposit const &edep)
double CalcIon(detinfo::DetectorPropertiesData const &detProp, sim::SimEnergyDeposit const &edep)
std::pair< double, double > larg4::ISCalcSeparate::CalcScint ( sim::SimEnergyDeposit const &  edep)
private

Definition at line 82 of file ISCalcSeparate.cxx.

83  {
84  float const e = edep.Energy();
85  int const pdg = edep.PdgCode();
86 
87  double numScintPhotons{};
88  double scintYield = fLArProp->ScintYield(true);
90  MF_LOG_DEBUG("ISCalcSeparate") << "scintillating by particle type";
91 
92  switch (pdg) {
93  case 2212: scintYield = fLArProp->ProtonScintYield(true); break;
94  case 13:
95  case -13: scintYield = fLArProp->MuonScintYield(true); break;
96  case 211:
97  case -211: scintYield = fLArProp->PionScintYield(true); break;
98  case 321:
99  case -321: scintYield = fLArProp->KaonScintYield(true); break;
100  case 1000020040: scintYield = fLArProp->AlphaScintYield(true); break;
101  case 11:
102  case -11:
103  case 22: scintYield = fLArProp->ElectronScintYield(true); break;
104  default: scintYield = fLArProp->ElectronScintYield(true);
105  }
106 
107  numScintPhotons = scintYield * e;
108  }
109  else {
110  numScintPhotons = scint_yield_factor * scintYield * e;
111  }
112 
113  return {numScintPhotons, GetScintYieldRatio(edep)};
114  }
const detinfo::LArProperties * fLArProp
virtual double AlphaScintYield(bool prescale=false) const =0
virtual double ProtonScintYield(bool prescale=false) const =0
const double e
virtual double ElectronScintYield(bool prescale=false) const =0
double GetScintYieldRatio(sim::SimEnergyDeposit const &edep)
virtual double PionScintYield(bool prescale=false) const =0
virtual double MuonScintYield(bool prescale=false) const =0
virtual double KaonScintYield(bool prescale=false) const =0
virtual double ScintYield(bool prescale=false) const =0
#define MF_LOG_DEBUG(id)
virtual bool ScintByParticleType() const =0
double larg4::ISCalcSeparate::EFieldAtStep ( double  efield,
sim::SimEnergyDeposit const &  edep 
)
overridevirtual

Implements larg4::ISCalc.

Definition at line 127 of file ISCalcSeparate.cxx.

128  {
129  if (not fSCE->EnableSimEfieldSCE()) { return efield; }
130 
131  auto const eFieldOffsets = fSCE->GetEfieldOffsets(edep.MidPoint());
132  return std::hypot(
133  efield + efield * eFieldOffsets.X(), efield * eFieldOffsets.Y(), efield * eFieldOffsets.Z());
134  }
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
double larg4::ISCalcSeparate::GetScintYieldRatio ( sim::SimEnergyDeposit const &  edep)
private

Definition at line 137 of file ISCalcSeparate.cxx.

138  {
139  if (!fLArProp->ScintByParticleType()) { return fLArProp->ScintYieldRatio(); }
140  switch (edep.PdgCode()) {
141  case 2212: return fLArProp->ProtonScintYieldRatio();
142  case 13:
143  case -13: return fLArProp->MuonScintYieldRatio();
144  case 211:
145  case -211: return fLArProp->PionScintYieldRatio();
146  case 321:
147  case -321: return fLArProp->KaonScintYieldRatio();
148  case 1000020040: return fLArProp->AlphaScintYieldRatio();
149  case 11:
150  case -11:
151  case 22: return fLArProp->ElectronScintYieldRatio();
152  default: return fLArProp->ElectronScintYieldRatio();
153  }
154  }
virtual double ElectronScintYieldRatio() const =0
const detinfo::LArProperties * fLArProp
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
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 43 of file ISCalcSeparate.h.

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

Definition at line 51 of file ISCalcSeparate.h.

double larg4::ISCalcSeparate::fModBoxA
private

from LArG4Parameters service

Definition at line 46 of file ISCalcSeparate.h.

double larg4::ISCalcSeparate::fModBoxB
private

from LArG4Parameters service

Definition at line 47 of file ISCalcSeparate.h.

double larg4::ISCalcSeparate::fRecombA
private

from LArG4Parameters service

Definition at line 44 of file ISCalcSeparate.h.

double larg4::ISCalcSeparate::fRecombk
private

from LArG4Parameters service

Definition at line 45 of file ISCalcSeparate.h.

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

Definition at line 50 of file ISCalcSeparate.h.

bool larg4::ISCalcSeparate::fUseModBoxRecomb
private

from LArG4Parameters service

Definition at line 48 of file ISCalcSeparate.h.


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