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

#include "IonizationAndScintillation.h"

Public Member Functions

void Reset (const G4Step *step)
 
double EnergyDeposit () const
 
double VisibleEnergyDeposit () const
 
double NumberIonizationElectrons () const
 
double NumberScintillationPhotons () const
 
double StepSizeLimit () const
 

Static Public Member Functions

static IonizationAndScintillationCreateInstance (CLHEP::HepRandomEngine &engine)
 
static IonizationAndScintillationInstance ()
 

Private Member Functions

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

Private Attributes

larg4::ISCalculationfISCalc
 
std::string fISCalculator
 name of calculator to use, NEST or Separate More...
 
G4Step const * fStep
 pointer to the current G4 step More...
 
int fStepNumber
 last StepNumber checked More...
 
int fTrkID
 last TrkID checked More...
 
TH1F * fElectronsPerStep
 histogram of electrons per step More...
 
TH1F * fStepSize
 histogram of the step sizes More...
 
TH1F * fPhotonsPerStep
 histogram of the photons per step More...
 
TH1F * fEnergyPerStep
 histogram of the energy deposited per step More...
 
TH1F * fElectronsPerLength
 histogram of electrons per cm More...
 
TH1F * fPhotonsPerLength
 histogram of photons per cm 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 25 of file IonizationAndScintillation.h.

Constructor & Destructor Documentation

larg4::IonizationAndScintillation::IonizationAndScintillation ( CLHEP::HepRandomEngine &  engine)
private

Definition at line 48 of file IonizationAndScintillation.cxx.

References fElectronsPerEDep, fElectronsPerLength, fElectronsPerStep, fElectronsVsPhotons, fEnergyPerStep, fEngine, fISCalc, fISCalculator, fPhotonsPerEDep, fPhotonsPerLength, fPhotonsPerStep, fStepNumber, fStepSize, fTrkID, larg4::ISCalculation::Initialize(), sim::LArG4Parameters::IonAndScintCalculator(), art::TFileDirectory::make(), and larg4::ISCalculation::Reset().

Referenced by Instance().

49  : fISCalc(0)
50  , fStep(0)
52  , fStepSize(0)
53  , fPhotonsPerStep(0)
54  , fEnergyPerStep(0)
56  , fEngine(engine)
57  {
60 
61  if(fISCalculator.compare("NEST") == 0)
63  else if(fISCalculator.compare("Separate") == 0)
65  else
66  mf::LogWarning("IonizationAndScintillation") << "No ISCalculation set, this can't be good.";
67 
68  // Reset the values for the electrons, photons, and energy to 0
69  // in the calculator
70  fISCalc->Reset();
71  //set the current track and step number values to bogus so that it will run the first reset:
72  fStepNumber=-1;
73  fTrkID=-1;
74 
75  // initialize the calculator
77 
78  // make the histograms
80 
81  fElectronsPerStep = tfs->make<TH1F>("electronsPerStep", ";Electrons;Steps",
82  500, 0., 5000.);
83  fPhotonsPerStep = tfs->make<TH1F>("photonsPerStep", ";Photons;Steps",
84  500, 0., 5000.);
85  fEnergyPerStep = tfs->make<TH1F>("energyPerStep", ";Energy (MeV);Steps",
86  100, 0., 0.5);
87  fStepSize = tfs->make<TH1F>("stepSize", ";Step Size (CLHEP::cm);Steps",
88  500, 0., 0.2);
89  fElectronsPerLength = tfs->make<TH1F>("electronsPerLength", ";Electrons #times 10^{3}/CLHEP::cm;Steps",
90  1000, 0., 1000.);
91  fPhotonsPerLength = tfs->make<TH1F>("photonsPerLength", ";Photons #times 10^{3}/CLHEP::cm;Steps",
92  1000, 0., 1000.);
93  fElectronsPerEDep = tfs->make<TH1F>("electronsPerEDep", ";Electrons #times 10^{3}/MeV;Steps",
94  1000, 0., 1000.);
95  fPhotonsPerEDep = tfs->make<TH1F>("photonsPerEDep", ";Photons #times 10^{3}/MeV;Steps",
96  1000, 0., 1000.);
97 
98  fElectronsVsPhotons = tfs->make<TH2F>("electronsVsPhotons", ";Photons;Electrons",
99  500, 0., 5000., 500, 0., 5000.);
100 
101  return;
102  }
TH1F * fPhotonsPerEDep
histogram of photons per MeV deposited
TH1F * fElectronsPerEDep
histogram of electrons per MeV deposited
virtual void Initialize()=0
const std::string IonAndScintCalculator() const
G4Step const * fStep
pointer to the current G4 step
TH1F * fElectronsPerLength
histogram of electrons per cm
virtual void Reset()=0
CLHEP::HepRandomEngine & fEngine
random engine
TH1F * fStepSize
histogram of the step sizes
TH1F * fElectronsPerStep
histogram of electrons per step
T * make(ARGS...args) const
TH1F * fPhotonsPerStep
histogram of the photons per step
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
TH1F * fEnergyPerStep
histogram of the energy deposited per step
TH1F * fPhotonsPerLength
histogram of photons per cm
TH2F * fElectronsVsPhotons
histogram of electrons vs photons per step
std::string fISCalculator
name of calculator to use, NEST or Separate
larg4::IonizationAndScintillation::~IonizationAndScintillation ( )
private

