LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
detinfo::DetectorPropertiesStandard Class Referencefinal

#include "DetectorPropertiesStandard.h"

Inheritance diagram for detinfo::DetectorPropertiesStandard:
detinfo::DetectorProperties

Classes

struct  Configuration_t
 Structure for configuration parameters. More...
 
struct  SternheimerParameters_t
 Parameters for Sternheimer density effect corrections. More...
 

Public Types

using providers_type = lar::ProviderPack< geo::GeometryCore, detinfo::LArProperties >
 List of service providers we depend on. More...
 

Public Member Functions

 DetectorPropertiesStandard (fhicl::ParameterSet const &pset, const geo::GeometryCore *geo, const detinfo::LArProperties *lp, std::set< std::string > const &ignore_params={})
 
 DetectorPropertiesStandard (DetectorPropertiesStandard const &)=delete
 
virtual ~DetectorPropertiesStandard ()=default
 
void SetNumberTimeSamples (unsigned int nsamp)
 
double Efield (unsigned int planegap=0) const override
 kV/cm More...
 
double DriftVelocity (double efield=0., double temperature=0.) const override
 cm/us More...
 
double BirksCorrection (double dQdX) const override
 dQ/dX in electrons/cm, returns dE/dX in MeV/cm. More...
 
double BirksCorrection (double dQdX, double EField) const override
 
double ModBoxCorrection (double dQdX) const override
 
double ModBoxCorrection (double dQdX, double EField) const override
 
double ElectronLifetime () const override
 Returns the attenuation constant for ionization electrons. More...
 
double Density (double temperature=0.) const override
 Returns argon density at a given temperature. More...
 
double Temperature () const override
 In kelvin. More...
 
double Eloss (double mom, double mass, double tcut) const override
 Restricted mean energy loss (dE/dx) More...
 
double ElossVar (double mom, double mass) const override
 Energy loss fluctuation ( $ \sigma_{E}^2 / x $) More...
 
double ElectronsToADC () const override
 
unsigned int NumberTimeSamples () const override
 
unsigned int ReadOutWindowSize () const override
 
double TimeOffsetU () const override
 
double TimeOffsetV () const override
 
double TimeOffsetZ () const override
 
double TimeOffsetY () const override
 
bool SimpleBoundary () const override
 
DetectorPropertiesData DataFor (detinfo::DetectorClocksData const &clock_data) const override
 
virtual double Density () const
 Returns argon density at the temperature from Temperature() More...
 

Private Member Functions

void ValidateAndConfigure (fhicl::ParameterSet const &p, std::set< std::string > const &ignore_params)
 Configures the provider, first validating the configuration. More...
 
std::string CheckTimeOffsets (std::set< geo::View_t > const &requested_views) const
 

Private Attributes

const detinfo::LArPropertiesfLP
 
const geo::GeometryCorefGeo
 
std::vector< double > fEfield
 kV/cm (per inter-plane volume) ! More...
 
double fElectronlifetime
 microseconds More...
 
double fTemperature
 kelvin More...
 
double fElectronsToADC
 
unsigned int fNumberTimeSamples
 number of clock ticks per event More...
 
unsigned int fReadOutWindowSize
 number of clock ticks per readout window More...
 
double fTimeOffsetU
 
double fTimeOffsetV
 
double fTimeOffsetZ
 
double fTimeOffsetY
 
double fTimeOffsetX
 
double fDriftVelFudgeFactor
 
bool fUseIcarusMicrobooneDriftModel
 
bool fIncludeInterPlanePitchInXTickOffsets
 
SternheimerParameters_t fSternheimerParameters
 Sternheimer parameters. More...
 
std::vector< std::vector< double > > fDriftDirection
 
bool fSimpleBoundary
 
double fModBoxA
 
double fModBoxB
 

Detailed Description

Definition at line 36 of file DetectorPropertiesStandard.h.

Member Typedef Documentation

Constructor & Destructor Documentation

detinfo::DetectorPropertiesStandard::DetectorPropertiesStandard ( fhicl::ParameterSet const &  pset,
const geo::GeometryCore geo,
const detinfo::LArProperties lp,
std::set< std::string > const &  ignore_params = {} 
)

Definition at line 29 of file DetectorPropertiesStandard.cxx.

References ValidateAndConfigure().

33  : fLP(lp), fGeo(geo)
34  {
35  ValidateAndConfigure(pset, ignore_params);
36  }
void ValidateAndConfigure(fhicl::ParameterSet const &p, std::set< std::string > const &ignore_params)
Configures the provider, first validating the configuration.
detinfo::DetectorPropertiesStandard::DetectorPropertiesStandard ( DetectorPropertiesStandard const &  )
delete
virtual detinfo::DetectorPropertiesStandard::~DetectorPropertiesStandard ( )
virtualdefault

Member Function Documentation

double detinfo::DetectorPropertiesStandard::BirksCorrection ( double  dQdX) const
overridevirtual

dQ/dX in electrons/cm, returns dE/dX in MeV/cm.

Implements detinfo::DetectorProperties.

Definition at line 298 of file DetectorPropertiesStandard.cxx.

References Efield().

Referenced by SetNumberTimeSamples().

299  {
300  return BirksCorrection(dQdx, Efield());
301  }
double Efield(unsigned int planegap=0) const override
kV/cm
double BirksCorrection(double dQdX) const override
dQ/dX in electrons/cm, returns dE/dX in MeV/cm.
double detinfo::DetectorPropertiesStandard::BirksCorrection ( double  dQdX,
double  EField 
) const
overridevirtual

