LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
detsim::ISCalculationSeparate Class Reference

#include "ISCalculationSeparate.h"

Classes

struct  Data
 

Public Member Functions

 ISCalculationSeparate (fhicl::ParameterSet const &pset)
 
Data CalculateIonizationAndScintillation (detinfo::DetectorPropertiesData const &detProp, sim::SimEnergyDeposit const &edep) const
 
double EFieldAtStep (double efield, sim::SimEnergyDeposit const &edep) const
 

Private Member Functions

double EFieldAtStep (double efield, float x, float y, float z) const
 
double CalculateIonization (detinfo::DetectorPropertiesData const &detProp, sim::SimEnergyDeposit const &edep) const
 
double CalculateScintillation (sim::SimEnergyDeposit const &edep) const
 

Private Attributes

double fRecombA
 
double fRecombk
 
double fModBoxA
 
double fModBoxB
 
bool fUseModBoxRecomb
 
double fGeVToElectrons
 from LArG4Parameters service More...
 
const detinfo::LArPropertiesfLArProp
 
const spacecharge::SpaceChargefSCE
 

Detailed Description

Definition at line 33 of file ISCalculationSeparate.h.

Constructor & Destructor Documentation

detsim::ISCalculationSeparate::ISCalculationSeparate ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 37 of file ISCalculationSeparate.cc.

References fGeVToElectrons, fLArProp, fModBoxA, fModBoxB, fRecombk, fSCE, fUseModBoxRecomb, and fhicl::ParameterSet::get().

38  : fRecombA{pset.get<double>("RecombA")}
39  , fRecombk{pset.get<double>("Recombk")}
40  , fModBoxA{pset.get<double>("ModBoxA")}
41  , fModBoxB{pset.get<double>("ModBoxB")}
42  , fUseModBoxRecomb{pset.get<bool>("UseModBoxRecomb")}
43  , fGeVToElectrons{pset.get<double>("GeVToElectrons")}
44  {
45  fLArProp = lar::providerFrom<detinfo::LArPropertiesService>();
46  fSCE = lar::providerFrom<spacecharge::SpaceChargeService>();
47 
48  // the recombination coefficient is in g/(MeVcm^2), but
49  // we report energy depositions in MeV/cm, need to divide
50  // Recombk from the LArG4Parameters service by the density
51  // of the argon we got above. FIXME: is this being done?
52 
53  std::cout << "fLArG4Prop->GeVToElectrons(): " << fGeVToElectrons << std::endl;
54  }
const detinfo::LArProperties * fLArProp
double fGeVToElectrons
from LArG4Parameters service
const spacecharge::SpaceCharge * fSCE

Member Function Documentation

double detsim::ISCalculationSeparate::CalculateIonization ( detinfo::DetectorPropertiesData const &  detProp,
sim::SimEnergyDeposit const &  edep 
) const
private

Definition at line 58 of file ISCalculationSeparate.cc.

References tca::dEdx(), e, detinfo::DetectorPropertiesData::Efield(), EFieldAtStep(), sim::SimEnergyDeposit::Energy(), fGeVToElectrons, fModBoxA, fModBoxB, fRecombA, fRecombk, fUseModBoxRecomb, MF_LOG_DEBUG, sim::SimEnergyDeposit::MidPointX(), sim::SimEnergyDeposit::MidPointY(), sim::SimEnergyDeposit::MidPointZ(), sim::SimEnergyDeposit::StepLength(), x, y, and z.

Referenced by CalculateIonizationAndScintillation().

60  {
61  float e = edep.Energy();
62  float ds = edep.StepLength();
63  float x = edep.MidPointX();
64  float y = edep.MidPointY();
65  float z = edep.MidPointZ();
66  double recomb = 0.;
67  double dEdx = (ds <= 0.0) ? 0.0 : e / ds;
68  double EFieldStep = EFieldAtStep(detProp.Efield(), x, y, z);
69 
70  // Guard against spurious values of dE/dx. Note: assumes density of LAr
71  if (dEdx < 1.) dEdx = 1.;
72 
73  if (fUseModBoxRecomb) {
74  if (ds > 0) {
75  double Xi = fModBoxB * dEdx / EFieldStep;
76  recomb = log(fModBoxA + Xi) / Xi;
77  }
78  else
79  recomb = 0;
80  }
81  else {
82  recomb = fRecombA / (1. + dEdx * fRecombk / EFieldStep);
83  }
84 
85  // 1.e-3 converts fEnergyDeposit to GeV
86  double const numIonElectrons = fGeVToElectrons * 1.e-3 * e * recomb;
87 
88  MF_LOG_DEBUG("ISCalculationSeparate")
89  << " Electrons produced for " << edep.Energy() << " MeV deposited with " << recomb
90  << " recombination: " << numIonElectrons << std::endl;
91 
92  return numIonElectrons;
93  }
Float_t x
Definition: compare.C:6
double fGeVToElectrons
from LArG4Parameters service
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
double EFieldAtStep(double efield, sim::SimEnergyDeposit const &edep) const
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
#define MF_LOG_DEBUG(id)
Float_t e
Definition: plot.C:35
ISCalculationSeparate::Data detsim::ISCalculationSeparate::CalculateIonizationAndScintillation ( detinfo::DetectorPropertiesData const &  detProp,
sim::SimEnergyDeposit const &  edep 
) const

Definition at line 127 of file ISCalculationSeparate.cc.