Definition at line 105 of file IonizationAndScintillation.cxx.

References fISCalc.

106  {
107  if(fISCalc) delete fISCalc;
108  }

Member Function Documentation

IonizationAndScintillation * larg4::IonizationAndScintillation::CreateInstance ( CLHEP::HepRandomEngine &  engine)
static

Definition at line 31 of file IonizationAndScintillation.cxx.

References larg4::gInstance.

Referenced by larg4::LArG4::beginJob().

32  {
34  return gInstance;
35  }
IonizationAndScintillation(CLHEP::HepRandomEngine &engine)
static IonizationAndScintillation * gInstance
double larg4::IonizationAndScintillation::EnergyDeposit ( ) const
inline

Definition at line 36 of file IonizationAndScintillation.h.

Referenced by larg4::LArVoxelReadout::DriftIonizationElectrons().

36 { return fISCalc->EnergyDeposit(); }
double EnergyDeposit() const
Definition: ISCalculation.h:29
IonizationAndScintillation * larg4::IonizationAndScintillation::Instance ( )
static
double larg4::IonizationAndScintillation::NumberIonizationElectrons ( ) const
inline
double larg4::IonizationAndScintillation::NumberScintillationPhotons ( ) const
inline

Definition at line 39 of file IonizationAndScintillation.h.

Referenced by larg4::OpFastScintillation::PostStepDoIt().

double NumberScintillationPhotons() const
Definition: ISCalculation.h:31
void larg4::IonizationAndScintillation::Reset ( const G4Step *  step)

Definition at line 112 of file IonizationAndScintillation.cxx.

References larg4::ISCalculation::CalculateIonizationAndScintillation(), larg4::ISCalculation::EnergyDeposit(), fElectronsPerEDep, fElectronsPerLength, fElectronsPerStep, fElectronsVsPhotons, fEnergyPerStep, fISCalc, fPhotonsPerEDep, fPhotonsPerLength, fPhotonsPerStep, fStep, fStepNumber, fStepSize, fTrkID, LOG_DEBUG, larg4::ISCalculation::NumberIonizationElectrons(), larg4::ISCalculation::NumberScintillationPhotons(), and larg4::ISCalculation::Reset().

Referenced by larg4::OpFastScintillation::PostStepDoIt(), larg4::LArVoxelReadout::ProcessHits(), and larg4::IonizationAndScintillationAction::SteppingAction().

113  {
114 
115  if(fStepNumber==step->GetTrack()->GetCurrentStepNumber() && fTrkID==step->GetTrack()->GetTrackID())
116  return;
117 
118  fStepNumber=step->GetTrack()->GetCurrentStepNumber();
119  fTrkID=step->GetTrack()->GetTrackID();
120 
121  fStep = step;
122 
123  // reset the calculator
124  fISCalc->Reset();
125 
126  // check the material for this step and be sure it is LAr
127  if(step->GetTrack()->GetMaterial()->GetName() != "LAr") return;
128 
129  // double check that the energy deposit is non-zero
130  // then do the calculation if it is
131  if( step->GetTotalEnergyDeposit() > 0 ){
132 
134 
135  LOG_DEBUG("IonizationAndScintillation") << "Step Size: " << fStep->GetStepLength()/CLHEP::cm
136  << "\nEnergy: " << fISCalc->EnergyDeposit()
137  << "\nElectrons: " << fISCalc->NumberIonizationElectrons()
138  << "\nPhotons: " << fISCalc->NumberScintillationPhotons();
139 
140  G4ThreeVector totstep = fStep->GetPostStepPoint()->GetPosition();
141  totstep -= fStep->GetPreStepPoint()->GetPosition();
142 
143  // Fill the histograms
144  fStepSize ->Fill(totstep.mag()/CLHEP::cm);
150  double const stepSize = totstep.mag()/CLHEP::cm;
151  if (stepSize > 0.0) {
152  fElectronsPerLength->Fill(fISCalc->NumberIonizationElectrons()*1.e-3/stepSize);
153  fPhotonsPerLength ->Fill(fISCalc->NumberScintillationPhotons()*1.e-3/stepSize);
154  }
155  double const energyDep = fISCalc->EnergyDeposit();
156  if (energyDep) {
157  fElectronsPerEDep ->Fill(fISCalc->NumberIonizationElectrons()*1.e-3/energyDep);
158  fPhotonsPerEDep ->Fill(fISCalc->NumberScintillationPhotons()*1.e-3/energyDep);
159  }
160 
161  } // end if the energy deposition is non-zero
162 
163  return;
164  }
TH1F * fPhotonsPerEDep
histogram of photons per MeV deposited
TH1F * fElectronsPerEDep
histogram of electrons per MeV deposited
virtual void CalculateIonizationAndScintillation(const G4Step *step)=0
G4Step const * fStep
pointer to the current G4 step
TH1F * fElectronsPerLength
histogram of electrons per cm
double NumberScintillationPhotons() const
Definition: ISCalculation.h:31
double NumberIonizationElectrons() const
Definition: ISCalculation.h:30
virtual void Reset()=0
TH1F * fStepSize
histogram of the step sizes
TH1F * fElectronsPerStep
histogram of electrons per step
double EnergyDeposit() const
Definition: ISCalculation.h:29
TH1F * fPhotonsPerStep
histogram of the photons per step
TH1F * fEnergyPerStep
histogram of the energy deposited per step
#define LOG_DEBUG(id)
TH1F * fPhotonsPerLength
histogram of photons per cm
TH2F * fElectronsVsPhotons
histogram of electrons vs photons per step
double larg4::IonizationAndScintillation::StepSizeLimit ( ) const
inline