Implements detinfo::DetectorProperties.

Definition at line 302 of file DetectorPropertiesStandard.cxx.

References tca::dEdx(), detinfo::DetectorProperties::Density(), util::kGeVToElectrons, util::kRecombA, and util::kRecombk.

303  {
304  // Correction for charge quenching using parameterization from
305  // S.Amoruso et al., NIM A 523 (2004) 275
306 
307  constexpr double A3t = util::kRecombA;
308  double K3t = util::kRecombk; // in KV/cm*(g/cm^2)/MeV
309  double const rho = Density(); // LAr density in g/cm^3
310  constexpr double Wion = 1000. / util::kGeVToElectrons; // 23.6 eV = 1e, Wion in MeV/e
311  K3t /= rho; // KV/MeV
312  double const dEdx = dQdx / (A3t / Wion - K3t / E_field * dQdx); // MeV/cm
313 
314  return dEdx;
315  }
virtual double Density() const
Returns argon density at the temperature from Temperature()
constexpr double kGeVToElectrons
23.6eV per ion pair, 1e9 eV/GeV
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2675
constexpr double kRecombk
constexpr double kRecombA
A constant.
std::string detinfo::DetectorPropertiesStandard::CheckTimeOffsets ( std::set< geo::View_t > const &  requested_views) const
private

Definition at line 458 of file DetectorPropertiesStandard.cxx.

References fGeo, geo::kU, geo::kV, geo::kX, geo::kY, geo::kZ, and geo::GeometryCore::Views().

Referenced by SimpleBoundary(), and ValidateAndConfigure().

460  {
461  auto const& present_views = fGeo->Views();
462 
463  auto view_diff = [&present_views, &requested_views](geo::View_t const view) {
464  return static_cast<int>(present_views.count(view)) -
465  static_cast<int>(requested_views.count(view));
466  };
467 
468  // It is not an error to specify an offset if the view does not
469  // exist. However, if a view does exist, and an offset does not,
470  // then that will end the job.
471  std::ostringstream errors;
472  if (auto diff = view_diff(geo::kU); diff > 0) { errors << "TimeOffsetU missing for view U.\n"; }
473  if (auto diff = view_diff(geo::kV); diff > 0) { errors << "TimeOffsetV missing for view V.\n"; }
474  if (auto diff = view_diff(geo::kZ); diff > 0) { errors << "TimeOffsetZ missing for view Z.\n"; }
475  if (auto diff = view_diff(geo::kY); diff > 0) { errors << "TimeOffsetY missing for view Y.\n"; }
476  if (auto diff = view_diff(geo::kX); diff > 0) { errors << "TimeOffsetX missing for view X.\n"; }
477  return errors.str();
478  }
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Planes which measure V.
Definition: geo_types.h:136
Planes which measure X direction.
Definition: geo_types.h:140
Planes which measure Z direction.
Definition: geo_types.h:138
Planes which measure Y direction.
Definition: geo_types.h:139
Planes which measure U.
Definition: geo_types.h:135
std::set< View_t > const & Views() const
Returns a list of possible views in the detector.
DetectorPropertiesData detinfo::DetectorPropertiesStandard::DataFor ( detinfo::DetectorClocksData const &  clock_data) const
overridevirtual

< special case for ArgoNeuT

Implements detinfo::DetectorProperties.

Definition at line 346 of file DetectorPropertiesStandard.cxx.

References geo::GeometryCore::Cryostat(), dir, geo::TPCGeo::DriftDirection(), DriftVelocity(), Efield(), fGeo, fIncludeInterPlanePitchInXTickOffsets, fTimeOffsetU, fTimeOffsetV, fTimeOffsetX, fTimeOffsetY, fTimeOffsetZ, geo::PlaneGeo::GetCenter(), geo::kNegX, geo::kU, geo::kV, geo::kX, geo::kY, geo::kZ, geo::GeometryCore::Ncryostats(), geo::TPCGeo::Nplanes(), geo::TPCGeo::Plane(), geo::TPCGeo::PlanePitch(), detinfo::sampling_rate(), Temperature(), detinfo::trigger_offset(), and geo::PlaneGeo::View().

Referenced by detinfo::DetectorPropertiesServiceStandard::getDataFor(), detinfo::DetectorPropertiesServiceStandard::getDataForJob(), and SimpleBoundary().

