LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
calo::CalorimetryAlg Class Reference

#include "CalorimetryAlg.h"

Classes

struct  Config
 

Public Member Functions

 CalorimetryAlg (const fhicl::ParameterSet &pset)
 
 CalorimetryAlg (const Config &config)
 
 ~CalorimetryAlg ()
 
void reconfigure (const Config &config)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
double dEdx_AMP (art::Ptr< recob::Hit > hit, double pitch, double T0=0) const
 
double dEdx_AMP (recob::Hit const &hit, double pitch, double T0=0) const
 
double dEdx_AMP (double dQ, double time, double pitch, unsigned int plane, double T0=0) const
 
double dEdx_AMP (double dQdx, double time, unsigned int plane, double T0=0) const
 
double dEdx_AREA (art::Ptr< recob::Hit > hit, double pitch, double T0=0) const
 
double dEdx_AREA (recob::Hit const &hit, double pitch, double T0=0) const
 
double dEdx_AREA (double dQ, double time, double pitch, unsigned int plane, double T0=0) const
 
double dEdx_AREA (double dQdx, double time, unsigned int plane, double T0=0) const
 
double ElectronsFromADCPeak (double adc, unsigned short plane) const
 
double ElectronsFromADCArea (double area, unsigned short plane) const
 
double LifetimeCorrection (double time, double T0=0) const
 

Private Member Functions

double dEdx_from_dQdx_e (double dQdx_e, double time, double T0=0) const
 

Private Attributes

art::ServiceHandle< geo::Geometrygeom
 
const detinfo::DetectorPropertiesdetprop
 
std::vector< double > fCalAmpConstants
 
std::vector< double > fCalAreaConstants
 
bool fUseModBox
 
int fLifeTimeForm
 
bool fDoLifeTimeCorrection
 

Detailed Description

Definition at line 28 of file CalorimetryAlg.h.

Constructor & Destructor Documentation

calo::CalorimetryAlg::CalorimetryAlg ( const fhicl::ParameterSet pset)
inline

Definition at line 62 of file CalorimetryAlg.h.

62  :
64  {}
CalorimetryAlg(const fhicl::ParameterSet &pset)
calo::CalorimetryAlg::CalorimetryAlg ( const Config config)

Definition at line 26 of file CalorimetryAlg.cxx.

References detprop, and reconfigure().

27  {
28  this->reconfigure(config);
29 
31  }
void reconfigure(const Config &config)
const detinfo::DetectorProperties * detprop
calo::CalorimetryAlg::~CalorimetryAlg ( )

Definition at line 34 of file CalorimetryAlg.cxx.

35  {
36 
37  }

Member Function Documentation

double calo::CalorimetryAlg::dEdx_AMP ( art::Ptr< recob::Hit hit,
double  pitch,
double  T0 = 0 
) const

Definition at line 55 of file CalorimetryAlg.cxx.

References recob::Hit::PeakAmplitude(), recob::Hit::PeakTime(), geo::PlaneID::Plane, and recob::Hit::WireID().

Referenced by dEdx_AMP(), trkf::BezierTrack::GetCalorimetryObject(), shwf::ShowerReco::LongTransEnergy(), calo::Calorimetry::produce(), and showerreco::ShowerRecoAlg::RecoOneShower().

56  {
57  return dEdx_AMP(hit->PeakAmplitude()/pitch, hit->PeakTime(), hit->WireID().Plane, T0);
58  }
geo::WireID WireID() const
Initial tdc tick for hit.
Definition: Hit.h:234
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
Definition: Hit.h:222
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:258
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:219
double dEdx_AMP(art::Ptr< recob::Hit > hit, double pitch, double T0=0) const
double calo::CalorimetryAlg::dEdx_AMP ( recob::Hit const &  hit,
double  pitch,
double  T0 = 0 
) const

Definition at line 61 of file CalorimetryAlg.cxx.

References dEdx_AMP(), recob::Hit::PeakAmplitude(), recob::Hit::PeakTime(), geo::PlaneID::Plane, and recob::Hit::WireID().

62  {
63  return dEdx_AMP(hit.PeakAmplitude()/pitch, hit.PeakTime(), hit.WireID().Plane, T0);
64  }
Detector simulation of raw signals on wires.
double dEdx_AMP(art::Ptr< recob::Hit > hit, double pitch, double T0=0) const
double calo::CalorimetryAlg::dEdx_AMP ( double  dQ,
double  time,
double  pitch,
unsigned int  plane,
double  T0 = 0 
) const
Todo:
The plane argument should really be for a view instead

Definition at line 68 of file CalorimetryAlg.cxx.

References dEdx_AMP().

