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

#include "ISCalcSeparate.h"

Public Member Functions

 ISCalcSeparate ()
 
virtual ~ISCalcSeparate ()
 
void Initialize (const detinfo::LArProperties *larp, const detinfo::DetectorProperties *detp, const sim::LArG4Parameters *lgp, const spacecharge::SpaceCharge *sce)
 
void Reset ()
 
void CalculateIonizationAndScintillation (sim::SimEnergyDeposit const &edep)
 
double EnergyDeposit () const
 
double NumberIonizationElectrons () const
 
double NumberScintillationPhotons () const
 
double EFieldAtStep (double efield, sim::SimEnergyDeposit const &edep)
 

Private Member Functions

double EFieldAtStep (double efield, float x, float y, float z)
 
void CalculateIonization (float e, float ds, float x, float y, float z)
 
void CalculateIonization (sim::SimEnergyDeposit const &edep)
 
void CalculateScintillation (float e, int pdg)
 
void CalculateScintillation (sim::SimEnergyDeposit const &edep)
 

Private Attributes

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...
 
double fGeVToElectrons
 from LArG4Parameters service More...
 
double fScintYieldFactor
 scintillation yield factor More...
 
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...
 
geo::Vector_t fEfieldOffsets
 
const detinfo::LArPropertiesfLArProp
 
const spacecharge::SpaceChargefSCE
 
const detinfo::DetectorPropertiesfDetProp
 
const sim::LArG4ParametersfLArG4Prop
 

Detailed Description

Definition at line 26 of file ISCalcSeparate.h.

Constructor & Destructor Documentation

larg4::ISCalcSeparate::ISCalcSeparate ( )

Definition at line 35 of file ISCalcSeparate.cxx.

36  {
37  }
larg4::ISCalcSeparate::~ISCalcSeparate ( )
virtual

Definition at line 40 of file ISCalcSeparate.cxx.

41  {
42  }

Member Function Documentation

void larg4::ISCalcSeparate::CalculateIonization ( float  e,
float  ds,
float  x,
float  y,
float  z 
)
private

Definition at line 91 of file ISCalcSeparate.cxx.

References detinfo::DetectorProperties::Efield(), EFieldAtStep(), fDetProp, fEnergyDeposit, fGeVToElectrons, fModBoxA, fModBoxB, fNumIonElectrons, fRecombA, fRecombk, fUseModBoxRecomb, LOG_DEBUG, x, y, and z.

Referenced by CalculateIonization(), and CalculateIonizationAndScintillation().

92  {
93 
94  //TRACEN(TNAME,3,"Calculate ionization called with e=%f, ds=%f, (x,y,z)=(%f,%f,%f)",
95  // e,ds,x,y,z);
96  //TRACEN(TNAME,3,"Initialized values: RecombA=%lf, Recombk=%lf, ModBoxA=%lf, ModBoxB=%lf, UseModBoxRecomb=%d",
97  // fRecombA, fRecombk, fModBoxA, fModBoxB, fUseModBoxRecomb);
98 
99  double recomb = 0.;
100  double dEdx = (ds<=0.0)? 0.0: e/ds;
101  double EFieldStep = EFieldAtStep(fDetProp->Efield(),x,y,z);
102 
103  // Guard against spurious values of dE/dx. Note: assumes density of LAr
104  if(dEdx < 1.) dEdx = 1.;
105 
106  //TRACEN(TNAME,3,"dEdx=%f, EFieldStep=%f",dEdx,EFieldStep);
107 
108  if(fUseModBoxRecomb) {
109  if(ds>0){
110  double Xi = fModBoxB * dEdx / EFieldStep;
111  recomb = log(fModBoxA + Xi) / Xi;
112  }
113  else
114  recomb = 0;
115  }
116  else{
117  recomb = fRecombA / (1. + dEdx * fRecombk / EFieldStep);
118  }
119 
120  //TRACEN(TNAME,3,"recomb=%f",recomb);
121 
122  // 1.e-3 converts fEnergyDeposit to GeV
123  fNumIonElectrons = fGeVToElectrons * 1.e-3 * e * recomb;
124 
125  //TRACEN(TNAME,3,"n_electrons=%f",fNumIonElectrons);
126 
127  LOG_DEBUG("ISCalcSeparate")
128  << " Electrons produced for " << fEnergyDeposit
129  << " MeV deposited with " << recomb
130  << " recombination: " << fNumIonElectrons << std::endl;
131  }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
double fModBoxA
from LArG4Parameters service
double fRecombk
from LArG4Parameters service
double fEnergyDeposit
total energy deposited in the step
const detinfo::DetectorProperties * fDetProp
double fNumIonElectrons
number of ionization electrons for this step
double fRecombA
from LArG4Parameters service
double fGeVToElectrons
from LArG4Parameters service
#define LOG_DEBUG(id)
double fModBoxB
from LArG4Parameters service
virtual double Efield(unsigned int planegap=0) const =0
Returns the nominal electric field in the specified volume.
Float_t e
Definition: plot.C:34
double EFieldAtStep(double efield, sim::SimEnergyDeposit const &edep)
bool fUseModBoxRecomb
from LArG4Parameters service
void larg4::ISCalcSeparate::CalculateIonization ( sim::SimEnergyDeposit const &  edep)
private