348  {
349  double const samplingRate = sampling_rate(clock_data);
350  double const efield = Efield();
351  double const temperature = Temperature();
352  double const driftVelocity = DriftVelocity(efield, temperature);
353  double const x_ticks_coefficient = 0.001 * driftVelocity * samplingRate;
354 
355  double const triggerOffset = trigger_offset(clock_data);
356 
357  std::vector<std::vector<std::vector<double>>> x_ticks_offsets(fGeo->Ncryostats());
358  std::vector<std::vector<double>> drift_direction(fGeo->Ncryostats());
359 
360  for (size_t cstat = 0; cstat < fGeo->Ncryostats(); ++cstat) {
361  auto const& cryostat = fGeo->Cryostat(geo::CryostatID(cstat));
362  x_ticks_offsets[cstat].resize(cryostat.NTPC());
363  drift_direction[cstat].resize(cryostat.NTPC());
364 
365  for (size_t tpc = 0; tpc < cryostat.NTPC(); ++tpc) {
366  const geo::TPCGeo& tpcgeom = cryostat.TPC(tpc);
367 
368  const double dir((tpcgeom.DriftDirection() == geo::kNegX) ? +1.0 : -1.0);
369  drift_direction[cstat][tpc] = dir;
370 
371  int nplane = tpcgeom.Nplanes();
372  x_ticks_offsets[cstat][tpc].resize(nplane, 0.);
373  for (int plane = 0; plane < nplane; ++plane) {
374  const geo::PlaneGeo& pgeom = tpcgeom.Plane(plane);
375 
376  //Choose which plane to propagate to
377  //If accounting for the drift time between planes, start with the first plane,
378  //and iteratively add distances between planes
379  //Otherwise propagate straight to the last plane and
380  //assume a standard drift velocity (for wirecell recob::Wires)
381  unsigned int planeToPropagateTo =
382  (fIncludeInterPlanePitchInXTickOffsets ? 0 : tpcgeom.Nplanes() - 1);
383  // Calculate geometric time offset.
384  // only works if xyz[0]<=0
385  auto const xyz = tpcgeom.Plane(planeToPropagateTo).GetCenter();
386 
387  x_ticks_offsets[cstat][tpc][plane] =
388  -xyz.X() / (dir * x_ticks_coefficient) + triggerOffset;
389 
391  // Get field in gap between planes
392  double efieldgap[3];
393  double driftVelocitygap[3];
394  double x_ticks_coefficient_gap[3];
395  for (int igap = 0; igap < 3; ++igap) {
396  efieldgap[igap] = Efield(igap);
397  driftVelocitygap[igap] = DriftVelocity(efieldgap[igap], temperature);
398  x_ticks_coefficient_gap[igap] = 0.001 * driftVelocitygap[igap] * samplingRate;
399  }
400 
401  if (nplane == 3) {
402  /*
403  | ---------- plane = 2 (collection)
404  | Coeff[2]
405  | ---------- plane = 1 (2nd induction)
406  | Coeff[1]
407  | ---------- plane = 0 (1st induction) x = xyz[0]
408  | Coeff[0]
409  | ---------- x = 0
410  V For plane = 0, t offset is -xyz[0]/Coeff[0]
411  x */
412  for (int ip = 0; ip < plane; ++ip) {
413  x_ticks_offsets[cstat][tpc][plane] +=
414  tpcgeom.PlanePitch(ip, ip + 1) / x_ticks_coefficient_gap[ip + 1];
415  }
416  }
417  else if (nplane == 2) {
418  /*
419  | ---------- plane = 1 (collection)
420  | Coeff[2]
421  | ---------- plane = 0 (2nd induction) x = xyz[0]
422  | ---------- x = 0, Coeff[1]
423  V ---------- first induction plane
424  x Coeff[0]
425  For plane = 0, t offset is pitch/Coeff[1] -
426  (pitch+xyz[0])/Coeff[0] = -xyz[0]/Coeff[0] -
427  pitch*(1/Coeff[0]-1/Coeff[1])
428  */
429  for (int ip = 0; ip < plane; ++ip) {
430  x_ticks_offsets[cstat][tpc][plane] +=
431  tpcgeom.PlanePitch(ip, ip + 1) / x_ticks_coefficient_gap[ip + 2];
432  }
433  x_ticks_offsets[cstat][tpc][plane] -=
434  tpcgeom.PlanePitch() * (1 / x_ticks_coefficient - 1 / x_ticks_coefficient_gap[1]);
435  }
436 
437  } // end if fIncludeInterPlanePitchInXTickOffsets
438 
439  // Add view dependent offset
440  // FIXME the offset should be plane-dependent
441  geo::View_t view = pgeom.View();
442  switch (view) {
443  case geo::kU: x_ticks_offsets[cstat][tpc][plane] += fTimeOffsetU; break;
444  case geo::kV: x_ticks_offsets[cstat][tpc][plane] += fTimeOffsetV; break;
445  case geo::kZ: x_ticks_offsets[cstat][tpc][plane] += fTimeOffsetZ; break;
446  case geo::kY: x_ticks_offsets[cstat][tpc][plane] += fTimeOffsetY; break;
447  case geo::kX: x_ticks_offsets[cstat][tpc][plane] += fTimeOffsetX; break;
448  default: throw cet::exception(__FUNCTION__) << "Bad view = " << view << "\n";
449  } // switch
450  }
451  }
452  }
453 
454  return DetectorPropertiesData{
455  *this, x_ticks_coefficient, move(x_ticks_offsets), move(drift_direction)};
456  }
double PlanePitch(unsigned int p1=0, unsigned int p2=1) const
Returns the center of the TPC volume in world coordinates [cm].
Definition: TPCGeo.cxx:361
Point_t const & GetCenter() const
Returns the centre of the wire plane in world coordinates [cm].
Definition: PlaneGeo.h:435
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
double Efield(unsigned int planegap=0) const override
kV/cm
Planes which measure V.
Definition: geo_types.h:136
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:137
Planes which measure X direction.
Definition: geo_types.h:140
Geometry information for a single TPC.
Definition: TPCGeo.h:36
double Temperature() const override
In kelvin.
Planes which measure Z direction.
Definition: geo_types.h:138
Drift towards negative X values.
Definition: geo_types.h:167
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:430
CryostatGeo const & Cryostat(CryostatID const &cryoid=cryostat_zero) const
Returns the specified cryostat.
Planes which measure Y direction.
Definition: geo_types.h:139
Planes which measure U.
Definition: geo_types.h:135
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:166
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:78
DriftDirection_t DriftDirection() const
Returns an enumerator value describing the drift direction.
Definition: TPCGeo.h:121
TDirectory * dir
Definition: macro.C:5
int trigger_offset(DetectorClocksData const &data)
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:252
double DriftVelocity(double efield=0., double temperature=0.) const override
cm/us
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
The data type to uniquely identify a cryostat.
Definition: geo_types.h:192
double detinfo::DetectorPropertiesStandard::Density ( double  temperature = 0.) const
overridevirtual