Definition at line 40 of file IonizationAndScintillation.h.

Referenced by larg4::LArVoxelReadoutGeometry::LArVoxelReadoutGeometry().

40 { return fISCalc->StepSizeLimit(); }
virtual double StepSizeLimit() const =0
double larg4::IonizationAndScintillation::VisibleEnergyDeposit ( ) const
inline

Member Data Documentation

TH1F* larg4::IonizationAndScintillation::fElectronsPerEDep
private

histogram of electrons per MeV deposited

Definition at line 60 of file IonizationAndScintillation.h.

Referenced by IonizationAndScintillation(), and Reset().

TH1F* larg4::IonizationAndScintillation::fElectronsPerLength
private

histogram of electrons per cm

Definition at line 58 of file IonizationAndScintillation.h.

Referenced by IonizationAndScintillation(), and Reset().

TH1F* larg4::IonizationAndScintillation::fElectronsPerStep
private

histogram of electrons per step

Definition at line 54 of file IonizationAndScintillation.h.

Referenced by IonizationAndScintillation(), and Reset().

TH2F* larg4::IonizationAndScintillation::fElectronsVsPhotons
private

histogram of electrons vs photons per step

Definition at line 62 of file IonizationAndScintillation.h.

Referenced by IonizationAndScintillation(), and Reset().

TH1F* larg4::IonizationAndScintillation::fEnergyPerStep
private

histogram of the energy deposited per step

Definition at line 57 of file IonizationAndScintillation.h.

Referenced by IonizationAndScintillation(), and Reset().

CLHEP::HepRandomEngine& larg4::IonizationAndScintillation::fEngine
private

random engine

Definition at line 63 of file IonizationAndScintillation.h.

Referenced by IonizationAndScintillation().

larg4::ISCalculation* larg4::IonizationAndScintillation::fISCalc
private

object to calculate ionization and scintillation produced by an energy deposition

Definition at line 47 of file IonizationAndScintillation.h.

Referenced by IonizationAndScintillation(), Reset(), and ~IonizationAndScintillation().

std::string larg4::IonizationAndScintillation::fISCalculator
private

name of calculator to use, NEST or Separate

Definition at line 49 of file IonizationAndScintillation.h.

Referenced by IonizationAndScintillation().

TH1F* larg4::IonizationAndScintillation::fPhotonsPerEDep
private

histogram of photons per MeV deposited

Definition at line 61 of file IonizationAndScintillation.h.

Referenced by IonizationAndScintillation(), and Reset().

TH1F* larg4::IonizationAndScintillation::fPhotonsPerLength
private

histogram of photons per cm

Definition at line 59 of file IonizationAndScintillation.h.

Referenced by IonizationAndScintillation(), and Reset().

TH1F* larg4::IonizationAndScintillation::fPhotonsPerStep
private

histogram of the photons per step

Definition at line 56 of file IonizationAndScintillation.h.

Referenced by IonizationAndScintillation(), and Reset().

G4Step const* larg4::IonizationAndScintillation::fStep
private

pointer to the current G4 step

Definition at line 50 of file IonizationAndScintillation.h.

Referenced by Reset().

int larg4::IonizationAndScintillation::fStepNumber
private

last StepNumber checked

Definition at line 51 of file IonizationAndScintillation.h.

Referenced by IonizationAndScintillation(), and Reset().

TH1F* larg4::IonizationAndScintillation::fStepSize
private

histogram of the step sizes

Definition at line 55 of file IonizationAndScintillation.h.

Referenced by IonizationAndScintillation(), and Reset().

int larg4::IonizationAndScintillation::fTrkID
private

last TrkID checked

Definition at line 52 of file IonizationAndScintillation.h.

Referenced by IonizationAndScintillation(), and Reset().


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