Definition at line 135 of file ISCalcSeparate.cxx.

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

135  {
136  CalculateIonization(edep.Energy(),edep.StepLength(),
137  edep.MidPointX(),edep.MidPointY(),edep.MidPointZ());
138  }
void CalculateIonization(float e, float ds, float x, float y, float z)
Double_t edep
Definition: macro.C:13
void larg4::ISCalcSeparate::CalculateIonizationAndScintillation ( sim::SimEnergyDeposit const &  edep)

Definition at line 192 of file ISCalcSeparate.cxx.

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

Referenced by larg4::ISCalculationAna::analyze(), spacecharge::ShiftEdepSCE::produce(), detsim::SimDriftElectrons::produce(), and phot::PhotonLibraryPropagation::produce().

193  {
194  fEnergyDeposit = edep.Energy();
197  }
double fEnergyDeposit
total energy deposited in the step
void CalculateIonization(float e, float ds, float x, float y, float z)
void CalculateScintillation(float e, int pdg)
Double_t edep
Definition: macro.C:13
void larg4::ISCalcSeparate::CalculateScintillation ( float  e,
int  pdg 
)
private

Definition at line 141 of file ISCalcSeparate.cxx.

References detinfo::LArProperties::AlphaScintYield(), e, detinfo::LArProperties::ElectronScintYield(), fLArProp, fNumScintPhotons, fScintYieldFactor, detinfo::LArProperties::KaonScintYield(), LOG_DEBUG, detinfo::LArProperties::MuonScintYield(), detinfo::LArProperties::PionScintYield(), detinfo::LArProperties::ProtonScintYield(), detinfo::LArProperties::ScintByParticleType(), and detinfo::LArProperties::ScintYield().

Referenced by CalculateIonizationAndScintillation(), and CalculateScintillation().

142  {
143  double scintYield = fLArProp->ScintYield(true);
145 
146  LOG_DEBUG("ISCalcSeparate") << "scintillating by particle type";
147 
148  switch(pdg) {
149 
150  case 2212:
151  scintYield = fLArProp->ProtonScintYield(true);
152  break;
153  case 13:
154  case -13:
155  scintYield = fLArProp->MuonScintYield(true);
156  break;
157  case 211:
158  case -211:
159  scintYield = fLArProp->PionScintYield(true);
160  break;
161  case 321:
162  case -321:
163  scintYield = fLArProp->KaonScintYield(true);
164  break;
165  case 1000020040:
166  scintYield = fLArProp->AlphaScintYield(true);
167  break;
168  case 11:
169  case -11:
170  case 22:
171  scintYield = fLArProp->ElectronScintYield(true);
172  break;
173  default:
174  scintYield = fLArProp->ElectronScintYield(true);
175 
176  }
177 
178  fNumScintPhotons = scintYield * e;
179  }
180  else
181  fNumScintPhotons = fScintYieldFactor * scintYield * e;
182 
183  }
double fNumScintPhotons
number of scintillation photons for this step
const detinfo::LArProperties * fLArProp
virtual double AlphaScintYield(bool prescale=false) const =0
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 fScintYieldFactor
scintillation yield factor
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 LOG_DEBUG(id)
Float_t e
Definition: plot.C:34
virtual bool ScintByParticleType() const =0
void larg4::ISCalcSeparate::CalculateScintillation ( sim::SimEnergyDeposit const &  edep)
private

Definition at line 186 of file ISCalcSeparate.cxx.

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

187  {
188  CalculateScintillation(edep.Energy(),edep.PdgCode());
189  }
void CalculateScintillation(float e, int pdg)
Double_t edep
Definition: macro.C:13
double larg4::ISCalcSeparate::EFieldAtStep ( double  efield,
sim::SimEnergyDeposit const &  edep 
)

Definition at line 199 of file ISCalcSeparate.cxx.

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

Referenced by CalculateIonization().

