All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ISCalc.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //Class: ISCalc
3 //File: ISCalc.h and ISCalc.cxx
4 //Description: Interface to the ion and scintillation calculation algorithm
5 //2022
6 ////////////////////////////////////////////////////////////////////////
7 
8 
10 
15 
16 namespace larg4 {
17 
18  //----------------------------------------------------------------------------
20  : fLArProp{lar::providerFrom<detinfo::LArPropertiesService>()}
21  {
22  }
23 
24  //----------------------------------------------------------------------------
25  double
26  ISCalc::GetScintYield(sim::SimEnergyDeposit const& edep, bool prescale)
27  {
28  if (!fLArProp->ScintByParticleType()) return fLArProp->ScintYield(true);
29  switch (edep.PdgCode()) {
30  case 2212: return fLArProp->ProtonScintYield(true);
31  case 13:
32  case -13: return fLArProp->MuonScintYield(true);
33  case 211:
34  case -211: return fLArProp->PionScintYield(true);
35  case 321:
36  case -321: return fLArProp->KaonScintYield(true);
37  case 1000020040: return fLArProp->AlphaScintYield(true);
38  case 11:
39  case -11:
40  case 22: return fLArProp->ElectronScintYield(true);
41  default: return fLArProp->ElectronScintYield(true);
42  }
43  }
44 
45  //----------------------------------------------------------------------------
46  double
48  {
49  // ScintByParticleType option only controls the scintillation
50  // yield ratio, which is the ratio of fast light (singlet
51  // component) to the total light (singlet+triplet components).
52 
54 
55  switch (edep.PdgCode()) {
56  case 2212: return fLArProp->ProtonScintYieldRatio();
57  case 13:
58  case -13: return fLArProp->MuonScintYieldRatio();
59  case 211:
60  case -211: return fLArProp->PionScintYieldRatio();
61  case 321:
62  case -321: return fLArProp->KaonScintYieldRatio();
63  case 1000020040: return fLArProp->AlphaScintYieldRatio();
64  case 11:
65  case -11:
66  case 22: return fLArProp->ElectronScintYieldRatio();
67  default: return fLArProp->ElectronScintYieldRatio();
68  }
69  }
70 
71 }
Utilities related to art service access.
virtual double ProtonScintYieldRatio() const =0
virtual double PionScintYieldRatio() const =0
virtual double KaonScintYield(bool prescale=false) const =0
virtual double AlphaScintYieldRatio() const =0
virtual double MuonScintYieldRatio() const =0
virtual double ScintYieldRatio() const =0
virtual double ElectronScintYield(bool prescale=false) const =0
const detinfo::LArProperties * fLArProp
Definition: ISCalc.h:33
virtual double PionScintYield(bool prescale=false) const =0
virtual double KaonScintYieldRatio() const =0
virtual double ProtonScintYield(bool prescale=false) const =0
contains information for a single step in the detector simulation
virtual double ElectronScintYieldRatio() const =0
Energy deposition in the active material.
virtual double ScintYield(bool prescale=false) const =0
virtual double MuonScintYield(bool prescale=false) const =0
double GetScintYield(sim::SimEnergyDeposit const &edep, bool prescale)
Definition: ISCalc.cxx:26
virtual bool ScintByParticleType() const =0
double GetScintYieldRatio(sim::SimEnergyDeposit const &edep)
Definition: ISCalc.cxx:47
virtual double AlphaScintYield(bool prescale=false) const =0