Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
calo::CalorimetryAlg Class Reference

#include <CalorimetryAlg.h>

Classes

struct  Config
 

Public Member Functions

 CalorimetryAlg (const fhicl::ParameterSet &pset)
 
 CalorimetryAlg (const Config &config)
 
double dEdx_AMP (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
 
double dEdx_AMP (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double dQ, double time, double pitch, unsigned int plane, double T0=0) const
 
double dEdx_AMP (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double dQdx, double time, unsigned int plane, double T0=0) const
 
double dEdx_AMP (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0, double EField) const
 
double dEdx_AMP (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double dQ, double time, double pitch, unsigned int plane, double T0, double EField) const
 
double dEdx_AMP (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double dQdx, double time, unsigned int plane, double T0, double EField) const
 
double dEdx_AREA (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
 
double dEdx_AREA (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double dQ, double time, double pitch, unsigned int plane, double T0=0) const
 
double dEdx_AREA (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double dQdx, double time, unsigned int plane, double T0=0) const
 
double dEdx_AREA (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0, double EField) const
 
double dEdx_AREA (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double dQ, double time, double pitch, unsigned int plane, double T0, double EField) const
 
double dEdx_AREA (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double dQdx, double time, unsigned int plane, double T0, double EField) const
 
double ElectronsFromADCPeak (double adc, unsigned short plane) const
 
double ElectronsFromADCArea (double area, unsigned short plane) const
 
double LifetimeCorrection (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double time, double T0=0) const
 

Private Member Functions

double dEdx_from_dQdx_e (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double dQdx_e, double time, double T0=0) const
 
double dEdx_from_dQdx_e (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double dQdx_e, double time, double T0, double EField) const
 

Private Attributes

art::ServiceHandle< geo::Geometry const > geom
 
std::vector< double > const fCalAmpConstants
 
std::vector< double > const fCalAreaConstants
 
bool const fUseModBox
 
int const fLifeTimeForm
 
bool const fDoLifeTimeCorrection
 

Detailed Description

Definition at line 33 of file CalorimetryAlg.h.

Constructor & Destructor Documentation

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

Definition at line 57 of file CalorimetryAlg.h.

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

Definition at line 23 of file CalorimetryAlg.cxx.

29  {
30  if (fLifeTimeForm != 0 and fLifeTimeForm != 1) {
31  throw cet::exception("CalorimetryAlg")
32  << "Unknow CaloLifeTimeForm " << fLifeTimeForm << '\n'
33  << "Must select either '0' for exponential or '1' for exponential + "
34  "constant.\n";
35  }
36  }
std::vector< double > const fCalAreaConstants
fhicl::Atom< bool > CaloDoLifeTimeCorrection
static Config * config
Definition: config.cpp:1054
bool const fDoLifeTimeCorrection
std::vector< double > const fCalAmpConstants
fhicl::Sequence< double > CalAreaConstants
fhicl::Atom< bool > CaloUseModBox
fhicl::Atom< int > CaloLifeTimeForm
fhicl::Sequence< double > CalAmpConstants
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Function Documentation

double calo::CalorimetryAlg::dEdx_AMP ( detinfo::DetectorClocksData const &  clock_data,
detinfo::DetectorPropertiesData const &  det_prop,
recob::Hit const &  hit,
double  pitch,
double  T0 = 0 
) const

Definition at line 42 of file CalorimetryAlg.cxx.

47  {
48  return dEdx_AMP(
49  clock_data, det_prop, hit.PeakAmplitude() / pitch, hit.PeakTime(), hit.WireID().Plane, T0, det_prop.Efield());
50  }
double dEdx_AMP(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
Detector simulation of raw signals on wires.
double calo::CalorimetryAlg::dEdx_AMP ( detinfo::DetectorClocksData const &  clock_data,
detinfo::DetectorPropertiesData const &  det_prop,
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 55 of file CalorimetryAlg.cxx.

62  {
63  double const dQdx = dQ / pitch; // in ADC/cm
64  return dEdx_AMP(clock_data, det_prop, dQdx, time, plane, T0, det_prop.Efield());
65  }
double dEdx_AMP(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
double calo::CalorimetryAlg::dEdx_AMP ( detinfo::DetectorClocksData const &  clock_data,
detinfo::DetectorPropertiesData const &  det_prop,
double  dQdx,
double  time,
unsigned int  plane,
double  T0 = 0 
) const

Definition at line 69 of file CalorimetryAlg.cxx.

75  {
76  double const fADCtoEl = fCalAmpConstants[plane];
77  double const dQdx_e = dQdx / fADCtoEl; // Conversion from ADC/cm to e/cm
78  return dEdx_from_dQdx_e(clock_data, det_prop, dQdx_e, time, T0, det_prop.Efield());
79  }
std::vector< double > const fCalAmpConstants
double dEdx_from_dQdx_e(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double dQdx_e, double time, double T0=0) const
double calo::CalorimetryAlg::dEdx_AMP ( detinfo::DetectorClocksData const &  clock_data,
detinfo::DetectorPropertiesData const &  det_prop,
recob::Hit const &  hit,
double  pitch,
double  T0,
double  EField 
) const

Definition at line 85 of file CalorimetryAlg.cxx.

91  {
92  return dEdx_AMP(
93  clock_data, det_prop, hit.PeakAmplitude() / pitch, hit.PeakTime(), hit.WireID().Plane, T0, EField);
94  }
double dEdx_AMP(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
Detector simulation of raw signals on wires.
double calo::CalorimetryAlg::dEdx_AMP ( detinfo::DetectorClocksData const &  clock_data,
detinfo::DetectorPropertiesData const &  det_prop,
double  dQ,
double  time,
double  pitch,
unsigned int  plane,
double  T0,
double  EField 
) const
Todo:
The plane argument should really be for a view instead

Definition at line 99 of file CalorimetryAlg.cxx.

107  {
108  double const dQdx = dQ / pitch; // in ADC/cm
109  return dEdx_AMP(clock_data, det_prop, dQdx, time, plane, T0, EField);
110  }
double dEdx_AMP(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
double calo::CalorimetryAlg::dEdx_AMP ( detinfo::DetectorClocksData const &  clock_data,
detinfo::DetectorPropertiesData const &  det_prop,
double  dQdx,
double  time,
unsigned int  plane,
double  T0,
double  EField 
) const

Definition at line 114 of file CalorimetryAlg.cxx.

121  {
122  double const fADCtoEl = fCalAmpConstants[plane];
123  double const dQdx_e = dQdx / fADCtoEl; // Conversion from ADC/cm to e/cm
124  return dEdx_from_dQdx_e(clock_data, det_prop, dQdx_e, time, T0, EField);
125  }
std::vector< double > const fCalAmpConstants
double dEdx_from_dQdx_e(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double dQdx_e, double time, double T0=0) const
double calo::CalorimetryAlg::dEdx_AREA ( detinfo::DetectorClocksData const &  clock_data,
detinfo::DetectorPropertiesData const &  det_prop,
recob::Hit const &  hit,
double  pitch,
double  T0 = 0 
) const

Definition at line 131 of file CalorimetryAlg.cxx.

136  {
137  return dEdx_AREA(
138  clock_data, det_prop, hit.Integral() / pitch, hit.PeakTime(), hit.WireID().Plane, T0, det_prop.Efield());
139  }
Detector simulation of raw signals on wires.
double dEdx_AREA(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
double calo::CalorimetryAlg::dEdx_AREA ( detinfo::DetectorClocksData const &  clock_data,
detinfo::DetectorPropertiesData const &  det_prop,
double  dQ,
double  time,
double  pitch,
unsigned int  plane,
double  T0 = 0 
) const

Definition at line 143 of file CalorimetryAlg.cxx.

150  {
151  double const dQdx = dQ / pitch; // in ADC/cm
152  return dEdx_AREA(clock_data, det_prop, dQdx, time, plane, T0, det_prop.Efield());
153  }
double dEdx_AREA(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
double calo::CalorimetryAlg::dEdx_AREA ( detinfo::DetectorClocksData const &  clock_data,
detinfo::DetectorPropertiesData const &  det_prop,
double  dQdx,
double  time,
unsigned int  plane,
double  T0 = 0 
) const

Definition at line 157 of file CalorimetryAlg.cxx.

163  {
164  double const fADCtoEl = fCalAreaConstants[plane];
165  double const dQdx_e = dQdx / fADCtoEl; // Conversion from ADC/cm to e/cm
166  return dEdx_from_dQdx_e(clock_data, det_prop, dQdx_e, time, T0, det_prop.Efield());
167  }
std::vector< double > const fCalAreaConstants
double dEdx_from_dQdx_e(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double dQdx_e, double time, double T0=0) const
double calo::CalorimetryAlg::dEdx_AREA ( detinfo::DetectorClocksData const &  clock_data,
detinfo::DetectorPropertiesData const &  det_prop,
recob::Hit const &  hit,
double  pitch,
double  T0,
double  EField 
) const

Definition at line 173 of file CalorimetryAlg.cxx.

179  {
180  return dEdx_AREA(
181  clock_data, det_prop, hit.Integral() / pitch, hit.PeakTime(), hit.WireID().Plane, T0, EField);
182  }
Detector simulation of raw signals on wires.
double dEdx_AREA(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
double calo::CalorimetryAlg::dEdx_AREA ( detinfo::DetectorClocksData const &  clock_data,
detinfo::DetectorPropertiesData const &  det_prop,
double  dQ,
double  time,
double  pitch,
unsigned int  plane,
double  T0,
double  EField 
) const

Definition at line 186 of file CalorimetryAlg.cxx.

194  {
195  double const dQdx = dQ / pitch; // in ADC/cm
196  return dEdx_AREA(clock_data, det_prop, dQdx, time, plane, T0, EField);
197  }
double dEdx_AREA(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
double calo::CalorimetryAlg::dEdx_AREA ( detinfo::DetectorClocksData const &  clock_data,
detinfo::DetectorPropertiesData const &  det_prop,
double  dQdx,
double  time,
unsigned int  plane,
double  T0,
double  EField 
) const

Definition at line 201 of file CalorimetryAlg.cxx.

208  {
209  double const fADCtoEl = fCalAreaConstants[plane];
210  double const dQdx_e = dQdx / fADCtoEl; // Conversion from ADC/cm to e/cm
211  return dEdx_from_dQdx_e(clock_data, det_prop, dQdx_e, time, T0, EField);
212  }
std::vector< double > const fCalAreaConstants
double dEdx_from_dQdx_e(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double dQdx_e, double time, double T0=0) const
double calo::CalorimetryAlg::dEdx_from_dQdx_e ( detinfo::DetectorClocksData const &  clock_data,
detinfo::DetectorPropertiesData const &  det_prop,
double  dQdx_e,
double  time,
double  T0 = 0 
) const
private

Definition at line 216 of file CalorimetryAlg.cxx.

221  {
222  return dEdx_from_dQdx_e(clock_data, det_prop, dQdx_e, time, T0, det_prop.Efield());
223  }
double dEdx_from_dQdx_e(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double dQdx_e, double time, double T0=0) const
double calo::CalorimetryAlg::dEdx_from_dQdx_e ( detinfo::DetectorClocksData const &  clock_data,
detinfo::DetectorPropertiesData const &  det_prop,
double  dQdx_e,
double  time,
double  T0,
double  EField 
) const
private

Definition at line 225 of file CalorimetryAlg.cxx.

231  {
232  if (fDoLifeTimeCorrection) {
233  dQdx_e *= LifetimeCorrection(clock_data, det_prop, time, T0); // (dQdx_e in e/cm)
234  }
235 
236  if (fUseModBox) { return det_prop.ModBoxCorrection(dQdx_e, EField); }
237 
238  return det_prop.BirksCorrection(dQdx_e, EField);
239  }
bool const fDoLifeTimeCorrection
double LifetimeCorrection(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double time, double T0=0) const
double calo::CalorimetryAlg::ElectronsFromADCArea ( double  area,
unsigned short  plane 
) const
inline

Definition at line 153 of file CalorimetryAlg.h.

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

Definition at line 147 of file CalorimetryAlg.h.

148  {
149  return adc / fCalAmpConstants[plane];
150  }
int16_t adc
Definition: CRTFragment.hh:202
std::vector< double > const fCalAmpConstants
double calo::CalorimetryAlg::LifetimeCorrection ( detinfo::DetectorClocksData const &  clock_data,
detinfo::DetectorPropertiesData const &  det_prop,
double  time,
double  T0 = 0 
) const

Definition at line 246 of file CalorimetryAlg.cxx.

250  {
251  float const t = time - trigger_offset(clock_data);
252  double const timetick = sampling_rate(clock_data) * 1.e-3; // time sample in microsec
253  double const adjusted_time = t * timetick - T0 * 1e-3; // (in microsec)
254 
255  assert(fLifeTimeForm < 2);
256  if (fLifeTimeForm == 0) {
257  // Exponential form
258  double const tau = det_prop.ElectronLifetime();
259  return exp(adjusted_time / tau);
260  }
261 
262  // Exponential+constant form
263  auto const& elifetime_provider =
265  return elifetime_provider.Lifetime(adjusted_time);
266  }
const double e
int trigger_offset(DetectorClocksData const &data)
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.

Member Data Documentation

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

Definition at line 178 of file CalorimetryAlg.h.

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

Definition at line 179 of file CalorimetryAlg.h.

bool const calo::CalorimetryAlg::fDoLifeTimeCorrection
private

Definition at line 182 of file CalorimetryAlg.h.

int const calo::CalorimetryAlg::fLifeTimeForm
private

Definition at line 181 of file CalorimetryAlg.h.

bool const calo::CalorimetryAlg::fUseModBox
private

Definition at line 180 of file CalorimetryAlg.h.

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

Definition at line 164 of file CalorimetryAlg.h.


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