LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
DetectorPropertiesStandard.h
Go to the documentation of this file.
1 // \file DetectorPropertiesStandard.h
3 //
4 // \brief service to contain information about detector electronics, etc
5 //
6 // \author brebel@fnal.gov
7 //
8 // Separation of service from Detector info class:
9 // jpaley@fnal.gov
11 #ifndef DETINFO_DETECTORPROPERTIESSTD_H
12 #define DETINFO_DETECTORPROPERTIESSTD_H
13 
14 // LArSoft libraries
23 
24 // framework libraries
25 #include "fhiclcpp/fwd.h"
26 #include "fhiclcpp/types/Atom.h"
29 
30 // C/C++ standard libraries
31 #include <set>
32 
34 namespace detinfo {
35 
37  public:
39  using providers_type =
41 
43  struct Configuration_t {
44  using Name = fhicl::Name;
46 
48  Name("Efield"),
49  Comment("electric field in front of each wire plane (the last one is "
50  "the big one!) [kV/cm]")};
51 
53  Comment("electron lifetime in liquid argon [us]")};
54  fhicl::Atom<double> Temperature{Name("Temperature"), Comment("argon temperature [K]")};
56  Name("ElectronsToADC"),
57  Comment("conversion factor: (ADC counts)/(ionization electrons)")};
59  Name("NumberTimeSamples"),
60  Comment("number of TPC readout TDC clock ticks per event")};
62  Name("ReadOutWindowSize"),
63  Comment("number of TPC readout TDC clock ticks per readout window")};
64 
65  // The following are not really "optional": the ones for the views which
66  // are present are mandatory.
68  Name("TimeOffsetU"),
69  Comment("tick offset subtracted to to convert spacepoint coordinates "
70  "to hit times on view U")};
72  Name("TimeOffsetV"),
73  Comment("tick offset subtracted to to convert spacepoint coordinates "
74  "to hit times on view V")};
76  Name("TimeOffsetZ"),
77  Comment("tick offset subtracted to to convert spacepoint coordinates "
78  "to hit times on view Z")};
80  Name("TimeOffsetY"),
81  Comment("tick offset subtracted to to convert spacepoint coordinates "
82  "to hit times on view Y")};
84  Name("TimeOffsetX"),
85  Comment("tick offset subtracted to to convert spacepoint coordinates "
86  "to hit times on view X")};
87 
89  Name("SternheimerA"),
90  Comment("parameter a of Sternheimer correction delta = 2log(10) x - "
91  "cbar + { a (x1-x)^k } theta(x1-x), x = log10(p/m)")};
93  Name("SternheimerK"),
94  Comment("parameter k of Sternheimer correction delta = 2log(10) x - "
95  "cbar + { a (x_1-x)^k } theta(x1-x), x = log10(p/m)")};
97  Name("SternheimerX0"),
98  Comment("minimum x = log10(p/m) for the application of Sternheimer "
99  "correction")};
101  Name("SternheimerX1"),
102  Comment("parameter x_1 of Sternheimer correction delta = 2log(10) x - "
103  "cbar + { a (x_1-x)^k } theta(x1-x), x = log10(p/m)")};
105  Name("SternheimerCbar"),
106  Comment("parameter cbar of Sternheimer correction delta = 2log(10) x - "
107  "cbar + { a (x_1-x)^k } theta(x1-x), x = log10(p/m)")};
109  Name("DriftVelFudgeFactor"),
110  Comment("Allows a scaling factor to fudge the drift velocity "
111  "calculation (as suggested by DriftVel Stancari")};
112 
114  Name("UseIcarusMicrobooneDriftModel"),
115  Comment("Allows user to decide to use the ICARUS+MicroBooNE drift "
116  "model for velocity calculation as in arXiv:2008.09765"),
117  false};
118 
120  Name("IncludeInterPlanePitchInXTickOffsets"),
121  Comment("Historically, ConvertTicksToX has allowed for the drift time "
122  "between the wire planes. This is appropriate for "
123  "recob::RawDigits, and recob::Wires from the 1D unfolding, "
124  "but is not appropriate for recob::Wires from WireCell. "
125  "When disabled, the conversion propagates to the last plane, "
126  "rather than the first plane and assumes a standard drift velocity. "
127  "The default value is 'true', retaining the 'classic' behaviour"),
128  true};
129 
130  fhicl::Atom<bool> SimpleBoundary{Name("SimpleBoundaryProcess"), Comment("")};
131 
133  Name("ModBoxAlpha"),
134  Comment("alpha parameter in the Modified Box recombination model."),
136 
138  Name("ModBoxBeta"),
139  Comment("beta parameter in the Modified Box recombination model."),
141 
142  }; // Configuration_t
143 
145  geo::GeometryCore const* geo,
146  geo::WireReadoutGeom const* wireReadoutGeom,
147  detinfo::LArProperties const* lp,
148  std::set<std::string> const& ignore_params = {});
149 
151  virtual ~DetectorPropertiesStandard() = default;
152 
153  void SetNumberTimeSamples(unsigned int nsamp) { fNumberTimeSamples = nsamp; }
154 
155  // Accessors.
156 
157  double Efield(unsigned int planegap = 0) const override;
158 
159  double DriftVelocity(double efield = 0.,
160  double temperature = 0.) const override;
161 
163  double BirksCorrection(double dQdX) const override;
164  double BirksCorrection(double dQdX, double EField) const override;
165  double ModBoxCorrection(double dQdX) const override;
166  double ModBoxCorrection(double dQdX, double EField) const override;
167 
168  double ElectronLifetime() const override
169  {
170  return fElectronlifetime; //< microseconds
171  }
172 
183  double Density(double temperature = 0.) const override;
184 
186  double Temperature() const override { return fTemperature; }
187 
202  double Eloss(double mom, double mass, double tcut) const override;
203 
212  double ElossVar(double mom, double mass) const override;
213 
214  double ElectronsToADC() const override { return fElectronsToADC; }
215  unsigned int NumberTimeSamples() const override { return fNumberTimeSamples; }
216  unsigned int ReadOutWindowSize() const override { return fReadOutWindowSize; }
217  double TimeOffsetU() const override { return fTimeOffsetU; };
218  double TimeOffsetV() const override { return fTimeOffsetV; };
219  double TimeOffsetZ() const override { return fTimeOffsetZ; };
220  double TimeOffsetY() const override { return fTimeOffsetY; };
221 
222  bool SimpleBoundary() const override { return fSimpleBoundary; }
223 
224  DetectorPropertiesData DataFor(detinfo::DetectorClocksData const& clock_data) const override;
225 
226  private:
237  std::set<std::string> const& ignore_params);
238 
241  double a;
242  double k;
243  double x0;
244  double x1;
245  double cbar;
246  };
247 
248  // service providers we depend on;
249  // in principle could be replaced by a single providerpack_type.
253 
254  std::vector<double> fEfield;
256  double fTemperature;
258  unsigned int fNumberTimeSamples;
260  unsigned int fReadOutWindowSize;
261  double fTimeOffsetU;
262  double fTimeOffsetV;
264  double fTimeOffsetZ;
266  double fTimeOffsetY;
268  double fTimeOffsetX;
270  double fDriftVelFudgeFactor;
272 
275 
282 
284 
285  std::vector<std::vector<double>> fDriftDirection;
286 
288 
289  double fModBoxA;
290  double fModBoxB;
291 
292  }; // class DetectorPropertiesStandard
293 } // namespace detinfo
294 
295 #endif // DETINFO_DETECTOR_PROPERTIES_H
unsigned int ReadOutWindowSize() const override
unsigned int NumberTimeSamples() const override
DetectorPropertiesStandard(fhicl::ParameterSet const &pset, geo::GeometryCore const *geo, geo::WireReadoutGeom const *wireReadoutGeom, detinfo::LArProperties const *lp, std::set< std::string > const &ignore_params={})
virtual ~DetectorPropertiesStandard()=default
void ValidateAndConfigure(fhicl::ParameterSet const &p, std::set< std::string > const &ignore_params)
Configures the provider, first validating the configuration.
double ElossVar(double mom, double mass) const override
Energy loss fluctuation ( )
double BirksCorrection(double dQdX) const override
dQ/dX in electrons/cm, returns dE/dX in MeV/cm.
unsigned int fNumberTimeSamples
number of clock ticks per event
std::vector< std::vector< double > > fDriftDirection
double Temperature() const override
In kelvin.
virtual double Density() const
Returns argon density at the temperature from Temperature()
DetectorPropertiesData DataFor(detinfo::DetectorClocksData const &clock_data) const override
pure virtual base interface for detector clocks
Access the description of the physical detector geometry.
constexpr double kModBoxB
Modified Box Beta in g/(MeV cm²)*kV/cm.
Interface for a class providing readout channel mapping to geometry.
SternheimerParameters_t fSternheimerParameters
Sternheimer parameters.
General LArSoft Utilities.
Description of the physical geometry of one entire detector.
Definition: GeometryCore.h:91
Parameters for Sternheimer density effect corrections.
double ModBoxCorrection(double dQdX) const override
double ElectronLifetime() const override
Returns the attenuation constant for ionization electrons.
Contains all timing reference information for the detector.
unsigned int fReadOutWindowSize
number of clock ticks per readout window
Container for a list of pointers to providers.
Definition: ProviderPack.h:111
std::vector< double > fEfield
kV/cm (per inter-plane volume) !
Data structure containing constant pointers to classes.
double DriftVelocity(double efield=0., double temperature=0.) const override
cm/us
constexpr double kModBoxA
Modified Box Alpha.
Collection of Physical constants used in LArSoft.
ROOT libraries.
Interface to geometry for wire readouts .
double Eloss(double mom, double mass, double tcut) const override
Restricted mean energy loss (dE/dx)