69  {
70  double dQdx = dQ/pitch; // in ADC/cm
71  return dEdx_AMP(dQdx, time, plane, T0);
72  }
double dEdx_AMP(art::Ptr< recob::Hit > hit, double pitch, double T0=0) const
double calo::CalorimetryAlg::dEdx_AMP ( double  dQdx,
double  time,
unsigned int  plane,
double  T0 = 0 
) const

Definition at line 75 of file CalorimetryAlg.cxx.

References dEdx_from_dQdx_e(), and fCalAmpConstants.

76  {
77  double fADCtoEl=1.;
78 
79  fADCtoEl = fCalAmpConstants[plane];
80 
81  double dQdx_e = dQdx/fADCtoEl; // Conversion from ADC/cm to e/cm
82  return dEdx_from_dQdx_e(dQdx_e,time, T0);
83  }
std::vector< double > fCalAmpConstants
double dEdx_from_dQdx_e(double dQdx_e, double time, double T0=0) const
double calo::CalorimetryAlg::dEdx_AREA ( art::Ptr< recob::Hit hit,
double  pitch,
double  T0 = 0 
) const

Definition at line 88 of file CalorimetryAlg.cxx.

References recob::Hit::Integral(), recob::Hit::PeakTime(), geo::PlaneID::Plane, and recob::Hit::WireID().

Referenced by calo::TrackCalorimetryAlg::AnalyzeHit(), mvapid::MVAAlg::CalcSegmentdEdxDist(), ems::EMShower3D::ConvertFrom(), ems::EMShower3D::ConvertFrom2(), dEdx_AREA(), tca::FilldEdx(), shower::EMShowerAlg::FinddEdx(), shwf::ShowerReco::LongTransEnergy(), shower::EMShowerAlg::MakeShower(), calo::Calorimetry::produce(), and showerreco::ShowerRecoAlg::RecoOneShower().

89  {
90  return dEdx_AREA(hit->Integral()/pitch, hit->PeakTime(), hit->WireID().Plane, T0);
91  }
double dEdx_AREA(art::Ptr< recob::Hit > hit, double pitch, double T0=0) const
geo::WireID WireID() const
Initial tdc tick for hit.
Definition: Hit.h:234
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:225
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:258
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:219
double calo::CalorimetryAlg::dEdx_AREA ( recob::Hit const &  hit,
double  pitch,
double  T0 = 0 
) const

Definition at line 94 of file CalorimetryAlg.cxx.

References dEdx_AREA(), recob::Hit::Integral(), recob::Hit::PeakTime(), geo::PlaneID::Plane, and recob::Hit::WireID().

95  {
96  return dEdx_AREA(hit.Integral()/pitch, hit.PeakTime(), hit.WireID().Plane, T0);
97  }
double dEdx_AREA(art::Ptr< recob::Hit > hit, double pitch, double T0=0) const
Detector simulation of raw signals on wires.
double calo::CalorimetryAlg::dEdx_AREA ( double  dQ,
double  time,
double  pitch,
unsigned int  plane,
double  T0 = 0 
) const

Definition at line 100 of file CalorimetryAlg.cxx.

References dEdx_AREA().

101  {
102  double dQdx = dQ/pitch; // in ADC/cm
103  return dEdx_AREA(dQdx, time, plane, T0);
104  }
double dEdx_AREA(art::Ptr< recob::Hit > hit, double pitch, double T0=0) const
double calo::CalorimetryAlg::dEdx_AREA ( double  dQdx,
double  time,
unsigned int  plane,
double  T0 = 0 
) const

Definition at line 107 of file CalorimetryAlg.cxx.

References dEdx_from_dQdx_e(), and fCalAreaConstants.

108  {
109  double fADCtoEl=1.;
110 
111  fADCtoEl = fCalAreaConstants[plane];
112 
113  double dQdx_e = dQdx/fADCtoEl; // Conversion from ADC/cm to e/cm
114  return dEdx_from_dQdx_e(dQdx_e, time, T0);
115  }
double dEdx_from_dQdx_e(double dQdx_e, double time, double T0=0) const
std::vector< double > fCalAreaConstants
double calo::CalorimetryAlg::dEdx_from_dQdx_e ( double  dQdx_e,
double  time,
double  T0 = 0 
) const
private

Definition at line 118 of file CalorimetryAlg.cxx.

References detinfo::DetectorProperties::BirksCorrection(), detprop, fDoLifeTimeCorrection, fUseModBox, LifetimeCorrection(), and detinfo::DetectorProperties::ModBoxCorrection().

Referenced by dEdx_AMP(), and dEdx_AREA().

