LArSoft  v09_90_00
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
22 
23 // framework libraries
24 #include "fhiclcpp/ParameterSet.h"
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:
40 
42  struct Configuration_t {
43  using Name = fhicl::Name;
45 
47  Name("Efield"),
48  Comment("electric field in front of each wire plane (the last one is "
49  "the big one!) [kV/cm]")};
50 
52  Comment("electron lifetime in liquid argon [us]")};
53  fhicl::Atom<double> Temperature{Name("Temperature"), Comment("argon temperature [K]")};
55  Name("ElectronsToADC"),
56  Comment("conversion factor: (ADC counts)/(ionization electrons)")};
58  Name("NumberTimeSamples"),
59  Comment("number of TPC readout TDC clock ticks per event")};
61  Name("ReadOutWindowSize"),
62  Comment("number of TPC readout TDC clock ticks per readout window")};
63 
64  // The following are not really "optional": the ones for the views which
65  // are present are mandatory.
67  Name("TimeOffsetU"),
68  Comment("tick offset subtracted to to convert spacepoint coordinates "
69  "to hit times on view U")};
71  Name("TimeOffsetV"),
72  Comment("tick offset subtracted to to convert spacepoint coordinates "
73  "to hit times on view V")};
75  Name("TimeOffsetZ"),
76  Comment("tick offset subtracted to to convert spacepoint coordinates "
77  "to hit times on view Z")};
79  Name("TimeOffsetY"),
80  Comment("tick offset subtracted to to convert spacepoint coordinates "
81  "to hit times on view Y")};
83  Name("TimeOffsetX"),
84  Comment("tick offset subtracted to to convert spacepoint coordinates "
85  "to hit times on view X")};
86 
88  Name("SternheimerA"),
89  Comment("parameter a of Sternheimer correction delta = 2log(10) x - "
90  "cbar + { a (x1-x)^k } theta(x1-x), x = log10(p/m)")};
92  Name("SternheimerK"),
93  Comment("parameter k of Sternheimer correction delta = 2log(10) x - "
94  "cbar + { a (x_1-x)^k } theta(x1-x), x = log10(p/m)")};
96  Name("SternheimerX0"),
97  Comment("minimum x = log10(p/m) for the application of Sternheimer "
98  "correction")};
100  Name("SternheimerX1"),
101  Comment("parameter x_1 of Sternheimer correction delta = 2log(10) x - "
102  "cbar + { a (x_1-x)^k } theta(x1-x), x = log10(p/m)")};
104  Name("SternheimerCbar"),
105  Comment("parameter cbar of Sternheimer correction delta = 2log(10) x - "
106  "cbar + { a (x_1-x)^k } theta(x1-x), x = log10(p/m)")};
108  Name("DriftVelFudgeFactor"),
109  Comment("Allows a scaling factor to fudge the drift velocity "
110  "calculation (as suggested by DriftVel Stancari")};
111 
113  Name("UseIcarusMicrobooneDriftModel"),
114  Comment("Allows user to decide to use the ICARUS+MicroBooNE drift "
115  "model for velocity calculation as in arXiv:2008.09765"),
116  false};
117 
119  Name("IncludeInterPlanePitchInXTickOffsets"),
120  Comment("Historically, ConvertTicksToX has allowed for the drift time "
121  "between the wire planes. This is appropriate for "
122  "recob::RawDigits, and recob::Wires from the 1D unfolding, "
123  "but is not appropriate for recob::Wires from WireCell. "
124  "When disabled, the conversion propagates to the last plane, "
125  "rather than the first plane and assumes a standard drift velocity. "
126  "The default value is 'true', retaining the 'classic' behaviour"),
127  true};
128 
129  fhicl::Atom<bool> SimpleBoundary{Name("SimpleBoundaryProcess"), Comment("")};
130 
132  Name("ModBoxAlpha"),
133  Comment("alpha parameter in the Modified Box recombination model."),
135 
137  Name("ModBoxBeta"),
138  Comment("beta parameter in the Modified Box recombination model."),
140 
141  }; // Configuration_t
142 
144  const geo::GeometryCore* geo,
145  const detinfo::LArProperties* lp,
146  std::set<std::string> const& ignore_params = {});
147 
149  virtual ~DetectorPropertiesStandard() = default;
150 
151  void SetNumberTimeSamples(unsigned int nsamp) { fNumberTimeSamples = nsamp; }
152 
153  // Accessors.
154 
155  double Efield(unsigned int planegap = 0) const override;
156 
157  double DriftVelocity(double efield = 0.,
158  double temperature = 0.) const override;
159 
161  double BirksCorrection(double dQdX) const override;
162  double BirksCorrection(double dQdX, double EField) const override;
163  double ModBoxCorrection(double dQdX) const override;
164  double ModBoxCorrection(double dQdX, double EField) const override;
165 
166  double ElectronLifetime() const override
167  {
168  return fElectronlifetime; //< microseconds
169  }
170 
181  double Density(double temperature = 0.) const override;
182 
184  double Temperature() const override { return fTemperature; }
185 
200  double Eloss(double mom, double mass, double tcut) const override;
201 
210  double ElossVar(double mom, double mass) const override;
211 
212  double ElectronsToADC() const override { return fElectronsToADC; }
213  unsigned int NumberTimeSamples() const override { return fNumberTimeSamples; }
214  unsigned int ReadOutWindowSize() const override { return fReadOutWindowSize; }
215  double TimeOffsetU() const override { return fTimeOffsetU; };
216  double TimeOffsetV() const override { return fTimeOffsetV; };
217  double TimeOffsetZ() const override { return fTimeOffsetZ; };
218  double TimeOffsetY() const override { return fTimeOffsetY; };
219 
220  bool SimpleBoundary() const override { return fSimpleBoundary; }
221 
222  DetectorPropertiesData DataFor(detinfo::DetectorClocksData const& clock_data) const override;
223 
224  private:
235  std::set<std::string> const& ignore_params);
236 
237  std::string CheckTimeOffsets(std::set<geo::View_t> const& requested_views) const;
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.
252 
253  std::vector<double> fEfield;
255  double fTemperature;
257  unsigned int fNumberTimeSamples;
259  unsigned int fReadOutWindowSize;
260  double fTimeOffsetU;
261  double fTimeOffsetV;
263  double fTimeOffsetZ;
265  double fTimeOffsetY;
267  double fTimeOffsetX;
269  double fDriftVelFudgeFactor;
271 
274 
281 
283 
284  std::vector<std::vector<double>> fDriftDirection;
285 
287 
288  double fModBoxA;
289  double fModBoxB;
290 
291  }; // class DetectorPropertiesStandard
292 } // namespace detinfo
293 
294 #endif // DETINFO_DETECTOR_PROPERTIES_H
unsigned int ReadOutWindowSize() const override
DetectorPropertiesStandard(fhicl::ParameterSet const &pset, const geo::GeometryCore *geo, const detinfo::LArProperties *lp, std::set< std::string > const &ignore_params={})
unsigned int NumberTimeSamples() const override
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 detector geometry.
constexpr double kModBoxB
Modified Box Beta in g/(MeV cm²)*kV/cm.
SternheimerParameters_t fSternheimerParameters
Sternheimer parameters.
std::string CheckTimeOffsets(std::set< geo::View_t > const &requested_views) const
General LArSoft Utilities.
Description of geometry of one entire detector.
Definition: GeometryCore.h:119
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.
Namespace collecting geometry-related classes utilities.
double Eloss(double mom, double mass, double tcut) const override
Restricted mean energy loss (dE/dx)