200  {
201  return EFieldAtStep(efield,
202  edep.MidPointX(),edep.MidPointY(),edep.MidPointZ());
203  }
Double_t edep
Definition: macro.C:13
double EFieldAtStep(double efield, sim::SimEnergyDeposit const &edep)
double larg4::ISCalcSeparate::EFieldAtStep ( double  efield,
float  x,
float  y,
float  z 
)
private

Definition at line 205 of file ISCalcSeparate.cxx.

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

206  {
207  double EField = efield;
208  if (fSCE->EnableSimEfieldSCE())
209  {
211  EField = std::sqrt( (efield + efield*fEfieldOffsets.X())*(efield + efield*fEfieldOffsets.X()) +
212  (efield*fEfieldOffsets.Y()*efield*fEfieldOffsets.Y()) +
213  (efield*fEfieldOffsets.Z()*efield*fEfieldOffsets.Z()) );
214  }
215  return EField;
216  }
Float_t x
Definition: compare.C:6
virtual bool EnableSimEfieldSCE() const =0
geo::Vector_t fEfieldOffsets
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
virtual geo::Vector_t GetEfieldOffsets(geo::Point_t const &point) const =0
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:187
double larg4::ISCalcSeparate::EnergyDeposit ( ) const
inline

Definition at line 39 of file ISCalcSeparate.h.

Referenced by larg4::ISCalculationAna::analyze().

39 { return fEnergyDeposit; }
double fEnergyDeposit
total energy deposited in the step
void larg4::ISCalcSeparate::Initialize ( const detinfo::LArProperties larp,
const detinfo::DetectorProperties detp,
const sim::LArG4Parameters lgp,
const spacecharge::SpaceCharge sce 
)

Definition at line 45 of file ISCalcSeparate.cxx.

References detinfo::DetectorProperties::Density(), fDetProp, fGeVToElectrons, fLArG4Prop, fLArProp, fModBoxA, fModBoxB, fRecombA, fRecombk, fSCE, fScintYieldFactor, fUseModBoxRecomb, sim::LArG4Parameters::GeVToElectrons(), sim::LArG4Parameters::ModBoxA(), sim::LArG4Parameters::ModBoxB(), sim::LArG4Parameters::RecombA(), sim::LArG4Parameters::Recombk(), Reset(), detinfo::DetectorProperties::Temperature(), and sim::LArG4Parameters::UseModBoxRecomb().

Referenced by spacecharge::ShiftEdepSCE::beginJob(), larg4::ISCalculationAna::beginJob(), detsim::SimDriftElectrons::beginJob(), spacecharge::ShiftEdepSCE::produce(), and phot::PhotonLibraryPropagation::produce().

49  {
50  //TRACEN(TNAME,3,"Initializing called.");
51 
52  fLArProp = larp;
53  fSCE = sce;
54  fDetProp = detp;
55  fLArG4Prop = lgp;
56 
57  // \todo get scintillation yield from LArG4Parameters or LArProperties
58  fScintYieldFactor = 1.;
59 
60  // the recombination coefficient is in g/(MeVcm^2), but
61  // we report energy depositions in MeV/cm, need to divide
62  // Recombk from the LArG4Parameters service by the density
63  // of the argon we got above.
64  fRecombA = lgp->RecombA();
65  fRecombk = lgp->Recombk()/detp->Density(detp->Temperature());
66  fModBoxA = lgp->ModBoxA();
67  fModBoxB = lgp->ModBoxB()/detp->Density(detp->Temperature());
68  fUseModBoxRecomb = (bool)lgp->UseModBoxRecomb();
70 
71  this->Reset();
72 
73  //TRACEN(TNAME,3,"Initialize: RecombA=%f, Recombk=%f, ModBoxA=%f, ModBoxB=%f, UseModBoxRecomb=%d",
74  // fRecombA, fRecombk, fModBoxA, fModBoxB, fUseModBoxRecomb);
75 
76  return;
77  }
const detinfo::LArProperties * fLArProp
double ModBoxA() const
double fModBoxA
from LArG4Parameters service
bool UseModBoxRecomb() const
double fRecombk
from LArG4Parameters service
const sim::LArG4Parameters * fLArG4Prop
const detinfo::DetectorProperties * fDetProp
virtual double Temperature() const =0
double fRecombA
from LArG4Parameters service
double RecombA() const
virtual double Density(double temperature) const =0
Returns argon density at a given temperature.
double fScintYieldFactor
scintillation yield factor
const spacecharge::SpaceCharge * fSCE
double ModBoxB() const
double Recombk() const
double fGeVToElectrons
from LArG4Parameters service
double fModBoxB
from LArG4Parameters service
double GeVToElectrons() const
bool fUseModBoxRecomb
from LArG4Parameters service
double larg4::ISCalcSeparate::NumberIonizationElectrons ( ) const
inline

