LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
CalorimetryAlg.h
Go to the documentation of this file.
1 // \file CalorimetryAlg.h
3 //
4 // \brief Functions to calculate dE/dx. Based on code in Calorimetry.cxx
5 //
6 // \author andrzej.szelc@yale.edu
7 //
9 #ifndef UTIL_CALORIMETRYALG_H
10 #define UTIL_CALORIMETRYALG_H
11 
12 #include "fhiclcpp/types/Atom.h"
14 #include "fhiclcpp/types/Table.h"
15 
19 #include <vector>
20 
21 namespace recob {
22  class Hit;
23 }
24 
25 
27 namespace calo{
29  public:
30 
31  struct Config {
32  using Name = fhicl::Name;
34 
35  fhicl::Sequence< double > CalAmpConstants {
36  Name("CalAmpConstants"),
37  Comment("ADC to electrons constants for each plane.")
38  };
39 
40  fhicl::Sequence< double > CalAreaConstants {
41  Name("CalAreaConstants"),
42  Comment("Area to electrons constants for each plane.")
43  };
44 
45  fhicl::Atom< bool > CaloUseModBox {
46  Name("CaloUseModBox"),
47  Comment("Use modified box model if true, birks otherwise")
48  };
49 
50  fhicl::Atom< int > CaloLifeTimeForm {
51  Name("CaloLifeTimeForm"),
52  Comment("0 = exponential, 1 = exponential + constant")
53  };
54 
55  fhicl::Atom< bool > CaloDoLifeTimeCorrection {
56  Name("CaloDoLifeTimeCorrection"),
57  Comment("Apply lifetime correction if true")
58  };
59 
60  };
61 
63  CalorimetryAlg(fhicl::Table<Config>(pset, {})())
64  {}
65 
66  CalorimetryAlg(const Config& config);
67 
68  ~CalorimetryAlg();
69 
70  void reconfigure(const Config& config);
71  void reconfigure(const fhicl::ParameterSet& pset)
72  { reconfigure(fhicl::Table<Config>(pset, {})()); }
73 
74  double dEdx_AMP(art::Ptr< recob::Hit > hit, double pitch, double T0=0) const;
75  double dEdx_AMP(recob::Hit const& hit, double pitch, double T0=0) const;
76  double dEdx_AMP(double dQ, double time, double pitch, unsigned int plane, double T0=0) const;
77  double dEdx_AMP(double dQdx,double time, unsigned int plane, double T0=0) const;
78 
79  double dEdx_AREA(art::Ptr< recob::Hit > hit, double pitch, double T0=0) const;
80  double dEdx_AREA(recob::Hit const& hit, double pitch, double T0=0) const;
81  double dEdx_AREA(double dQ,double time, double pitch, unsigned int plane, double T0=0) const;
82  double dEdx_AREA(double dQdx,double time, unsigned int plane, double T0=0) const;
83 
84  double ElectronsFromADCPeak(double adc, unsigned short plane) const
85  { return adc / fCalAmpConstants[plane]; }
86 
87  double ElectronsFromADCArea(double area, unsigned short plane) const
88  { return area / fCalAreaConstants[plane]; }
89 
90  double LifetimeCorrection(double time, double T0=0) const;
91 
92  private:
93 
96 
97  double dEdx_from_dQdx_e(double dQdx_e,double time, double T0=0) const;
98 
99  std::vector< double > fCalAmpConstants;
100  std::vector< double > fCalAreaConstants;
104 
105  }; // class CalorimetryAlg
106 } //namespace calo
107 #endif // UTIL_CALORIMETRYALG_H
Reconstruction base classes.
void reconfigure(const fhicl::ParameterSet &pset)
art::ServiceHandle< geo::Geometry > geom
double ElectronsFromADCArea(double area, unsigned short plane) const
double ElectronsFromADCPeak(double adc, unsigned short plane) const
std::vector< double > fCalAmpConstants
parameter set interface
const detinfo::DetectorProperties * detprop
Detector simulation of raw signals on wires.
CalorimetryAlg(const fhicl::ParameterSet &pset)
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:49
art framework interface to geometry description
calorimetry
std::vector< double > fCalAreaConstants