Returns argon density at a given temperature.

Parameters
temperaturethe temperature in kelvin
Returns
argon density in g/cm^3

Density is nearly a linear function of temperature. See the NIST tables for details Slope is between -6.2 and -6.1, intercept is 1928 kg/m^3. This parameterization will be good to better than 0.5%.g/cm^3

Implements detinfo::DetectorProperties.

Definition at line 105 of file DetectorPropertiesStandard.cxx.

References Temperature().

106  {
107  // Default temperature use internal value.
108  if (temperature == 0.) temperature = Temperature();
109 
110  return -0.00615 * temperature + 1.928;
111  }
double Temperature() const override
In kelvin.
double detinfo::DetectorPropertiesStandard::DriftVelocity ( double  efield = 0.,
double  temperature = 0. 
) const
overridevirtual

cm/us

Implements detinfo::DetectorProperties.

Definition at line 185 of file DetectorPropertiesStandard.cxx.

References Efield(), fDriftVelFudgeFactor, fUseIcarusMicrobooneDriftModel, and Temperature().

Referenced by DataFor(), and SetNumberTimeSamples().

186  {
187  // Drift Velocity as a function of Electric Field and LAr Temperature
188  // from : W. Walkowiak, NIM A 449 (2000) 288-294
189  //
190  // Option to use MicroBooNE+ICARUS model (as in arXiv:2008.09765) provided as
191  // well, with temperature depenence as prescribed by Mike Mooney based on
192  // looking at the Walkowiak data.
193  //
194  // Efield should have units of kV/cm
195  // Temperature should have units of Kelvin
196 
197  // Default Efield, use internal value.
198  if (efield == 0.) efield = Efield();
199 
200  if (efield > 4.0)
201  mf::LogWarning("DetectorPropertiesStandard")
202  << "DriftVelocity Warning! : E-field value of " << efield
203  << " kV/cm is outside of range covered by drift"
204  << " velocity parameterization. Returned value"
205  << " may not be correct";
206 
207  // Default temperature use internal value.
208  if (temperature == 0.) temperature = Temperature();
209 
210  if (temperature < 87.0 || temperature > 94.0)
211  mf::LogWarning("DetectorPropertiesStandard")
212  << "DriftVelocity Warning! : Temperature value of " << temperature
213  << " K is outside of range covered by drift velocity"
214  << " parameterization. Returned value may not be"
215  << " correct";
216 
217  double vd;
218 
220  double const tshift = -87.203 + temperature;
221  double const xFit = 0.0938163 - 0.0052563 * tshift - 0.0001470 * tshift * tshift;
222  double const uFit = 5.18406 + 0.01448 * tshift - 0.003497 * tshift * tshift -
223  0.000516 * tshift * tshift * tshift;
224 
225  // Icarus Parameter Set, use as default
226  constexpr double P1 = -0.04640; // K^-1
227  constexpr double P2 = 0.01712; // K^-1
228  constexpr double P3 = 1.88125; // (kV/cm)^-1
229  constexpr double P4 = 0.99408; // kV/cm
230  constexpr double P5 = 0.01172; // (kV/cm)^-P6
231  constexpr double P6 = 4.20214;
232  constexpr double T0 = 105.749; // K
233 
234  // Walkowiak Parameter Set
235  constexpr double P1W = -0.01481; // K^-1
236  constexpr double P2W = -0.0075; // K^-1
237  constexpr double P3W = 0.141; // (kV/cm)^-1
238  constexpr double P4W = 12.4; // kV/cm
239  constexpr double P5W = 1.627; // (kV/cm)^-P6
240  constexpr double P6W = 0.317;
241  constexpr double T0W = 90.371; // K
242 
243  // From Craig Thorne . . . currently not documented
244  // smooth transition from linear at small fields to
245  // icarus fit at most fields to Walkowiak at very high fields
246  if (efield < xFit)
247  vd = efield * uFit;
248  else if (efield < 0.619) {
249  vd = ((P1 * (temperature - T0) + 1) *
250  (P3 * efield * std::log(1 + P4 / efield) + P5 * std::pow(efield, P6)) +
251  P2 * (temperature - T0));
252  }
253  else if (efield < 0.699) {
254  vd = 12.5 * (efield - 0.619) *
255  ((P1W * (temperature - T0W) + 1) *
256  (P3W * efield * std::log(1 + P4W / efield) + P5W * std::pow(efield, P6W)) +
257  P2W * (temperature - T0W)) +
258  12.5 * (0.699 - efield) *
259  ((P1 * (temperature - T0) + 1) *
260  (P3 * efield * std::log(1 + P4 / efield) + P5 * std::pow(efield, P6)) +
261  P2 * (temperature - T0));
262  }
263  else {
264  vd = ((P1W * (temperature - T0W) + 1) *
265  (P3W * efield * std::log(1 + P4W / efield) + P5W * std::pow(efield, P6W)) +
266  P2W * (temperature - T0W));
267  }
268  }
269 
270  // MicroBooNE+ICARUS model (arXiv:2008.09765) with temperature dependence given by
271  // Mike Mooney based on looking at Walkowiak data (NIM A 449 (2000) 288-294)
273  constexpr double P0 = 0.;
274  constexpr double P1 = 5.53416;
275  constexpr double P2 = -6.53093;
276  constexpr double P3 = 3.20752;
277  constexpr double P4 = 0.389696;
278  constexpr double P5 = -0.556184;
279  vd = (1.0 - 0.0184 * (temperature - 89.0)) *
280  (P0 + P1 * cet::pow<1>(efield) + P2 * cet::pow<2>(efield) + P3 * cet::pow<3>(efield) +
281  P4 * cet::pow<4>(efield) + P5 * cet::pow<5>(efield));
282  }
283 
284  vd *= fDriftVelFudgeFactor / 10.;
285 
286  return vd; // in cm/us
287  }
double Efield(unsigned int planegap=0) const override
kV/cm
double Temperature() const override
In kelvin.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
double detinfo::DetectorPropertiesStandard::Efield ( unsigned int  planegap = 0) const
overridevirtual