Definition at line 40 of file ISCalcSeparate.h.

Referenced by larg4::ISCalculationAna::analyze(), spacecharge::ShiftEdepSCE::produce(), and detsim::SimDriftElectrons::produce().

40 { return fNumIonElectrons; }
double fNumIonElectrons
number of ionization electrons for this step
double larg4::ISCalcSeparate::NumberScintillationPhotons ( ) const
inline

Definition at line 41 of file ISCalcSeparate.h.

Referenced by larg4::ISCalculationAna::analyze(), spacecharge::ShiftEdepSCE::produce(), and phot::PhotonLibraryPropagation::produce().

41 { return fNumScintPhotons; }
double fNumScintPhotons
number of scintillation photons for this step
void larg4::ISCalcSeparate::Reset ( )

Definition at line 80 of file ISCalcSeparate.cxx.

References fEnergyDeposit, fNumIonElectrons, and fNumScintPhotons.

Referenced by larg4::ISCalculationAna::analyze(), Initialize(), spacecharge::ShiftEdepSCE::produce(), detsim::SimDriftElectrons::produce(), and phot::PhotonLibraryPropagation::produce().

81  {
82  fEnergyDeposit = 0.;
83  fNumScintPhotons = 0.;
84  fNumIonElectrons = 0.;
85 
86  return;
87  }
double fNumScintPhotons
number of scintillation photons for this step
double fEnergyDeposit
total energy deposited in the step
double fNumIonElectrons
number of ionization electrons for this step

Member Data Documentation

const detinfo::DetectorProperties* larg4::ISCalcSeparate::fDetProp
private

Definition at line 65 of file ISCalcSeparate.h.

Referenced by CalculateIonization(), and Initialize().

geo::Vector_t larg4::ISCalcSeparate::fEfieldOffsets
private

Definition at line 60 of file ISCalcSeparate.h.

Referenced by EFieldAtStep().

double larg4::ISCalcSeparate::fEnergyDeposit
private

total energy deposited in the step

Definition at line 56 of file ISCalcSeparate.h.

Referenced by CalculateIonization(), CalculateIonizationAndScintillation(), and Reset().

double larg4::ISCalcSeparate::fGeVToElectrons
private

from LArG4Parameters service

Definition at line 52 of file ISCalcSeparate.h.

Referenced by CalculateIonization(), and Initialize().

const sim::LArG4Parameters* larg4::ISCalcSeparate::fLArG4Prop
private

Definition at line 66 of file ISCalcSeparate.h.

Referenced by Initialize().

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

Definition at line 63 of file ISCalcSeparate.h.

Referenced by CalculateScintillation(), and Initialize().

double larg4::ISCalcSeparate::fModBoxA
private

from LArG4Parameters service

Definition at line 49 of file ISCalcSeparate.h.

Referenced by CalculateIonization(), and Initialize().

double larg4::ISCalcSeparate::fModBoxB
private

from LArG4Parameters service

Definition at line 50 of file ISCalcSeparate.h.

Referenced by CalculateIonization(), and Initialize().

double larg4::ISCalcSeparate::fNumIonElectrons
private

number of ionization electrons for this step

Definition at line 57 of file ISCalcSeparate.h.

Referenced by CalculateIonization(), and Reset().

double larg4::ISCalcSeparate::fNumScintPhotons
private

number of scintillation photons for this step

Definition at line 58 of file ISCalcSeparate.h.

Referenced by CalculateScintillation(), and Reset().

double larg4::ISCalcSeparate::fRecombA
private

from LArG4Parameters service

Definition at line 47 of file ISCalcSeparate.h.

Referenced by CalculateIonization(), and Initialize().

double larg4::ISCalcSeparate::fRecombk
private

from LArG4Parameters service

Definition at line 48 of file ISCalcSeparate.h.

Referenced by CalculateIonization(), and Initialize().

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

Definition at line 64 of file ISCalcSeparate.h.

Referenced by EFieldAtStep(), and Initialize().

double larg4::ISCalcSeparate::fScintYieldFactor
private

scintillation yield factor

Definition at line 54 of file ISCalcSeparate.h.

Referenced by CalculateScintillation(), and Initialize().

bool larg4::ISCalcSeparate::fUseModBoxRecomb
private

from LArG4Parameters service

Definition at line 51 of file ISCalcSeparate.h.

Referenced by CalculateIonization(), and Initialize().


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