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

#include "ISCalculationSeparate.h"

Inheritance diagram for larg4::ISCalculationSeparate:
larg4::ISCalculation

Public Member Functions

 ISCalculationSeparate ()
 
void Reset () override
 
void CalculateIonizationAndScintillation (const G4Step *step) override
 
double StepSizeLimit () const override
 
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 Attributes

double fStepSize
 maximum step to take More...
 
double fEfield
 value of electric field from LArProperties service More...
 
double fGeVToElectrons
 conversion factor 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...
 
bool fUseModBoxRecomb
 from LArG4Parameters service More...
 
bool fScintByParticleType
 from LArProperties service More...
 
double fScintYieldFactor
 scintillation yield factor More...
 
G4EmSaturation * fEMSaturation
 pointer to EM saturation More...
 

Detailed Description

Definition at line 20 of file ISCalculationSeparate.h.

Constructor & Destructor Documentation

larg4::ISCalculationSeparate::ISCalculationSeparate ( )

Definition at line 26 of file ISCalculationSeparate.cxx.

References fEfield, fEMSaturation, fGeVToElectrons, fModBoxA, fModBoxB, fRecombA, fRecombk, fScintByParticleType, fScintYieldFactor, fStepSize, fUseModBoxRecomb, sim::LArG4Parameters::GeVToElectrons(), sim::LArG4Parameters::ModBoxA(), sim::LArG4Parameters::ModBoxB(), sim::LArG4Parameters::RecombA(), sim::LArG4Parameters::Recombk(), detinfo::LArProperties::ScintByParticleType(), sim::LArG4Parameters::UseModBoxRecomb(), sim::LArVoxelCalculator::VoxelSizeX(), sim::LArVoxelCalculator::VoxelSizeY(), and sim::LArVoxelCalculator::VoxelSizeZ().

27  {
29  const detinfo::LArProperties* larp = lar::providerFrom<detinfo::LArPropertiesService>();
30  auto const detProp =
32 
33  double density = detProp.Density(detProp.Temperature());
34  fEfield = detProp.Efield();
36  fGeVToElectrons = lgpHandle->GeVToElectrons();
37 
38  // \todo get scintillation yield from LArG4Parameters or LArProperties
39  fScintYieldFactor = 1.;
40 
41  // the recombination coefficient is in g/(MeVcm^2), but
42  // we report energy depositions in MeV/cm, need to divide
43  // Recombk from the LArG4Parameters service by the density
44  // of the argon we got above.
45  fRecombA = lgpHandle->RecombA();
46  fRecombk = lgpHandle->Recombk() / density;
47  fModBoxA = lgpHandle->ModBoxA();
48  fModBoxB = lgpHandle->ModBoxB() / density;
49  fUseModBoxRecomb = lgpHandle->UseModBoxRecomb();
50 
51  // Use Birks Correction in the Scintillation process
52  fEMSaturation = G4LossTableManager::Instance()->EmSaturation();
53 
54  // determine the step size using the voxel sizes
56  double maxsize =
57  std::max(lvc->VoxelSizeX(), std::max(lvc->VoxelSizeY(), lvc->VoxelSizeZ())) * CLHEP::cm;
58 
59  fStepSize = 0.1 * maxsize;
60  }
double VoxelSizeX() const
Access to voxel dimensions and offsets.
double ModBoxA() const
bool fUseModBoxRecomb
from LArG4Parameters service
G4EmSaturation * fEMSaturation
pointer to EM saturation
double fScintYieldFactor
scintillation yield factor
double fGeVToElectrons
conversion factor from LArProperties service
bool UseModBoxRecomb() const
double fRecombA
from LArG4Parameters service
double fEfield
value of electric field from LArProperties service
double fModBoxB
from LArG4Parameters service
bool fScintByParticleType
from LArProperties service
double RecombA() const
double fStepSize
maximum step to take
double fRecombk
from LArG4Parameters service
double ModBoxB() const
double Recombk() const
double fModBoxA
from LArG4Parameters service
virtual bool ScintByParticleType() const =0
double GeVToElectrons() const

Member Function Documentation

void larg4::ISCalculationSeparate::CalculateIonizationAndScintillation ( const G4Step *  step)
overridevirtual

Implements larg4::ISCalculation.

Definition at line 73 of file ISCalculationSeparate.cxx.

References tca::dEdx(), larg4::ISCalculation::EFieldAtStep(), fEfield, fEMSaturation, larg4::ISCalculation::fEnergyDeposit, fGeVToElectrons, fModBoxA, fModBoxB, larg4::ISCalculation::fNumIonElectrons, larg4::ISCalculation::fNumScintPhotons, fRecombA, fRecombk, fScintByParticleType, fScintYieldFactor, fUseModBoxRecomb, larg4::ISCalculation::fVisibleEnergyDeposition, and MF_LOG_DEBUG.

