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 ROSIMIONIZATIONANDSCINTILLATION_H
9 #define ROSIMIONIZATIONANDSCINTILLATION_H
10 
11 #include <cstring>
12 #include <memory>
13 
14 #include "fhiclcpp/ParameterSet.h"
15 
18 
19 #include "TH1.h"
20 #include "TH2.h"
21 
22 namespace CLHEP { class HepRandomEngine; }
23 
24 namespace gar {
25  namespace rosim {
26 
27  // The Ionization and Scintillation singleton
29  {
30  public:
31 
32  static IonizationAndScintillation* CreateInstance(CLHEP::HepRandomEngine & engine,
33  fhicl::ParameterSet const& pset);
34  static IonizationAndScintillation* Instance();
35 
36  // Method to reset the internal variables held in the ISCalculation
37  // This method should be called at the start of any G4Step
38  void Reset(const gar::sdp::EnergyDeposit* dep);
39  void reconfigure(fhicl::ParameterSet const& pset);
40 
41  double EnergyDeposit() const { return fISCalc->EnergyDeposit(); }
42  int NumberIonizationElectrons() const { return fISCalc->NumberIonizationElectrons(); }
43  int NumberScintillationPhotons() const { return fISCalc->NumberScintillationPhotons(); }
44  double StepSizeLimit() const { return fISCalc->StepSizeLimit(); }
45 
46  private:
47 
48  IonizationAndScintillation(CLHEP::HepRandomEngine& engine);
50 
51  rosim::ISCalculation* fISCalc; ///< object to calculate ionization and scintillation
52  ///< produced by an energy deposition
53  std::string fISCalculator; ///< name of calculator to use, NEST or Separate
54  const gar::sdp::EnergyDeposit* fEnergyDeposit; ///< reference to the current energy deposit
55  int fStepNumber; ///< last StepNumber checked
56  int fTrkID; ///< last TrkID checked
57 
58  TH1F* fStepSize; ///< histogram of the step sizes
59  TH1F* fElectronsPerStep; ///< histogram of electrons per step
60  TH1F* fPhotonsPerStep; ///< histogram of the photons per step
61  TH1F* fElectronsPerLength; ///< histogram of electrons per dX
62  TH1F* fPhotonsPerLength; ///< histogram of the photons per dX
63  TH1F* fEnergyPerStep; ///< histogram of the energy deposited per step
64  TH1F* fElectronsPerEDep; ///< histogram of electrons per MeV deposited
65  TH1F* fPhotonsPerEDep; ///< histogram of photons per MeV deposited
66  TH2F* fElectronsVsPhotons; ///< histogram of electrons vs photons per step
67  CLHEP::HepRandomEngine& fEngine; ///< random engine
68  };
69 
70  } // namespace rosim
71 
72  } // gar
73 
74  #endif // ROSIMIONIZATIONANDSCINTILLATION
TH1F * fPhotonsPerEDep
histogram of photons per MeV deposited
std::string string
Definition: nybbler.cc:12
const gar::sdp::EnergyDeposit * fEnergyDeposit
reference to the current energy deposit
TH1F * fPhotonsPerLength
histogram of the photons per dX
TH1F * fPhotonsPerStep
histogram of the photons per step
TH1F * fStepSize
histogram of the step sizes
virtual void reconfigure(fhicl::ParameterSet const &pset)
TH1F * fElectronsPerStep
histogram of electrons per step
rosim::ISCalculation * fISCalc
produced by an energy deposition
General GArSoft Utilities.
TH1F * fEnergyPerStep
histogram of the energy deposited per step
TH1F * fElectronsPerEDep
histogram of electrons per MeV deposited
TH1F * fElectronsPerLength
histogram of electrons per dX
TH2F * fElectronsVsPhotons
histogram of electrons vs photons per step
std::string fISCalculator
name of calculator to use, NEST or Separate
CLHEP::HepRandomEngine & fEngine
random engine