kV/cm

Implements detinfo::DetectorProperties.

Definition at line 95 of file DetectorPropertiesStandard.cxx.

References fEfield.

Referenced by BirksCorrection(), DataFor(), DriftVelocity(), and ModBoxCorrection().

96  {
97  if (planegap >= fEfield.size())
98  throw cet::exception("DetectorPropertiesStandard")
99  << "requesting Electric field in a plane gap that is not defined\n";
100 
101  return fEfield[planegap];
102  }
std::vector< double > fEfield
kV/cm (per inter-plane volume) !
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
double detinfo::DetectorPropertiesStandard::ElectronLifetime ( ) const
inlineoverridevirtual

Returns the attenuation constant for ionization electrons.

Returns
the attenuation constant [µs]

The returned constant τ can be used to know the attenuation the ionization charge undergoes after drifting for a certain time t: $ A(t) = e^{-t/\tau} $ (t is measured in microseconds).

This is a uniform, constant value for the detector.

Implements detinfo::DetectorProperties.

Definition at line 166 of file DetectorPropertiesStandard.h.

References detinfo::DetectorProperties::Density(), and fElectronlifetime.

167  {
168  return fElectronlifetime; //< microseconds
169  }
double detinfo::DetectorPropertiesStandard::ElectronsToADC ( ) const
inlineoverridevirtual
double detinfo::DetectorPropertiesStandard::Eloss ( double  mom,
double  mass,
double  tcut 
) const
overridevirtual

Restricted mean energy loss (dE/dx)

Parameters
mommomentum of incident particle [GeV/c]
massmass of incident particle [GeV/c^2]
tcutmaximum kinetic energy of delta rays [MeV]; 0 for unlimited
Returns
the restricted mean energy loss (dE/dx) in units of MeV/cm

Returned value is always positive. For unrestricted mean energy loss, set tcut = 0 (special case), or tcut large.

Based on Bethe-Bloch formula as contained in particle data book. Material parameters are from the configuration.

Implements detinfo::DetectorProperties.

Definition at line 130 of file DetectorPropertiesStandard.cxx.

References detinfo::DetectorPropertiesStandard::SternheimerParameters_t::a, detinfo::LArProperties::AtomicMass(), detinfo::LArProperties::AtomicNumber(), detinfo::DetectorPropertiesStandard::SternheimerParameters_t::cbar, detinfo::DetectorProperties::Density(), e, detinfo::LArProperties::ExcitationEnergy(), fLP, fSternheimerParameters, detinfo::DetectorPropertiesStandard::SternheimerParameters_t::k, x, detinfo::DetectorPropertiesStandard::SternheimerParameters_t::x0, and detinfo::DetectorPropertiesStandard::SternheimerParameters_t::x1.

Referenced by Temperature().

131  {
132  // Some constants.
133  constexpr double K = 0.307075; // 4 pi N_A r_e^2 m_e c^2 (MeV cm^2/mol).
134  constexpr double me = 0.510998918; // Electron mass (MeV/c^2).
135 
136  // Calculate kinematic quantities.
137  double const bg = mom / mass; // beta*gamma.
138  double const gamma = sqrt(1. + bg * bg); // gamma.
139  double const beta = bg / gamma; // beta (velocity).
140  double const mer = 0.001 * me / mass; // electron mass / mass of incident particle.
141  double const tmax =
142  2. * me * bg * bg / (1. + 2. * gamma * mer + mer * mer); // Maximum delta ray energy (MeV).
143 
144  // Make sure tcut does not exceed tmax.
145  if (tcut == 0. || tcut > tmax) tcut = tmax;
146 
147  // Calculate density effect correction (delta).
148  double const x = std::log10(bg);
149  double delta = 0.;
150  if (x >= fSternheimerParameters.x0) {
151  delta = 2. * std::log(10.) * x - fSternheimerParameters.cbar;
152  if (x < fSternheimerParameters.x1)
153  delta += fSternheimerParameters.a *
155  }
156 
157  // Calculate stopping number.
158  double B =
159  0.5 * std::log(2. * me * bg * bg * tcut / (1.e-12 * cet::square(fLP->ExcitationEnergy()))) -
160  0.5 * beta * beta * (1. + tcut / tmax) - 0.5 * delta;
161 
162  // Don't let the stopping number become negative.
163  if (B < 1.) B = 1.;
164 
165  // Calculate dE/dx.
166  return Density() * K * fLP->AtomicNumber() * B / (fLP->AtomicMass() * beta * beta);
167  }
Float_t x
Definition: compare.C:6
virtual double Density() const
Returns argon density at the temperature from Temperature()
virtual double ExcitationEnergy() const =0
Mean excitation energy of the liquid (eV)
virtual double AtomicMass() const =0
Atomic mass of the liquid (g/mol)
SternheimerParameters_t fSternheimerParameters
Sternheimer parameters.
virtual double AtomicNumber() const =0
Atomic number of the liquid.
Float_t e
Definition: plot.C:35
double detinfo::DetectorPropertiesStandard::ElossVar ( double  mom,
double  mass 
) const
overridevirtual

