IonizationAndScintillation.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file IonizationAndScintillation.h
3 /// \brief Singleton to access a unified treatment of ionization and
4 /// scintillation in LAr
5 ///
6 /// \author brebel@fnal.gov
7 ////////////////////////////////////////////////////////////////////////
8 #ifndef LARG4_IONIZATIONANDSCINTILLATION_H
9 #define LARG4_IONIZATIONANDSCINTILLATION_H
10 
11 #include <memory>
12 #include <string>
13 
15 
16 class G4Step;
17 class TH1F;
18 class TH2F;
19 
20 namespace CLHEP {
21  class HepRandomEngine;
22 }
23 
24 namespace detinfo {
25  class DetectorPropertiesData;
26 }
27 
28 namespace larg4 {
29 
30  // The Ionization and Scintillation singleton
32  public:
33  static IonizationAndScintillation* CreateInstance(
34  detinfo::DetectorPropertiesData const& detProp,
35  CLHEP::HepRandomEngine& engine);
36  static IonizationAndScintillation* Instance();
37 
38  // Method to reset the internal variables held in the ISCalculation
39  // This method should be called at the start of any G4Step
40  void Reset(const G4Step* step);
41 
42  double
43  EnergyDeposit() const
44  {
45  return fISCalc->EnergyDeposit();
46  }
47  double
49  {
50  return fISCalc->VisibleEnergyDeposit();
51  }
52  double
54  {
55  return fISCalc->NumberIonizationElectrons();
56  }
57  double
59  {
60  return fISCalc->NumberScintillationPhotons();
61  }
62  double
63  StepSizeLimit() const
64  {
65  return fISCalc->StepSizeLimit();
66  }
67 
68  private:
70  CLHEP::HepRandomEngine& engine);
71 
72  std::unique_ptr<larg4::ISCalculation>
73  fISCalc; ///< object to calculate ionization and scintillation
74  ///< produced by an energy deposition
75  std::string fISCalculator; ///< name of calculator to use, NEST or Separate
76  G4Step const* fStep{nullptr}; ///< pointer to the current G4 step
77  int fStepNumber{-1}; ///< last StepNumber checked
78  int fTrkID{-1}; ///< last TrkID checked
79 
80  TH1F* fElectronsPerStep{nullptr}; ///< histogram of electrons per step
81  TH1F* fStepSize{nullptr}; ///< histogram of the step sizes
82  TH1F* fPhotonsPerStep{nullptr}; ///< histogram of the photons per step
83  TH1F* fEnergyPerStep{nullptr}; ///< histogram of the energy deposited per step
84  TH1F* fElectronsPerLength; ///< histogram of electrons per cm
85  TH1F* fPhotonsPerLength; ///< histogram of photons per cm
86  TH1F* fElectronsPerEDep; ///< histogram of electrons per MeV deposited
87  TH1F* fPhotonsPerEDep; ///< histogram of photons per MeV deposited
88  TH2F* fElectronsVsPhotons{nullptr}; ///< histogram of electrons vs photons per step
89  CLHEP::HepRandomEngine& fEngine; ///< random engine (needed for NEST)
90  };
91 
92 } // namespace larg4
93 
94 #endif // LARG4_IONIZATIONANDSCINTILLATION
TH1F * fPhotonsPerEDep
histogram of photons per MeV deposited
TH1F * fElectronsPerEDep
histogram of electrons per MeV deposited
std::string string
Definition: nybbler.cc:12
Geant4 interface.
TH1F * fElectronsPerLength
histogram of electrons per cm
std::unique_ptr< larg4::ISCalculation > fISCalc
CLHEP::HepRandomEngine & fEngine
random engine (needed for NEST)
General LArSoft Utilities.
TH1F * fPhotonsPerLength
histogram of photons per cm
std::string fISCalculator
name of calculator to use, NEST or Separate