References CalculateIonization(), CalculateScintillation(), and sim::SimEnergyDeposit::Energy().

Referenced by detsim::DriftElectronstoPlane::produce().

130  {
131  return {edep.Energy(), CalculateIonization(detProp, edep), CalculateScintillation(edep)};
132  }
double CalculateIonization(detinfo::DetectorPropertiesData const &detProp, sim::SimEnergyDeposit const &edep) const
Double_t edep
Definition: macro.C:13
double CalculateScintillation(sim::SimEnergyDeposit const &edep) const
double detsim::ISCalculationSeparate::CalculateScintillation ( sim::SimEnergyDeposit const &  edep) const
private

Definition at line 96 of file ISCalculationSeparate.cc.

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

Referenced by CalculateIonizationAndScintillation().

97  {
98  float const e = edep.Energy();
99  int const pdg = edep.PdgCode();
100  double scintYield = fLArProp->ScintYield(true);
101  if (fLArProp->ScintByParticleType()) {
102 
103  MF_LOG_DEBUG("ISCalculationSeparate") << "scintillating by particle type";
104 
105  switch (pdg) {
106 
107  case 2212: scintYield = fLArProp->ProtonScintYield(true); break;
108  case 13:
109  case -13: scintYield = fLArProp->MuonScintYield(true); break;
110  case 211:
111  case -211: scintYield = fLArProp->PionScintYield(true); break;
112  case 321:
113  case -321: scintYield = fLArProp->KaonScintYield(true); break;
114  case 1000020040: scintYield = fLArProp->AlphaScintYield(true); break;
115  case 11:
116  case -11:
117  case 22: scintYield = fLArProp->ElectronScintYield(true); break;
118  default: scintYield = fLArProp->ElectronScintYield(true);
119  }
120 
121  return scintYield * e;
122  }
123 
124  return scint_yield_factor * scintYield * e;
125  }
virtual double AlphaScintYield(bool prescale=false) const =0
const detinfo::LArProperties * fLArProp
virtual double ProtonScintYield(bool prescale=false) const =0
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
#define MF_LOG_DEBUG(id)
Float_t e
Definition: plot.C:35
virtual bool ScintByParticleType() const =0
double detsim::ISCalculationSeparate::EFieldAtStep ( double  efield,
sim::SimEnergyDeposit const &  edep 
) const

Definition at line 134 of file ISCalculationSeparate.cc.

References sim::SimEnergyDeposit::MidPointX(), sim::SimEnergyDeposit::MidPointY(), and sim::SimEnergyDeposit::MidPointZ().

Referenced by CalculateIonization().

136  {
137  return EFieldAtStep(efield, edep.MidPointX(), edep.MidPointY(), edep.MidPointZ());
138  }
double EFieldAtStep(double efield, sim::SimEnergyDeposit const &edep) const
Double_t edep
Definition: macro.C:13
double detsim::ISCalculationSeparate::EFieldAtStep ( double  efield,
float  x,
float  y,
float  z 
) const
private

Definition at line 140 of file ISCalculationSeparate.cc.

References spacecharge::SpaceCharge::EnableSimEfieldSCE(), fSCE, spacecharge::SpaceCharge::GetEfieldOffsets(), x, and y.

144  {
145  if (not fSCE->EnableSimEfieldSCE()) { return efield; }
146 
147  auto const offsets = fSCE->GetEfieldOffsets(geo::Point_t{x, y, z});
148  return std::hypot(efield + efield * offsets.X(), efield * offsets.Y(), efield * offsets.Z());
149  }
Float_t x
Definition: compare.C:6
virtual bool EnableSimEfieldSCE() const =0
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
const spacecharge::SpaceCharge * fSCE
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
virtual geo::Vector_t GetEfieldOffsets(geo::Point_t const &point) const =0

Member Data Documentation

double detsim::ISCalculationSeparate::fGeVToElectrons
private

from LArG4Parameters service

Definition at line 53 of file ISCalculationSeparate.h.

Referenced by CalculateIonization(), and ISCalculationSeparate().

const detinfo::LArProperties* detsim::ISCalculationSeparate::fLArProp
private

Definition at line 57 of file ISCalculationSeparate.h.

Referenced by CalculateScintillation(), and ISCalculationSeparate().

double detsim::ISCalculationSeparate::fModBoxA
private

Definition at line 50 of file ISCalculationSeparate.h.

Referenced by CalculateIonization(), and ISCalculationSeparate().

double detsim::ISCalculationSeparate::fModBoxB
private

Definition at line 51 of file ISCalculationSeparate.h.

Referenced by CalculateIonization(), and ISCalculationSeparate().

double detsim::ISCalculationSeparate::fRecombA
private

Definition at line 48 of file ISCalculationSeparate.h.

Referenced by CalculateIonization().

double detsim::ISCalculationSeparate::fRecombk
private

Definition at line 49 of file ISCalculationSeparate.h.

Referenced by CalculateIonization(), and ISCalculationSeparate().

const spacecharge::SpaceCharge* detsim::ISCalculationSeparate::fSCE
private

Definition at line 58 of file ISCalculationSeparate.h.

Referenced by EFieldAtStep(), and ISCalculationSeparate().

bool detsim::ISCalculationSeparate::fUseModBoxRecomb
private

Definition at line 52 of file ISCalculationSeparate.h.

Referenced by CalculateIonization(), and ISCalculationSeparate().


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