Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
gar::rosim::IonizationAndScintillation Class Reference

#include <IonizationAndScintillation.h>

Public Member Functions

void Reset (const gar::sdp::EnergyDeposit *dep)
 
void reconfigure (fhicl::ParameterSet const &pset)
 
double EnergyDeposit () const
 
int NumberIonizationElectrons () const
 
int NumberScintillationPhotons () const
 
double StepSizeLimit () const
 

Static Public Member Functions

static IonizationAndScintillationCreateInstance (CLHEP::HepRandomEngine &engine, fhicl::ParameterSet const &pset)
 
static IonizationAndScintillationInstance ()
 

Private Member Functions

 IonizationAndScintillation (CLHEP::HepRandomEngine &engine)
 
 ~IonizationAndScintillation ()
 

Private Attributes

rosim::ISCalculationfISCalc
 produced by an energy deposition More...
 
std::string fISCalculator
 name of calculator to use, NEST or Separate More...
 
const gar::sdp::EnergyDepositfEnergyDeposit
 reference to the current energy deposit More...
 
int fStepNumber
 last StepNumber checked More...
 
int fTrkID
 last TrkID checked More...
 
TH1F * fStepSize
 histogram of the step sizes More...
 
TH1F * fElectronsPerStep
 histogram of electrons per step More...
 
TH1F * fPhotonsPerStep
 histogram of the photons per step More...
 
TH1F * fElectronsPerLength
 histogram of electrons per dX More...
 
TH1F * fPhotonsPerLength
 histogram of the photons per dX More...
 
TH1F * fEnergyPerStep
 histogram of the energy deposited per step More...
 
TH1F * fElectronsPerEDep
 histogram of electrons per MeV deposited More...
 
TH1F * fPhotonsPerEDep
 histogram of photons per MeV deposited More...
 
TH2F * fElectronsVsPhotons
 histogram of electrons vs photons per step More...
 
CLHEP::HepRandomEngine & fEngine
 random engine More...
 

Detailed Description

Definition at line 28 of file IonizationAndScintillation.h.

Constructor & Destructor Documentation

gar::rosim::IonizationAndScintillation::IonizationAndScintillation ( CLHEP::HepRandomEngine &  engine)
private

Definition at line 52 of file IonizationAndScintillation.cxx.

53  : fISCalc (nullptr)
54  , fEnergyDeposit (nullptr)
55  , fStepSize (nullptr)
56  , fElectronsPerStep (nullptr)
57  , fPhotonsPerStep (nullptr)
58  , fEnergyPerStep (nullptr)
59  , fElectronsVsPhotons(nullptr)
60  , fEngine (engine)
61  {
62 
63  //set the current track and step number values to bogus so that it will run the first reset:
64  fStepNumber = -1;
65  fTrkID = -1;
66 
67  // make the histograms
69 
70  fElectronsPerStep = tfs->make<TH1F>("electronsPerStep", ";Electrons;Steps",
71  500, 0., 5000.);
72  fPhotonsPerStep = tfs->make<TH1F>("photonsPerStep", ";Photons;Steps",
73  500, 0., 5000.);
74  fEnergyPerStep = tfs->make<TH1F>("energyPerStep", ";Energy (MeV);Steps",
75  100, 0., 0.5);
76  fStepSize = tfs->make<TH1F>("stepSize", ";Step Size (CLHEP::cm);Steps",
77  500, 0., 0.2);
78  fElectronsPerLength = tfs->make<TH1F>("electronsPerLength", ";Electrons #times 10^{3}/CLHEP::cm;Steps",
79  1000, 0., 1000.);
80  fPhotonsPerLength = tfs->make<TH1F>("photonsPerLength", ";Photons #times 10^{3}/CLHEP::cm;Steps",
81  1000, 0., 1000.);
82  fElectronsPerEDep = tfs->make<TH1F>("electronsPerEDep", ";Electrons #times 10^{3}/MeV;Steps",
83  1000, 0., 1000.);
84  fPhotonsPerEDep = tfs->make<TH1F>("photonsPerEDep", ";Photons #times 10^{3}/MeV;Steps",
85  1000, 0., 1000.);
86 
87  fElectronsVsPhotons = tfs->make<TH2F>("electronsVsPhotons", ";Photons;Electrons",
88  500, 0., 5000., 500, 0., 5000.);
89 
90  return;
91  }
TH1F * fPhotonsPerEDep
histogram of photons per MeV deposited
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
TH1F * fElectronsPerStep
histogram of electrons per step
rosim::ISCalculation * fISCalc
produced by an energy deposition
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
CLHEP::HepRandomEngine & fEngine
random engine
gar::rosim::IonizationAndScintillation::~IonizationAndScintillation ( )
private