74  {
75  fEnergyDeposit = step->GetTotalEnergyDeposit() / CLHEP::MeV;
76 
77  // Get the recombination factor for this voxel - Nucl.Instrum.Meth.A523:275-286,2004
78  // R = A/(1 + (dE/dx)*k)
79  // dE/dx is given by the voxel energy deposition, but have to convert it to MeV/cm
80  // from GeV/voxel width
81  // A = 0.800 +/- 0.003
82  // k = (0.097+/-0.001) g/(MeVcm^2)
83  // the dx depends on the trajectory of the step
84  // k should be divided by the density as our dE/dx is in MeV/cm,
85  // the division is handled in the constructor when we set fRecombk
86  // B.Baller: Add Modified Box recombination - ArgoNeuT result submitted to JINST
87 
88  G4ThreeVector totstep = step->GetPostStepPoint()->GetPosition();
89  totstep -= step->GetPreStepPoint()->GetPosition();
90 
91  double dx = totstep.mag() / CLHEP::cm;
92  double recomb = 0.;
93  double dEdx = (dx == 0.0) ? 0.0 : fEnergyDeposit / dx;
94  double EFieldStep = EFieldAtStep(fEfield, step);
95 
96  // Guard against spurious values of dE/dx. Note: assumes density of LAr
97  if (dEdx < 1.) dEdx = 1.;
98 
99  if (fUseModBoxRecomb) {
100  if (dx) {
101  double Xi = fModBoxB * dEdx / EFieldStep;
102  recomb = log(fModBoxA + Xi) / Xi;
103  }
104  else
105  recomb = 0;
106  }
107  else {
108  recomb = fRecombA / (1. + dEdx * fRecombk / EFieldStep);
109  }
110 
111  // 1.e-3 converts fEnergyDeposit to GeV
112  fNumIonElectrons = fGeVToElectrons * 1.e-3 * fEnergyDeposit * recomb;
113 
114  MF_LOG_DEBUG("ISCalculationSeparate")
115  << " Electrons produced for " << fEnergyDeposit << " MeV deposited with " << recomb
116  << " recombination: " << fNumIonElectrons;
117 
118  // Now do the scintillation
119  G4MaterialPropertiesTable* mpt = step->GetTrack()->GetMaterial()->GetMaterialPropertiesTable();
120  if (!mpt)
121  throw cet::exception("ISCalculationSeparate")
122  << "Cannot find materials property table"
123  << " for this step! " << step->GetTrack()->GetMaterial() << "\n";
124 
125  // if not doing the scintillation by particle type, use the saturation
126  double scintYield = mpt->GetConstProperty("SCINTILLATIONYIELD");
127 
128  if (fScintByParticleType) {
129 
130  MF_LOG_DEBUG("ISCalculationSeparate") << "scintillating by particle type";
131 
132  // Get the definition of the current particle
133  G4ParticleDefinition* pDef = step->GetTrack()->GetDynamicParticle()->GetDefinition();
134 
135  // Obtain the G4MaterialPropertyVectory containing the
136  // scintillation light yield as a function of the deposited
137  // energy for the current particle type
138 
139  // Protons
140  if (pDef == G4Proton::ProtonDefinition()) {
141  scintYield = mpt->GetConstProperty("PROTONSCINTILLATIONYIELD");
142  }
143  // Muons
144  else if (pDef == G4MuonPlus::MuonPlusDefinition() ||
145  pDef == G4MuonMinus::MuonMinusDefinition()) {
146  scintYield = mpt->GetConstProperty("MUONSCINTILLATIONYIELD");
147  }
148  // Pions
149  else if (pDef == G4PionPlus::PionPlusDefinition() ||
150  pDef == G4PionMinus::PionMinusDefinition()) {
151  scintYield = mpt->GetConstProperty("PIONSCINTILLATIONYIELD");
152  }
153  // Kaons
154  else if (pDef == G4KaonPlus::KaonPlusDefinition() ||
155  pDef == G4KaonMinus::KaonMinusDefinition()) {
156  scintYield = mpt->GetConstProperty("KAONSCINTILLATIONYIELD");
157  }
158  // Alphas
159  else if (pDef == G4Alpha::AlphaDefinition()) {
160  scintYield = mpt->GetConstProperty("ALPHASCINTILLATIONYIELD");
161  }
162  // Electrons (must also account for shell-binding energy
163  // attributed to gamma from standard PhotoElectricEffect)
164  else if (pDef == G4Electron::ElectronDefinition() || pDef == G4Gamma::GammaDefinition()) {
165  scintYield = mpt->GetConstProperty("ELECTRONSCINTILLATIONYIELD");
166  }
167  // Default for particles not enumerated/listed above
168  else {
169  scintYield = mpt->GetConstProperty("ELECTRONSCINTILLATIONYIELD");
170  }
171 
172  // If the user has not specified yields for (p,d,t,a,carbon)
173  // then these unspecified particles will default to the
174  // electron's scintillation yield
175 
176  // Throw an exception if no scintillation yield is found
177  if (!scintYield)
178  throw cet::exception("ISCalculationSeparate")
179  << "Request for scintillation yield for energy "
180  << "deposit and particle type without correct "
181  << "entry in MaterialPropertiesTable\n"
182  << "ScintillationByParticleType requires at "
183  << "minimum that ELECTRONSCINTILLATIONYIELD is "
184  << "set by the user\n";
185 
186  fNumScintPhotons = scintYield * fEnergyDeposit;
187  }
188  else if (fEMSaturation) {
189  // The default linear scintillation process
190  fVisibleEnergyDeposition = fEMSaturation->VisibleEnergyDepositionAtAStep(step);
192  }
193  else {
195  }
196 
197  MF_LOG_DEBUG("ISCalculationSeparate")
198  << "number photons: " << fNumScintPhotons << " energy: " << fEnergyDeposit / CLHEP::MeV
199  << " saturation: " << fEMSaturation->VisibleEnergyDepositionAtAStep(step)
200  << " step length: " << step->GetStepLength() / CLHEP::cm;
201  }
bool fUseModBoxRecomb
from LArG4Parameters service
G4EmSaturation * fEMSaturation
pointer to EM saturation
double fScintYieldFactor
scintillation yield factor
double EFieldAtStep(double fEfield, const G4Step *step) const
double fGeVToElectrons
conversion factor from LArProperties service
double fRecombA
from LArG4Parameters service
double fEfield
value of electric field from LArProperties service
double fNumIonElectrons
number of ionization electrons for this step
Definition: ISCalculation.h:33
double fModBoxB
from LArG4Parameters service
bool fScintByParticleType
from LArProperties service
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2675
double fRecombk
from LArG4Parameters service
#define MF_LOG_DEBUG(id)
double fNumScintPhotons
number of scintillation photons for this step
Definition: ISCalculation.h:34
double fVisibleEnergyDeposition
Definition: ISCalculation.h:35
double fModBoxA
from LArG4Parameters service
double fEnergyDeposit
total energy deposited in the step
Definition: ISCalculation.h:32
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
double larg4::ISCalculation::EFieldAtStep ( double  fEfield,
const G4Step *  step 
) const
inherited

