LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
larg4::ISCalculationSeparate Class Reference

#include "ISCalculationSeparate.h"

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

Public Member Functions

 ISCalculationSeparate (CLHEP::HepRandomEngine &)
 
virtual ~ISCalculationSeparate ()
 
void Initialize ()
 
void Reset ()
 
void CalculateIonizationAndScintillation (const G4Step *step)
 
double StepSizeLimit () const
 
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 23 of file ISCalculationSeparate.h.

Constructor & Destructor Documentation

larg4::ISCalculationSeparate::ISCalculationSeparate ( CLHEP::HepRandomEngine &  )

Definition at line 27 of file ISCalculationSeparate.cxx.

28  {
29  }
larg4::ISCalculationSeparate::~ISCalculationSeparate ( )
virtual

Definition at line 32 of file ISCalculationSeparate.cxx.

33  {
34  }

Member Function Documentation

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

Implements larg4::ISCalculation.

Definition at line 86 of file ISCalculationSeparate.cxx.

References 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 LOG_DEBUG.

87  {
88 
89  fEnergyDeposit = step->GetTotalEnergyDeposit()/CLHEP::MeV;
90 
91  // Get the recombination factor for this voxel - Nucl.Instrum.Meth.A523:275-286,2004
92  // R = A/(1 + (dE/dx)*k)
93  // dE/dx is given by the voxel energy deposition, but have to convert it to MeV/cm
94  // from GeV/voxel width
95  // A = 0.800 +/- 0.003
96  // k = (0.097+/-0.001) g/(MeVcm^2)
97  // the dx depends on the trajectory of the step
98  // k should be divided by the density as our dE/dx is in MeV/cm,
99  // the division is handled in the constructor when we set fRecombk
100  // B.Baller: Add Modified Box recombination - ArgoNeuT result submitted to JINST
101 
102  G4ThreeVector totstep = step->GetPostStepPoint()->GetPosition();
103  totstep -= step->GetPreStepPoint()->GetPosition();
104 
105  double dx = totstep.mag()/CLHEP::cm;
106  double recomb = 0.;
107  double dEdx = (dx == 0.0)? 0.0: fEnergyDeposit/dx;
108  double EFieldStep = EFieldAtStep(fEfield,step);
109 
110  // Guard against spurious values of dE/dx. Note: assumes density of LAr
111  if(dEdx < 1.) dEdx = 1.;
112 
113  if(fUseModBoxRecomb) {
114  if (dx){
115  double Xi = fModBoxB * dEdx / EFieldStep;
116  recomb = log(fModBoxA + Xi) / Xi;
117  }
118  else
119  recomb = 0;
120  }
121  else{
122  recomb = fRecombA/(1. + dEdx * fRecombk / EFieldStep);
123  }
124 
125 
126  // 1.e-3 converts fEnergyDeposit to GeV
127  fNumIonElectrons = fGeVToElectrons * 1.e-3 * fEnergyDeposit * recomb;
128 
129  LOG_DEBUG("ISCalculationSeparate") << " Electrons produced for " << fEnergyDeposit
130  << " MeV deposited with " << recomb
131  << " recombination: " << fNumIonElectrons;
132 
133  // Now do the scintillation
134  G4MaterialPropertiesTable* mpt = step->GetTrack()->GetMaterial()->GetMaterialPropertiesTable();
135  if( !mpt)
136  throw cet::exception("ISCalculationSeparate") << "Cannot find materials property table"
137  << " for this step! "
138  << step->GetTrack()->GetMaterial() << "\n";
139 
140  // if not doing the scintillation by particle type, use the saturation
141  double scintYield = mpt->GetConstProperty("SCINTILLATIONYIELD");
142 
144 
145  LOG_DEBUG("ISCalculationSeparate") << "scintillating by particle type";
146 
147  // Get the definition of the current particle
148  G4ParticleDefinition *pDef = step->GetTrack()->GetDynamicParticle()->GetDefinition();
149  //G4MaterialPropertyVector *Scint_Yield_Vector = NULL;
150 
151  // Obtain the G4MaterialPropertyVectory containing the
152  // scintillation light yield as a function of the deposited
153  // energy for the current particle type
154 
155  // Protons
156  if(pDef == G4Proton::ProtonDefinition()){
157  scintYield = mpt->GetConstProperty("PROTONSCINTILLATIONYIELD");
158  }
159  // Muons
160  else if(pDef == G4MuonPlus::MuonPlusDefinition() ||
161  pDef == G4MuonMinus::MuonMinusDefinition()){
162  scintYield = mpt->GetConstProperty("MUONSCINTILLATIONYIELD");
163  }
164  // Pions
165  else if(pDef == G4PionPlus::PionPlusDefinition() ||
166  pDef == G4PionMinus::PionMinusDefinition()){
167  scintYield = mpt->GetConstProperty("PIONSCINTILLATIONYIELD");
168  }
169  // Kaons
170  else if(pDef == G4KaonPlus::KaonPlusDefinition() ||
171  pDef == G4KaonMinus::KaonMinusDefinition()){
172  scintYield = mpt->GetConstProperty("KAONSCINTILLATIONYIELD");
173  }
174  // Alphas
175  else if(pDef == G4Alpha::AlphaDefinition()){
176  scintYield = mpt->GetConstProperty("ALPHASCINTILLATIONYIELD");
177  }
178  // Electrons (must also account for shell-binding energy
179  // attributed to gamma from standard PhotoElectricEffect)
180  else if(pDef == G4Electron::ElectronDefinition() ||
181  pDef == G4Gamma::GammaDefinition()){
182  scintYield = mpt->GetConstProperty("ELECTRONSCINTILLATIONYIELD");
183  }
184  // Default for particles not enumerated/listed above
185  else{
186  scintYield = mpt->GetConstProperty("ELECTRONSCINTILLATIONYIELD");
187  }
188 
189  // If the user has not specified yields for (p,d,t,a,carbon)
190  // then these unspecified particles will default to the
191  // electron's scintillation yield
192 
193  // Throw an exception if no scintillation yield is found
194  if (!scintYield)
195  throw cet::exception("ISCalculationSeparate") << "Request for scintillation yield for energy "
196  << "deposit and particle type without correct "
197  << "entry in MaterialPropertiesTable\n"
198  << "ScintillationByParticleType requires at "
199  << "minimum that ELECTRONSCINTILLATIONYIELD is "
200  << "set by the user\n";
201 
202  fNumScintPhotons = scintYield * fEnergyDeposit;
203  }
204  else if(fEMSaturation){
205  // The default linear scintillation process
206  //fEMSaturation->SetVerbose(1);
207  fVisibleEnergyDeposition = fEMSaturation->VisibleEnergyDepositionAtAStep(step);
209  //fNumScintPhotons = fScintYieldFactor * scintYield * fEMSaturation->VisibleEnergyDepositionAtAStep(step);
210  //I need a dump here
211  //mf::LogInfo("EMSaturation") <<"\n\nfEMSaturation VisibleEnergyDepositionAtAStep(step): "<<fEMSaturation->VisibleEnergyDepositionAtAStep(step)<<"\n" <<"BirksCoefs: \n";
212  // fEMSaturation->DumpBirksCoefficients();
213  //mf::LogInfo("EMSaturation")<<"\n" <<"G4Birks: \n";
214  //fEMSaturation->DumpG4BirksCoefficients();
215  //mf::LogInfo("EMSaturation")<<"fScintYieldFactor: "<<fScintYieldFactor <<"\nscintYield: "<<scintYield<<"\nfEMVisAtStep: "<<fEMSaturation->VisibleEnergyDepositionAtAStep(step)<<"\nfNumScintPhotons: "<<fNumScintPhotons<<"\n";
216  //mf::LogInfo("EMSaturation")<<"fTotalEnergyDeposit: "<< step->GetTotalEnergyDeposit()/CLHEP::MeV<<"\nfNumIonElectrons: "<<fNumIonElectrons<<"\n";
217  }
218  else{
220  fVisibleEnergyDeposition = 0.0; //This is set to zero because I have not made a correct implimentation of this value for anything but EMSaturation.
221  }
222 
223  LOG_DEBUG("ISCalculationSeparate") << "number photons: " << fNumScintPhotons
224  << " energy: " << fEnergyDeposit/CLHEP::MeV
225  << " saturation: "
226  << fEMSaturation->VisibleEnergyDepositionAtAStep(step)
227  << " step length: " << step->GetStepLength()/CLHEP::cm;
228 
229 
230  return;
231  }
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:40
double fModBoxB
from LArG4Parameters service
bool fScintByParticleType
from LArProperties service
double fRecombk
from LArG4Parameters service
double fNumScintPhotons
number of scintillation photons for this step
Definition: ISCalculation.h:41
#define LOG_DEBUG(id)
double fVisibleEnergyDeposition
Definition: ISCalculation.h:42
double fModBoxA
from LArG4Parameters service
double fEnergyDeposit
total energy deposited in the step
Definition: ISCalculation.h:39
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 30 of file ISCalculation.cxx.