Energy loss fluctuation ( $ \sigma_{E}^2 / x $)

Parameters
mommomentum of incident particle in [GeV/c]
massmass of incident particle [GeV/c^2]
Returns
energy loss fluctuation in MeV^2/cm

Based on Bichsel formula referred to but not given in PDG.

Implements detinfo::DetectorProperties.

Definition at line 170 of file DetectorPropertiesStandard.cxx.

References detinfo::LArProperties::AtomicMass(), detinfo::LArProperties::AtomicNumber(), detinfo::DetectorProperties::Density(), and fLP.

Referenced by Temperature().

171  {
172  // Some constants.
173  constexpr double K = 0.307075; // 4 pi N_A r_e^2 m_e c^2 (MeV cm^2/mol).
174  constexpr double me = 0.510998918; // Electron mass (MeV/c^2).
175 
176  // Calculate kinematic quantities.
177  double const bg = mom / mass; // beta*gamma.
178  double const gamma2 = 1. + bg * bg; // gamma^2.
179  double const beta2 = bg * bg / gamma2; // beta^2.
180  return gamma2 * (1. - 0.5 * beta2) * me * (fLP->AtomicNumber() / fLP->AtomicMass()) * K *
181  Density();
182  }
virtual double Density() const
Returns argon density at the temperature from Temperature()
virtual double AtomicMass() const =0
Atomic mass of the liquid (g/mol)
virtual double AtomicNumber() const =0
Atomic number of the liquid.
double detinfo::DetectorPropertiesStandard::ModBoxCorrection ( double  dQdX) const
overridevirtual

Implements detinfo::DetectorProperties.

Definition at line 319 of file DetectorPropertiesStandard.cxx.

References Efield().

Referenced by SetNumberTimeSamples().

320  {
321  return ModBoxCorrection(dQdx, Efield());
322  }
double Efield(unsigned int planegap=0) const override
kV/cm
double ModBoxCorrection(double dQdX) const override
double detinfo::DetectorPropertiesStandard::ModBoxCorrection ( double  dQdX,
double  EField 
) const
overridevirtual

Implements detinfo::DetectorProperties.

Definition at line 323 of file DetectorPropertiesStandard.cxx.

References tca::dEdx(), detinfo::DetectorProperties::Density(), fModBoxA, fModBoxB, and util::kGeVToElectrons.

324  {
325  // Modified Box model correction has better behavior than the Birks
326  // correction at high values of dQ/dx.
327  double const rho = Density(); // LAr density in g/cm^3
328  constexpr double Wion = 1000. / util::kGeVToElectrons; // 23.6 eV = 1e, Wion in MeV/e
329  double const Beta = fModBoxB / (rho * E_field);
330  double const Alpha = fModBoxA;
331  double const dEdx = (exp(Beta * Wion * dQdx) - Alpha) / Beta;
332 
333  return dEdx;
334  }
virtual double Density() const
Returns argon density at the temperature from Temperature()
constexpr double kGeVToElectrons
23.6eV per ion pair, 1e9 eV/GeV
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2675
unsigned int detinfo::DetectorPropertiesStandard::NumberTimeSamples ( ) const
inlineoverridevirtual

Implements detinfo::DetectorProperties.

Definition at line 213 of file DetectorPropertiesStandard.h.

References fNumberTimeSamples.

Referenced by detinfo::DetectorPropertiesServiceStandard::postOpenFile().

213 { return fNumberTimeSamples; }
unsigned int fNumberTimeSamples
number of clock ticks per event
unsigned int detinfo::DetectorPropertiesStandard::ReadOutWindowSize ( ) const
inlineoverridevirtual

Implements detinfo::DetectorProperties.

Definition at line 214 of file DetectorPropertiesStandard.h.

References fReadOutWindowSize.

214 { return fReadOutWindowSize; }
unsigned int fReadOutWindowSize
number of clock ticks per readout window
void detinfo::DetectorPropertiesStandard::SetNumberTimeSamples ( unsigned int  nsamp)
inline
bool detinfo::DetectorPropertiesStandard::SimpleBoundary ( ) const
inlineoverridevirtual
double detinfo::DetectorPropertiesStandard::Temperature ( ) const
inlineoverridevirtual

In kelvin.

Implements detinfo::DetectorProperties.

Definition at line 184 of file DetectorPropertiesStandard.h.

References Eloss(), ElossVar(), and fTemperature.

Referenced by DataFor(), Density(), and DriftVelocity().

double detinfo::DetectorPropertiesStandard::TimeOffsetU ( ) const
inlineoverridevirtual
double detinfo::DetectorPropertiesStandard::TimeOffsetV ( ) const
inlineoverridevirtual
double detinfo::DetectorPropertiesStandard::TimeOffsetY ( ) const
inlineoverridevirtual