119  {
121  dQdx_e *= LifetimeCorrection(time, T0); // Lifetime Correction (dQdx_e in e/cm)
122  if(fUseModBox) {
123  return detprop->ModBoxCorrection(dQdx_e);
124  } else {
125  return detprop->BirksCorrection(dQdx_e);
126  }
127  }
virtual double BirksCorrection(double dQdX) const =0
dQ/dX in electrons/cm, returns dE/dX in MeV/cm.
virtual double ModBoxCorrection(double dQdX) const =0
const detinfo::DetectorProperties * detprop
double LifetimeCorrection(double time, double T0=0) const
double calo::CalorimetryAlg::ElectronsFromADCArea ( double  area,
unsigned short  plane 
) const
inline

Definition at line 87 of file CalorimetryAlg.h.

Referenced by showerreco::ShowerRecoAlg::RecoOneShower().

88  { return area / fCalAreaConstants[plane]; }
std::vector< double > fCalAreaConstants
double calo::CalorimetryAlg::ElectronsFromADCPeak ( double  adc,
unsigned short  plane 
) const
inline

Definition at line 84 of file CalorimetryAlg.h.

Referenced by img::DataProviderAlg::DataProviderAlg(), and showerreco::ShowerRecoAlg::RecoOneShower().

85  { return adc / fCalAmpConstants[plane]; }
std::vector< double > fCalAmpConstants
double calo::CalorimetryAlg::LifetimeCorrection ( double  time,
double  T0 = 0 
) const

Definition at line 133 of file CalorimetryAlg.cxx.

References detprop, e, detinfo::DetectorProperties::ElectronLifetime(), fLifeTimeForm, detinfo::DetectorProperties::SamplingRate(), and detinfo::DetectorProperties::TriggerOffset().

Referenced by dEdx_from_dQdx_e(), shower::TCShowerElectronLikelihood::getShowerProfile(), img::DataProviderAlg::LifetimeCorrection(), showerreco::ShowerRecoAlg::RecoOneShower(), img::DataProviderAlg::resizeView(), and shower::TCShowerTemplateMaker::showerProfile().

134  {
135  float t = time;
136 
137  double timetick = detprop->SamplingRate()*1.e-3; //time sample in microsec
138  double presamplings = detprop->TriggerOffset();
139 
140  t -= presamplings;
141  time = t * timetick - T0*1e-3; // (in microsec)
142 
143  if (fLifeTimeForm==0){
144  //Exponential form
145  double tau = detprop->ElectronLifetime();
146 
147  double correction = exp(time/tau);
148  return correction;
149  }
150  else if (fLifeTimeForm==1){
151  //Exponential+constant form
152  const lariov::ElectronLifetimeProvider& elifetime_provider = art::ServiceHandle<lariov::ElectronLifetimeService>()->GetProvider();
153  double correction = elifetime_provider.Lifetime(time);
154  //std::cout<<correction<<std::endl;
155  return correction;
156  }
157  else{
158  throw cet::exception("CalorimetryAlg") << "Unknow CaloLifeTimeForm "<<fLifeTimeForm<<std::endl;
159  }
160  }
virtual int TriggerOffset() const =0
virtual double SamplingRate() const =0
Returns the period of the TPC readout electronics clock.
const detinfo::DetectorProperties * detprop
Float_t e
Definition: plot.C:34
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
virtual double ElectronLifetime() const =0
Returns the attenuation constant for ionization electrons.
void calo::CalorimetryAlg::reconfigure ( const Config config)
void calo::CalorimetryAlg::reconfigure ( const fhicl::ParameterSet pset)
inline

Definition at line 71 of file CalorimetryAlg.h.

72  { reconfigure(fhicl::Table<Config>(pset, {})()); }
void reconfigure(const Config &config)

Member Data Documentation

const detinfo::DetectorProperties* calo::CalorimetryAlg::detprop
private

Definition at line 95 of file CalorimetryAlg.h.

Referenced by CalorimetryAlg(), dEdx_from_dQdx_e(), and LifetimeCorrection().

std::vector< double > calo::CalorimetryAlg::fCalAmpConstants
private

Definition at line 99 of file CalorimetryAlg.h.

Referenced by dEdx_AMP(), and reconfigure().

std::vector< double > calo::CalorimetryAlg::fCalAreaConstants
private

Definition at line 100 of file CalorimetryAlg.h.

Referenced by dEdx_AREA(), and reconfigure().

bool calo::CalorimetryAlg::fDoLifeTimeCorrection
private

Definition at line 103 of file CalorimetryAlg.h.

Referenced by dEdx_from_dQdx_e(), and reconfigure().

int calo::CalorimetryAlg::fLifeTimeForm
private

Definition at line 102 of file CalorimetryAlg.h.

Referenced by LifetimeCorrection(), and reconfigure().

bool calo::CalorimetryAlg::fUseModBox
private

Definition at line 101 of file CalorimetryAlg.h.

Referenced by dEdx_from_dQdx_e(), and reconfigure().

art::ServiceHandle<geo::Geometry> calo::CalorimetryAlg::geom
private

Definition at line 94 of file CalorimetryAlg.h.


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