Referenced by CalculateIonizationAndScintillation(), and larg4::ISCalculation::VisibleEnergyDeposit().

31  {
32  auto const* SCE = lar::providerFrom<spacecharge::SpaceChargeService>();
33  if (!SCE->EnableSimEfieldSCE()) return fEfield;
34 
35  geo::Point_t midPoint
36  { ( step->GetPreStepPoint()->GetPosition() + step->GetPostStepPoint()->GetPosition() ) * 0.5/CLHEP::cm };
37  auto EfieldDelta = fEfield * SCE->GetEfieldOffsets(midPoint);
38  geo::Vector_t EfieldVec
39  = { fEfield + EfieldDelta.X(), EfieldDelta.Y(), EfieldDelta.Z() };
40  return EfieldVec.R();
41  }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:167
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:187
double larg4::ISCalculation::EnergyDeposit ( ) const
inlineinherited

Definition at line 29 of file ISCalculation.h.

References larg4::ISCalculation::fEnergyDeposit.

Referenced by larg4::IonizationAndScintillation::Reset().

29 { return fEnergyDeposit; }
double fEnergyDeposit
total energy deposited in the step
Definition: ISCalculation.h:39
void larg4::ISCalculationSeparate::Initialize ( )
virtual

Implements larg4::ISCalculation.