Definition at line 94 of file IonizationAndScintillation.cxx.

95  {
96  }

Member Function Documentation

IonizationAndScintillation * gar::rosim::IonizationAndScintillation::CreateInstance ( CLHEP::HepRandomEngine &  engine,
fhicl::ParameterSet const &  pset 
)
static

Definition at line 29 of file IonizationAndScintillation.cxx.

31  {
33 
34  gInstance->reconfigure(pset);
35 
36  return gInstance;
37  }
static IonizationAndScintillation * gInstance
IonizationAndScintillation(CLHEP::HepRandomEngine &engine)
void reconfigure(fhicl::ParameterSet const &pset)
double gar::rosim::IonizationAndScintillation::EnergyDeposit ( ) const
inline

Definition at line 41 of file IonizationAndScintillation.h.

41 { return fISCalc->EnergyDeposit(); }
virtual double EnergyDeposit() const =0
rosim::ISCalculation * fISCalc
produced by an energy deposition
IonizationAndScintillation * gar::rosim::IonizationAndScintillation::Instance ( )
static

Definition at line 40 of file IonizationAndScintillation.cxx.

41  {
42  // the instance must have been created already by CreateInstance()
43  if(!gInstance)
44  throw cet::exception("IonizationAndScintillation")
45  << "instance pointer is null, that is bad";
46 
47  return gInstance;
48  }
static IonizationAndScintillation * gInstance
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
int gar::rosim::IonizationAndScintillation::NumberIonizationElectrons ( ) const
inline

Definition at line 42 of file IonizationAndScintillation.h.

virtual int NumberIonizationElectrons() const =0
rosim::ISCalculation * fISCalc
produced by an energy deposition
int gar::rosim::IonizationAndScintillation::NumberScintillationPhotons ( ) const
inline

Definition at line 43 of file IonizationAndScintillation.h.

rosim::ISCalculation * fISCalc
produced by an energy deposition
virtual int NumberScintillationPhotons() const =0
void gar::rosim::IonizationAndScintillation::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 99 of file IonizationAndScintillation.cxx.

100  {
101  if(fISCalc){
102  delete fISCalc;
103  fISCalc = nullptr;
104  }
105 
106  auto calcName = pset.get<std::string>("ISCalcName");
107 
108  if(calcName.compare("NEST") == 0)
109  fISCalc = new rosim::ISCalculationNEST(fEngine);
110  else if(calcName.compare("Separate") == 0)
111  fISCalc = new rosim::ISCalculationSeparate(fEngine);
112  else
113  MF_LOG_WARNING("IonizationAndScintillation")
114  << "No ISCalculation set, this can't be good.";
115 
116  // initialize the calculator
117  fISCalc->Initialize();
118 
119  return;
120  }
std::string string
Definition: nybbler.cc:12
virtual void Initialize()=0
rosim::ISCalculation * fISCalc
produced by an energy deposition
#define MF_LOG_WARNING(category)
CLHEP::HepRandomEngine & fEngine
random engine
void gar::rosim::IonizationAndScintillation::Reset ( const gar::sdp::EnergyDeposit dep)

Definition at line 123 of file IonizationAndScintillation.cxx.