Reimplemented from detinfo::DetectorProperties.

Definition at line 218 of file DetectorPropertiesStandard.h.

References fTimeOffsetY.

Referenced by ValidateAndConfigure().

double detinfo::DetectorPropertiesStandard::TimeOffsetZ ( ) const
inlineoverridevirtual
void detinfo::DetectorPropertiesStandard::ValidateAndConfigure ( fhicl::ParameterSet const &  p,
std::set< std::string > const &  ignore_params 
)
private

Configures the provider, first validating the configuration.

Parameters
pconfiguration parameter set
ignore_paramsparameters to be ignored (optional)

This method will validate the parameter set (except for the parameters it's explicitly told to ignore) and extract the useful information out of it.

Definition at line 39 of file DetectorPropertiesStandard.cxx.

References detinfo::DetectorPropertiesStandard::SternheimerParameters_t::a, detinfo::DetectorPropertiesStandard::SternheimerParameters_t::cbar, CheckTimeOffsets(), tca::debug, fDriftVelFudgeFactor, fEfield, fElectronlifetime, fElectronsToADC, fIncludeInterPlanePitchInXTickOffsets, fModBoxA, fModBoxB, fNumberTimeSamples, fReadOutWindowSize, fSimpleBoundary, fSternheimerParameters, fTemperature, fTimeOffsetU, fTimeOffsetV, fTimeOffsetX, fTimeOffsetY, fTimeOffsetZ, fUseIcarusMicrobooneDriftModel, lar::IgnorableProviderConfigKeys(), detinfo::DetectorPropertiesStandard::SternheimerParameters_t::k, geo::kU, geo::kV, geo::kX, geo::kY, geo::kZ, TimeOffsetU(), TimeOffsetV(), TimeOffsetY(), TimeOffsetZ(), detinfo::DetectorPropertiesStandard::SternheimerParameters_t::x0, and detinfo::DetectorPropertiesStandard::SternheimerParameters_t::x1.

Referenced by DetectorPropertiesStandard(), and SimpleBoundary().

41  {
42  {
43  mf::LogInfo debug("setupProvider<DetectorPropertiesStandard>");
44 
45  debug << "Asked to ignore " << ignore_params.size() << " keys:";
46  for (auto const& key : ignore_params)
47  debug << " '" << key << "'";
48  }
49 
50  std::set<std::string> ignorable_keys = lar::IgnorableProviderConfigKeys();
51  ignorable_keys.insert(ignore_params.begin(), ignore_params.end());
52 
53  // parses and validates the parameter set:
54  fhicl::Table<Configuration_t> const config{p, ignorable_keys};
55 
56  fEfield = config().Efield();
57  fElectronlifetime = config().Electronlifetime();
58  fTemperature = config().Temperature();
59  fElectronsToADC = config().ElectronsToADC();
60  fNumberTimeSamples = config().NumberTimeSamples();
61  fReadOutWindowSize = config().ReadOutWindowSize();
62 
63  std::set<geo::View_t> present_views;
64  if (config().TimeOffsetU(fTimeOffsetU)) present_views.insert(geo::kU);
65  if (config().TimeOffsetV(fTimeOffsetV)) present_views.insert(geo::kV);
66  if (config().TimeOffsetZ(fTimeOffsetZ)) present_views.insert(geo::kZ);
67  if (config().TimeOffsetY(fTimeOffsetY)) present_views.insert(geo::kY);
68  if (config().TimeOffsetX(fTimeOffsetX)) present_views.insert(geo::kX);
69 
70  std::string const errors = CheckTimeOffsets(present_views);
71  if (!errors.empty()) {
72  throw cet::exception("DetectorPropertiesStandard") << "Detected configuration errors: \n"
73  << errors;
74  }
75 
76  fSternheimerParameters.a = config().SternheimerA();
77  fSternheimerParameters.k = config().SternheimerK();
78  fSternheimerParameters.x0 = config().SternheimerX0();
79  fSternheimerParameters.x1 = config().SternheimerX1();
80  fSternheimerParameters.cbar = config().SternheimerCbar();
81 
82  fDriftVelFudgeFactor = config().DriftVelFudgeFactor();
83 
84  fUseIcarusMicrobooneDriftModel = config().UseIcarusMicrobooneDriftModel();
85 
86  fIncludeInterPlanePitchInXTickOffsets = config().IncludeInterPlanePitchInXTickOffsets();
87 
88  fSimpleBoundary = config().SimpleBoundary();
89 
90  fModBoxA = config().ModBoxAlpha();
91  fModBoxB = config().ModBoxBeta();
92  }
Planes which measure V.
Definition: geo_types.h:136
Planes which measure X direction.
Definition: geo_types.h:140
unsigned int fNumberTimeSamples
number of clock ticks per event
Planes which measure Z direction.
Definition: geo_types.h:138
Planes which measure Y direction.
Definition: geo_types.h:139
Planes which measure U.
Definition: geo_types.h:135
DebugStuff debug
Definition: DebugStruct.cxx:4
SternheimerParameters_t fSternheimerParameters
Sternheimer parameters.
std::set< std::string > const & IgnorableProviderConfigKeys()
Returns a list of configuration keys that providers should ignore.
Definition: ProviderUtil.h:34
std::string CheckTimeOffsets(std::set< geo::View_t > const &requested_views) const
unsigned int fReadOutWindowSize
number of clock ticks per readout window
std::vector< double > fEfield
kV/cm (per inter-plane volume) !
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Data Documentation

std::vector<std::vector<double> > detinfo::DetectorPropertiesStandard::fDriftDirection
private

Definition at line 284 of file DetectorPropertiesStandard.h.

double detinfo::DetectorPropertiesStandard::fDriftVelFudgeFactor
private

Scaling factor to allow "fudging" of drift velocity

Definition at line 270 of file DetectorPropertiesStandard.h.

Referenced by DriftVelocity(), and ValidateAndConfigure().

std::vector<double> detinfo::DetectorPropertiesStandard::fEfield
private

kV/cm (per inter-plane volume) !

Definition at line 253 of file DetectorPropertiesStandard.h.

Referenced by Efield(), and ValidateAndConfigure().

double detinfo::DetectorPropertiesStandard::fElectronlifetime
private

microseconds

Definition at line 254 of file DetectorPropertiesStandard.h.

Referenced by ElectronLifetime(), and ValidateAndConfigure().

double detinfo::DetectorPropertiesStandard::fElectronsToADC
private

conversion factor for # of ionization electrons to 1 ADC count

Definition at line 256 of file DetectorPropertiesStandard.h.

Referenced by ElectronsToADC(), and ValidateAndConfigure().

const geo::GeometryCore* detinfo::DetectorPropertiesStandard::fGeo
private

Definition at line 251 of file DetectorPropertiesStandard.h.

Referenced by CheckTimeOffsets(), and DataFor().

bool detinfo::DetectorPropertiesStandard::fIncludeInterPlanePitchInXTickOffsets
private

Historically, ConvertTicksToX has allowed for the drift time between the wire planes. This is appropriate for recob::RawDigits, and recob::Wires from the 1D unfolding, but is not appropriate for recob::Wires from WireCell.

Definition at line 280 of file DetectorPropertiesStandard.h.

Referenced by DataFor(), and ValidateAndConfigure().

const detinfo::LArProperties* detinfo::DetectorPropertiesStandard::fLP
private

Definition at line 250 of file DetectorPropertiesStandard.h.

Referenced by Eloss(), and ElossVar().

double detinfo::DetectorPropertiesStandard::fModBoxA
private

Definition at line 288 of file DetectorPropertiesStandard.h.

Referenced by ModBoxCorrection(), and ValidateAndConfigure().

double detinfo::DetectorPropertiesStandard::fModBoxB
private

Definition at line 289 of file DetectorPropertiesStandard.h.

Referenced by ModBoxCorrection(), and ValidateAndConfigure().

unsigned int detinfo::DetectorPropertiesStandard::fNumberTimeSamples
private

number of clock ticks per event

Definition at line 258 of file DetectorPropertiesStandard.h.

Referenced by NumberTimeSamples(), SetNumberTimeSamples(), and ValidateAndConfigure().

unsigned int detinfo::DetectorPropertiesStandard::fReadOutWindowSize
private

number of clock ticks per readout window

Definition at line 259 of file DetectorPropertiesStandard.h.

Referenced by ReadOutWindowSize(), and ValidateAndConfigure().

bool detinfo::DetectorPropertiesStandard::fSimpleBoundary
private

Definition at line 286 of file DetectorPropertiesStandard.h.

Referenced by SimpleBoundary(), and ValidateAndConfigure().

SternheimerParameters_t detinfo::DetectorPropertiesStandard::fSternheimerParameters
private

Sternheimer parameters.

Definition at line 282 of file DetectorPropertiesStandard.h.

Referenced by Eloss(), and ValidateAndConfigure().

double detinfo::DetectorPropertiesStandard::fTemperature
private

kelvin

Definition at line 255 of file DetectorPropertiesStandard.h.

Referenced by Temperature(), and ValidateAndConfigure().

double detinfo::DetectorPropertiesStandard::fTimeOffsetU
private

time offset to convert spacepoint coordinates to hit times on view U

Definition at line 260 of file DetectorPropertiesStandard.h.

Referenced by DataFor(), TimeOffsetU(), and ValidateAndConfigure().

double detinfo::DetectorPropertiesStandard::fTimeOffsetV
private

time offset to convert spacepoint coordinates to hit times on view V

Definition at line 262 of file DetectorPropertiesStandard.h.

Referenced by DataFor(), TimeOffsetV(), and ValidateAndConfigure().

double detinfo::DetectorPropertiesStandard::fTimeOffsetX
private

time offset to convert spacepoint coordinates to hit times on view X

Definition at line 268 of file DetectorPropertiesStandard.h.

Referenced by DataFor(), and ValidateAndConfigure().

double detinfo::DetectorPropertiesStandard::fTimeOffsetY
private

time offset to convert spacepoint coordinates to hit times on view Y

Definition at line 266 of file DetectorPropertiesStandard.h.

Referenced by DataFor(), TimeOffsetY(), and ValidateAndConfigure().

double detinfo::DetectorPropertiesStandard::fTimeOffsetZ
private

time offset to convert spacepoint coordinates to hit times on view Z

Definition at line 264 of file DetectorPropertiesStandard.h.

Referenced by DataFor(), TimeOffsetZ(), and ValidateAndConfigure().

bool detinfo::DetectorPropertiesStandard::fUseIcarusMicrobooneDriftModel
private

if true, use alternative ICARUS-MicroBooNE drift model instead of Walkowiak-based one

Definition at line 273 of file DetectorPropertiesStandard.h.

Referenced by DriftVelocity(), and ValidateAndConfigure().


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