Definition at line 37 of file ISCalculationSeparate.cxx.

References detinfo::DetectorProperties::Density(), fEfield, fEMSaturation, fGeVToElectrons, fModBoxA, fModBoxB, fRecombA, fRecombk, fScintByParticleType, fScintYieldFactor, fStepSize, fUseModBoxRecomb, sim::LArG4Parameters::GeVToElectrons(), max, 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().

38  {
40  const detinfo::LArProperties* larp = lar::providerFrom<detinfo::LArPropertiesService>();
41  const detinfo::DetectorProperties* detprop = lar::providerFrom<detinfo::DetectorPropertiesService>();
42 
43  double density = detprop->Density(detprop->Temperature());
44  fEfield = detprop->Efield();
46  fGeVToElectrons = lgpHandle->GeVToElectrons();
47 
48  // \todo get scintillation yield from LArG4Parameters or LArProperties
49  fScintYieldFactor = 1.;
50 
51  // the recombination coefficient is in g/(MeVcm^2), but
52  // we report energy depositions in MeV/cm, need to divide
53  // Recombk from the LArG4Parameters service by the density
54  // of the argon we got above.
55  fRecombA = lgpHandle->RecombA();
56  fRecombk = lgpHandle->Recombk()/density;
57  fModBoxA = lgpHandle->ModBoxA();
58  fModBoxB = lgpHandle->ModBoxB()/density;
59  fUseModBoxRecomb = lgpHandle->UseModBoxRecomb();
60 
61  // Use Birks Correction in the Scintillation process
62  fEMSaturation = G4LossTableManager::Instance()->EmSaturation();
63 
64  // determine the step size using the voxel sizes
66  double maxsize = std::max(lvc->VoxelSizeX(), std::max(lvc->VoxelSizeY(), lvc->VoxelSizeZ())) * CLHEP::cm;
67 
68  fStepSize = 0.1 * maxsize;
69 
70  return;
71  }
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
Int_t max
Definition: plot.C:27
double fModBoxB
from LArG4Parameters service
bool fScintByParticleType
from LArProperties service
double RecombA() const
double fStepSize
maximum step to take
virtual double Density(double temperature) const =0
Returns argon density at a given temperature.
double fRecombk
from LArG4Parameters service
double ModBoxB() const
double Recombk() const
double fModBoxA
from LArG4Parameters service
virtual bool ScintByParticleType() const =0
double GeVToElectrons() const
double larg4::ISCalculation::NumberIonizationElectrons ( ) const
inlineinherited

