LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
shower::ShowerEnergyAlg Class Reference

#include "ShowerEnergyAlg.h"

Public Member Functions

 ShowerEnergyAlg (fhicl::ParameterSet const &pset)
 
double ShowerEnergy (std::vector< art::Ptr< recob::Hit > > const &hits, int plane)
 Finds the total energy deposited by the shower in this view. More...
 

Private Attributes

double fUGradient
 
double fUIntercept
 
double fVGradient
 
double fVIntercept
 
double fZGradient
 
double fZIntercept
 
detinfo::DetectorProperties const * detprop = nullptr
 

Detailed Description

Definition at line 30 of file ShowerEnergyAlg.h.

Constructor & Destructor Documentation

shower::ShowerEnergyAlg::ShowerEnergyAlg ( fhicl::ParameterSet const &  pset)

Definition at line 11 of file ShowerEnergyAlg.cxx.

References fUGradient, fUIntercept, fVGradient, fVIntercept, fZGradient, fZIntercept, and fhicl::ParameterSet::get().

12  : detprop(lar::providerFrom<detinfo::DetectorPropertiesService>())
13 {
14  fUGradient = pset.get<double>("UGradient");
15  fUIntercept = pset.get<double>("UIntercept");
16  fVGradient = pset.get<double>("VGradient");
17  fVIntercept = pset.get<double>("VIntercept");
18  fZGradient = pset.get<double>("ZGradient");
19  fZIntercept = pset.get<double>("ZIntercept");
20 }
detinfo::DetectorProperties const * detprop

Member Function Documentation

double shower::ShowerEnergyAlg::ShowerEnergy ( std::vector< art::Ptr< recob::Hit > > const &  hits,
int  plane 
)

Finds the total energy deposited by the shower in this view.

Definition at line 22 of file ShowerEnergyAlg.cxx.

References detprop, detinfo::DetectorProperties::ElectronLifetime(), fUGradient, fUIntercept, fVGradient, fVIntercept, fZGradient, fZIntercept, hits(), and detinfo::DetectorProperties::SamplingRate().

Referenced by shower::EMShowerAlg::MakeShower(), and ems::MergeEMShower3D::produce().

22  {
23 
24  double totalCharge = 0, totalEnergy = 0;
25 
26  for (art::PtrVector<recob::Hit>::const_iterator hit = hits.begin(); hit != hits.end(); ++hit){
27  if (int((*hit)->WireID().Plane)!=plane) continue;
28  totalCharge += ( (*hit)->Integral() * TMath::Exp( (detprop->SamplingRate() * (*hit)->PeakTime()) / (detprop->ElectronLifetime()*1e3) ) );
29  }
30 
31  switch (plane) {
32  case 0:
33  totalEnergy = (totalCharge * fUGradient) + fUIntercept;
34  break;
35  case 1:
36  totalEnergy = (totalCharge * fVGradient) + fVIntercept;
37  break;
38  case 2:
39  totalEnergy = (totalCharge * fZGradient) + fZIntercept;
40  break;
41  }
42 
43  return totalEnergy;
44 
45 }
detinfo::DetectorProperties const * detprop
virtual double SamplingRate() const =0
Returns the period of the TPC readout electronics clock.
Detector simulation of raw signals on wires.
data_t::const_iterator const_iterator
Definition: PtrVector.h:61
virtual double ElectronLifetime() const =0
Returns the attenuation constant for ionization electrons.

Member Data Documentation

detinfo::DetectorProperties const* shower::ShowerEnergyAlg::detprop = nullptr
private

Definition at line 44 of file ShowerEnergyAlg.h.

Referenced by ShowerEnergy().

double shower::ShowerEnergyAlg::fUGradient
private

Definition at line 40 of file ShowerEnergyAlg.h.

Referenced by ShowerEnergy(), and ShowerEnergyAlg().

double shower::ShowerEnergyAlg::fUIntercept
private

Definition at line 40 of file ShowerEnergyAlg.h.

Referenced by ShowerEnergy(), and ShowerEnergyAlg().

double shower::ShowerEnergyAlg::fVGradient
private

Definition at line 41 of file ShowerEnergyAlg.h.

Referenced by ShowerEnergy(), and ShowerEnergyAlg().

double shower::ShowerEnergyAlg::fVIntercept
private

Definition at line 41 of file ShowerEnergyAlg.h.

Referenced by ShowerEnergy(), and ShowerEnergyAlg().

double shower::ShowerEnergyAlg::fZGradient
private

Definition at line 42 of file ShowerEnergyAlg.h.

Referenced by ShowerEnergy(), and ShowerEnergyAlg().

double shower::ShowerEnergyAlg::fZIntercept
private

Definition at line 42 of file ShowerEnergyAlg.h.

Referenced by ShowerEnergy(), and ShowerEnergyAlg().


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