Definition at line 18 of file ISCalculation.cxx.

Referenced by CalculateIonizationAndScintillation(), larg4::ISCalculationCorrelated::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::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::ISCalculationSeparate::Reset ( )
overridevirtual

Implements larg4::ISCalculation.

Definition at line 64 of file ISCalculationSeparate.cxx.

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

65  {
66  fEnergyDeposit = 0.;
67  fNumScintPhotons = 0.;
68  fNumIonElectrons = 0.;
69  }
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::ISCalculationSeparate::StepSizeLimit ( ) const
inlineoverridevirtual

Implements larg4::ISCalculation.

Definition at line 25 of file ISCalculationSeparate.h.

References fStepSize.

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

Member Data Documentation

double larg4::ISCalculationSeparate::fEfield
private

value of electric field from LArProperties service

Definition at line 29 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationSeparate().

G4EmSaturation* larg4::ISCalculationSeparate::fEMSaturation
private

pointer to EM saturation

Definition at line 38 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationSeparate().

double larg4::ISCalculationSeparate::fGeVToElectrons
private

conversion factor from LArProperties service

Definition at line 30 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationSeparate().

double larg4::ISCalculationSeparate::fModBoxA
private

from LArG4Parameters service

Definition at line 33 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationSeparate().

double larg4::ISCalculationSeparate::fModBoxB
private

from LArG4Parameters service

Definition at line 34 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationSeparate().

double larg4::ISCalculationSeparate::fRecombA
private

from LArG4Parameters service

Definition at line 31 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationSeparate().

double larg4::ISCalculationSeparate::fRecombk
private

from LArG4Parameters service

Definition at line 32 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationSeparate().

bool larg4::ISCalculationSeparate::fScintByParticleType
private

from LArProperties service

Definition at line 36 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationSeparate().

double larg4::ISCalculationSeparate::fScintYieldFactor
private

scintillation yield factor

Definition at line 37 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationSeparate().

double larg4::ISCalculationSeparate::fStepSize
private

maximum step to take

Definition at line 28 of file ISCalculationSeparate.h.

Referenced by ISCalculationSeparate(), and StepSizeLimit().

bool larg4::ISCalculationSeparate::fUseModBoxRecomb
private

from LArG4Parameters service

Definition at line 35 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and ISCalculationSeparate().

double larg4::ISCalculation::fVisibleEnergyDeposition
protectedinherited

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