Definition at line 30 of file ISCalculation.h.

References larg4::ISCalculation::fNumIonElectrons.

Referenced by larg4::IonizationAndScintillation::Reset().

30 { return fNumIonElectrons; }
double fNumIonElectrons
number of ionization electrons for this step
Definition: ISCalculation.h:40
double larg4::ISCalculation::NumberScintillationPhotons ( ) const
inlineinherited

Definition at line 31 of file ISCalculation.h.

References larg4::ISCalculation::fNumScintPhotons.

Referenced by larg4::IonizationAndScintillation::Reset().

31 { return fNumScintPhotons; }
double fNumScintPhotons
number of scintillation photons for this step
Definition: ISCalculation.h:41
void larg4::ISCalculationSeparate::Reset ( )
virtual

Implements larg4::ISCalculation.

Definition at line 75 of file ISCalculationSeparate.cxx.

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

76  {
77  fEnergyDeposit = 0.;
78  fNumScintPhotons = 0.;
79  fNumIonElectrons = 0.;
80 
81  return;
82  }
double fNumIonElectrons
number of ionization electrons for this step
Definition: ISCalculation.h:40
double fNumScintPhotons
number of scintillation photons for this step
Definition: ISCalculation.h:41
double fEnergyDeposit
total energy deposited in the step
Definition: ISCalculation.h:39
double larg4::ISCalculationSeparate::StepSizeLimit ( ) const
inlinevirtual

Implements larg4::ISCalculation.

Definition at line 33 of file ISCalculationSeparate.h.

33 { 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 38 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and Initialize().

G4EmSaturation* larg4::ISCalculationSeparate::fEMSaturation
private

pointer to EM saturation

Definition at line 47 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and Initialize().

double larg4::ISCalculation::fEnergyDeposit
protectedinherited
double larg4::ISCalculationSeparate::fGeVToElectrons
private

conversion factor from LArProperties service

Definition at line 39 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and Initialize().

double larg4::ISCalculationSeparate::fModBoxA
private

from LArG4Parameters service

Definition at line 42 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and Initialize().

double larg4::ISCalculationSeparate::fModBoxB
private

from LArG4Parameters service

Definition at line 43 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and Initialize().

double larg4::ISCalculation::fNumIonElectrons
protectedinherited
double larg4::ISCalculation::fNumScintPhotons
protectedinherited
double larg4::ISCalculationSeparate::fRecombA
private

from LArG4Parameters service

Definition at line 40 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and Initialize().

double larg4::ISCalculationSeparate::fRecombk
private

from LArG4Parameters service

Definition at line 41 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and Initialize().

bool larg4::ISCalculationSeparate::fScintByParticleType
private

from LArProperties service

Definition at line 45 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and Initialize().

double larg4::ISCalculationSeparate::fScintYieldFactor
private

scintillation yield factor

Definition at line 46 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and Initialize().

double larg4::ISCalculationSeparate::fStepSize
private

maximum step to take

Definition at line 37 of file ISCalculationSeparate.h.

Referenced by Initialize().

bool larg4::ISCalculationSeparate::fUseModBoxRecomb
private

from LArG4Parameters service

Definition at line 44 of file ISCalculationSeparate.h.

Referenced by CalculateIonizationAndScintillation(), and Initialize().

double larg4::ISCalculation::fVisibleEnergyDeposition
protectedinherited

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