124  {
125 
126  // TODO fix these lines, ie figure out how to do this with EDeps
127  // ===
128  //if(fStepNumber == step->GetTrack()->GetCurrentStepNumber() &&
129  //fTrkID == step->GetTrack()->GetTrackID())
130  //return;
131 
132  //fStepNumber = step->GetTrack()->GetCurrentStepNumber();
133  //fTrkID = step->GetTrack()->GetTrackID();
134  // ===
135 
136  fEnergyDeposit = dep;
137 
138  // reset the calculator
139  fISCalc->Reset();
140 
141  // double check that the energy deposit is non-zero
142  // then do the calculation if it is
143  if( fEnergyDeposit->Energy() > 0 ){
144 
146 
147  MF_LOG_DEBUG("IonizationAndScintillation")
148  << "\nEnergy: " << fISCalc->EnergyDeposit()
149  << "\nElectrons: " << fISCalc->NumberIonizationElectrons()
150  << "\nPhotons: " << fISCalc->NumberScintillationPhotons();
151 
152  // Fill the histograms
160 
161  } // end if the energy deposition is non-zero
162 
163  return;
164  }
TH1F * fPhotonsPerEDep
histogram of photons per MeV deposited
float const & Energy() const
Definition: EnergyDeposit.h:42
const gar::sdp::EnergyDeposit * fEnergyDeposit
reference to the current energy deposit
virtual double EnergyDeposit() const =0
TH1F * fPhotonsPerStep
histogram of the photons per step
TH1F * fElectronsPerStep
histogram of electrons per step
virtual void Reset()=0
virtual int NumberIonizationElectrons() const =0
rosim::ISCalculation * fISCalc
produced by an energy deposition
TH1F * fEnergyPerStep
histogram of the energy deposited per step
TH1F * fElectronsPerEDep
histogram of electrons per MeV deposited
#define MF_LOG_DEBUG(id)
TH2F * fElectronsVsPhotons
histogram of electrons vs photons per step
virtual int NumberScintillationPhotons() const =0
virtual void CalculateIonizationAndScintillation(const gar::sdp::EnergyDeposit *dep)=0
double gar::rosim::IonizationAndScintillation::StepSizeLimit ( ) const
inline

Definition at line 44 of file IonizationAndScintillation.h.

44 { return fISCalc->StepSizeLimit(); }
rosim::ISCalculation * fISCalc
produced by an energy deposition
virtual double StepSizeLimit() const =0

Member Data Documentation

TH1F* gar::rosim::IonizationAndScintillation::fElectronsPerEDep
private

histogram of electrons per MeV deposited

Definition at line 64 of file IonizationAndScintillation.h.

TH1F* gar::rosim::IonizationAndScintillation::fElectronsPerLength
private

histogram of electrons per dX

Definition at line 61 of file IonizationAndScintillation.h.

TH1F* gar::rosim::IonizationAndScintillation::fElectronsPerStep
private

histogram of electrons per step

Definition at line 59 of file IonizationAndScintillation.h.

TH2F* gar::rosim::IonizationAndScintillation::fElectronsVsPhotons
private

histogram of electrons vs photons per step

Definition at line 66 of file IonizationAndScintillation.h.

const gar::sdp::EnergyDeposit* gar::rosim::IonizationAndScintillation::fEnergyDeposit
private

reference to the current energy deposit

Definition at line 54 of file IonizationAndScintillation.h.

TH1F* gar::rosim::IonizationAndScintillation::fEnergyPerStep
private

histogram of the energy deposited per step

Definition at line 63 of file IonizationAndScintillation.h.

CLHEP::HepRandomEngine& gar::rosim::IonizationAndScintillation::fEngine
private

random engine

Definition at line 67 of file IonizationAndScintillation.h.

rosim::ISCalculation* gar::rosim::IonizationAndScintillation::fISCalc
private

produced by an energy deposition

object to calculate ionization and scintillation

Definition at line 51 of file IonizationAndScintillation.h.

std::string gar::rosim::IonizationAndScintillation::fISCalculator
private

name of calculator to use, NEST or Separate

Definition at line 53 of file IonizationAndScintillation.h.

TH1F* gar::rosim::IonizationAndScintillation::fPhotonsPerEDep
private

histogram of photons per MeV deposited

Definition at line 65 of file IonizationAndScintillation.h.

TH1F* gar::rosim::IonizationAndScintillation::fPhotonsPerLength
private

histogram of the photons per dX

Definition at line 62 of file IonizationAndScintillation.h.

TH1F* gar::rosim::IonizationAndScintillation::fPhotonsPerStep
private

histogram of the photons per step

Definition at line 60 of file IonizationAndScintillation.h.

int gar::rosim::IonizationAndScintillation::fStepNumber
private

last StepNumber checked

Definition at line 55 of file IonizationAndScintillation.h.

TH1F* gar::rosim::IonizationAndScintillation::fStepSize
private

histogram of the step sizes

Definition at line 58 of file IonizationAndScintillation.h.

int gar::rosim::IonizationAndScintillation::fTrkID
private

last TrkID checked

Definition at line 56 of file IonizationAndScintillation.h.


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