9 #include "Geant4/G4EmSaturation.hh"
10 #include "Geant4/G4LossTableManager.hh"
11 #include "Geant4/G4ParticleTypes.hh"
20 #include "cetlib_except/exception.h"
21 #include "messagefacility/MessageLogger/MessageLogger.h"
28 art::ServiceHandle<sim::LArG4Parameters const> lgpHandle;
31 art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataForJob();
33 double density = detProp.Density(detProp.Temperature());
46 fRecombk = lgpHandle->Recombk() / density;
48 fModBoxB = lgpHandle->ModBoxB() / density;
52 fEMSaturation = G4LossTableManager::Instance()->EmSaturation();
55 art::ServiceHandle<sim::LArVoxelCalculator const> lvc;
57 std::max(lvc->VoxelSizeX(), std::max(lvc->VoxelSizeY(), lvc->VoxelSizeZ())) * CLHEP::cm;
90 G4ThreeVector totstep = step->GetPostStepPoint()->GetPosition();
91 totstep -= step->GetPreStepPoint()->GetPosition();
93 double dx = totstep.mag() / CLHEP::cm;
99 if (dEdx < 1.) dEdx = 1.;
103 double Xi =
fModBoxB * dEdx / EFieldStep;
116 MF_LOG_DEBUG(
"ISCalculationSeparate")
117 <<
" Electrons produced for " <<
fEnergyDeposit <<
" MeV deposited with " << recomb
121 G4MaterialPropertiesTable* mpt = step->GetTrack()->GetMaterial()->GetMaterialPropertiesTable();
123 throw cet::exception(
"ISCalculationSeparate")
124 <<
"Cannot find materials property table"
125 <<
" for this step! " << step->GetTrack()->GetMaterial() <<
"\n";
128 double scintYield = mpt->GetConstProperty(
"SCINTILLATIONYIELD");
132 MF_LOG_DEBUG(
"ISCalculationSeparate") <<
"scintillating by particle type";
135 G4ParticleDefinition* pDef = step->GetTrack()->GetDynamicParticle()->GetDefinition();
142 if (pDef == G4Proton::ProtonDefinition()) {
143 scintYield = mpt->GetConstProperty(
"PROTONSCINTILLATIONYIELD");
146 else if (pDef == G4MuonPlus::MuonPlusDefinition() ||
147 pDef == G4MuonMinus::MuonMinusDefinition()) {
148 scintYield = mpt->GetConstProperty(
"MUONSCINTILLATIONYIELD");
151 else if (pDef == G4PionPlus::PionPlusDefinition() ||
152 pDef == G4PionMinus::PionMinusDefinition()) {
153 scintYield = mpt->GetConstProperty(
"PIONSCINTILLATIONYIELD");
156 else if (pDef == G4KaonPlus::KaonPlusDefinition() ||
157 pDef == G4KaonMinus::KaonMinusDefinition()) {
158 scintYield = mpt->GetConstProperty(
"KAONSCINTILLATIONYIELD");
161 else if (pDef == G4Alpha::AlphaDefinition()) {
162 scintYield = mpt->GetConstProperty(
"ALPHASCINTILLATIONYIELD");
166 else if (pDef == G4Electron::ElectronDefinition() || pDef == G4Gamma::GammaDefinition()) {
167 scintYield = mpt->GetConstProperty(
"ELECTRONSCINTILLATIONYIELD");
171 scintYield = mpt->GetConstProperty(
"ELECTRONSCINTILLATIONYIELD");
180 throw cet::exception(
"ISCalculationSeparate")
181 <<
"Request for scintillation yield for energy "
182 <<
"deposit and particle type without correct "
183 <<
"entry in MaterialPropertiesTable\n"
184 <<
"ScintillationByParticleType requires at "
185 <<
"minimum that ELECTRONSCINTILLATIONYIELD is "
186 <<
"set by the user\n";
199 MF_LOG_DEBUG(
"ISCalculationSeparate")
201 <<
" saturation: " <<
fEMSaturation->VisibleEnergyDepositionAtAStep(step)
202 <<
" step length: " << step->GetStepLength() / CLHEP::cm;
Store parameters for running LArG4.
Utilities related to art service access.
bool fUseModBoxRecomb
from LArG4Parameters service
G4EmSaturation * fEMSaturation
pointer to EM saturation
double fScintYieldFactor
scintillation yield factor
Encapsulates calculation of LArVoxelID and LArVoxel parameters.
double EFieldAtStep(double fEfield, const G4Step *step) const
void CalculateIonizationAndScintillation(const G4Step *step) override
double fGeVToElectrons
conversion factor from LArProperties service
double fRecombA
from LArG4Parameters service
util::quantities::megaelectronvolt MeV
double fEfield
value of electric field from LArProperties service
double fNumIonElectrons
number of ionization electrons for this step
double fModBoxB
from LArG4Parameters service
bool fScintByParticleType
from LArProperties service
double fStepSize
maximum step to take
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
double fRecombk
from LArG4Parameters service
double fNumScintPhotons
number of scintillation photons for this step
double fVisibleEnergyDeposition
double fModBoxA
from LArG4Parameters service
double fEnergyDeposit
total energy deposited in the step
virtual bool ScintByParticleType() const =0