33 std::set<std::string>
const& ignore_params)
42 std::set<std::string>
const& ignore_params)
47 debug <<
"Asked to ignore " << ignore_params.size() <<
" keys:";
48 for (
auto const&
key : ignore_params)
49 debug <<
" '" <<
key <<
"'";
53 ignorable_keys.insert(ignore_params.begin(), ignore_params.end());
65 std::set<geo::View_t> present_views;
73 if (!errors.empty()) {
74 throw cet::exception(
"DetectorPropertiesStandard") <<
"Detected configuration errors: \n" 99 <<
"requesting Electric field in a plane gap that is not defined\n";
109 if (temperature == 0.) temperature =
Temperature();
111 return -0.00615 * temperature + 1.928;
135 constexpr
double K = 0.307075;
136 constexpr
double me = 0.510998918;
139 double const bg = mom / mass;
140 double const gamma = sqrt(1. + bg * bg);
142 double const mer = 0.001 * me / mass;
144 2. * me * bg * bg / (1. + 2. * gamma * mer + mer * mer);
147 if (tcut == 0. || tcut > tmax) tcut = tmax;
150 double const x = std::log10(bg);
162 0.5 * beta * beta * (1. + tcut / tmax) - 0.5 * delta;
176 constexpr
double K = 0.307075;
177 constexpr
double me = 0.510998918;
180 double const bg = mom / mass;
181 double const gamma2 = 1. + bg * bg;
182 double const beta2 = bg * bg / gamma2;
202 if (efield == 0.) efield =
Efield();
206 <<
"DriftVelocity Warning! : E-field value of " << efield
207 <<
" kV/cm is outside of range covered by drift" 208 <<
" velocity parameterization. Returned value" 209 <<
" may not be correct";
212 if (temperature == 0.) temperature =
Temperature();
214 if (temperature < 87.0 || temperature > 94.0)
216 <<
"DriftVelocity Warning! : Temperature value of " << temperature
217 <<
" K is outside of range covered by drift velocity" 218 <<
" parameterization. Returned value may not be" 224 double const tshift = -87.203 + temperature;
225 double const xFit = 0.0938163 - 0.0052563 * tshift - 0.0001470 * tshift * tshift;
226 double const uFit = 5.18406 + 0.01448 * tshift - 0.003497 * tshift * tshift -
227 0.000516 * tshift * tshift * tshift;
230 constexpr
double P1 = -0.04640;
231 constexpr
double P2 = 0.01712;
232 constexpr
double P3 = 1.88125;
233 constexpr
double P4 = 0.99408;
234 constexpr
double P5 = 0.01172;
235 constexpr
double P6 = 4.20214;
236 constexpr
double T0 = 105.749;
239 constexpr
double P1W = -0.01481;
240 constexpr
double P2W = -0.0075;
241 constexpr
double P3W = 0.141;
242 constexpr
double P4W = 12.4;
243 constexpr
double P5W = 1.627;
244 constexpr
double P6W = 0.317;
245 constexpr
double T0W = 90.371;
252 else if (efield < 0.619) {
253 vd = ((P1 * (temperature - T0) + 1) *
254 (P3 * efield * std::log(1 + P4 / efield) + P5 *
std::pow(efield, P6)) +
255 P2 * (temperature - T0));
257 else if (efield < 0.699) {
258 vd = 12.5 * (efield - 0.619) *
259 ((P1W * (temperature - T0W) + 1) *
260 (P3W * efield * std::log(1 + P4W / efield) + P5W *
std::pow(efield, P6W)) +
261 P2W * (temperature - T0W)) +
262 12.5 * (0.699 - efield) *
263 ((P1 * (temperature - T0) + 1) *
264 (P3 * efield * std::log(1 + P4 / efield) + P5 *
std::pow(efield, P6)) +
265 P2 * (temperature - T0));
268 vd = ((P1W * (temperature - T0W) + 1) *
269 (P3W * efield * std::log(1 + P4W / efield) + P5W *
std::pow(efield, P6W)) +
270 P2W * (temperature - T0W));
277 constexpr
double P0 = 0.;
278 constexpr
double P1 = 5.53416;
279 constexpr
double P2 = -6.53093;
280 constexpr
double P3 = 3.20752;
281 constexpr
double P4 = 0.389696;
282 constexpr
double P5 = -0.556184;
283 vd = (1.0 - 0.0184 * (temperature - 89.0)) *
284 (P0 + P1 * cet::pow<1>(efield) + P2 * cet::pow<2>(efield) + P3 * cet::pow<3>(efield) +
285 P4 * cet::pow<4>(efield) + P5 * cet::pow<5>(efield));
318 double const dEdx = dQdx / (A3t / Wion - K3t / E_field * dQdx);
339 double const dEdx = (exp(Beta * Wion * dQdx) - Alpha) / Beta;
358 double const efield =
Efield();
360 double const driftVelocity =
DriftVelocity(efield, temperature);
361 double const x_ticks_coefficient = 0.001 * driftVelocity * samplingRate;
365 std::vector<std::vector<std::vector<double>>> x_ticks_offsets(
fGeo->
Ncryostats());
366 std::vector<std::vector<double>> drift_direction(
fGeo->
Ncryostats());
376 drift_direction[cstat][tpc] =
dir;
378 int nplane = tpcgeom.
Nplanes();
379 x_ticks_offsets[cstat][tpc].resize(nplane, 0.);
380 for (
int plane = 0; plane < nplane; ++plane) {
387 x_ticks_offsets[cstat][tpc][plane] =
388 -xyz[0] / (dir * x_ticks_coefficient) + triggerOffset;
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;
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];
417 else if (nplane == 2) {
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];
433 x_ticks_offsets[cstat][tpc][plane] -=
434 tpcgeom.
PlanePitch() * (1 / x_ticks_coefficient - 1 / x_ticks_coefficient_gap[1]);
448 default:
throw cet::exception(__FUNCTION__) <<
"Bad view = " << view <<
"\n";
455 *
this, x_ticks_coefficient,
move(x_ticks_offsets),
move(drift_direction)};
461 auto const& present_views =
fGeo->
Views();
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));
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"; }
DetectorPropertiesStandard(fhicl::ParameterSet const &pset, const geo::GeometryCore *geo, const detinfo::LArProperties *lp, std::set< std::string > const &ignore_params={})
const detinfo::LArProperties * fLP
double TimeOffsetU() const override
double PlanePitch(unsigned int p1=0, unsigned int p2=1) const
double beta(double KE, const simb::MCParticle *part)
Encapsulate the construction of a single cyostat.
double fTemperature
kelvin
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
double Efield(unsigned int planegap=0) const override
kV/cm
unsigned int Nplanes() const
Number of planes in this tpc.
void ValidateAndConfigure(fhicl::ParameterSet const &p, std::set< std::string > const &ignore_params)
Configures the provider, first validating the configuration.
std::set< geo::View_t > const & Views() const
Returns a list of possible views in the detector.
double ElossVar(double mom, double mass) const override
Energy loss fluctuation ( )
Planes which measure X direction.
Geometry information for a single TPC.
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
double Temperature() const override
In kelvin.
virtual double Density() const
Returns argon density at the temperature from Temperature()
Planes which measure Z direction.
double TimeOffsetZ() const override
Drift towards negative X values.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
double cbar
parameter Cbar
DetectorPropertiesData DataFor(detinfo::DetectorClocksData const &clock_data) const override
Planes which measure Y direction.
virtual double ExcitationEnergy() const =0
Mean excitation energy of the liquid (eV)
View_t View() const
Which coordinate does this plane measure.
virtual double AtomicMass() const =0
Atomic mass of the liquid (g/mol)
constexpr double kGeVToElectrons
23.6eV per ion pair, 1e9 eV/GeV
double dEdx(float dqdx, float Efield)
bool fIncludeInterPlanePitchInXTickOffsets
constexpr double kModBoxB
Modified Box Beta in g/(MeV cm²)*kV/cm.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
SternheimerParameters_t fSternheimerParameters
Sternheimer parameters.
double TimeOffsetY() const override
unsigned int NTPC() const
Number of TPCs in this cryostat.
std::set< std::string > const & IgnorableProviderConfigKeys()
Returns a list of configuration keys that providers should ignore.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
std::string CheckTimeOffsets(std::set< geo::View_t > const &requested_views) const
General LArSoft Utilities.
Description of geometry of one entire detector.
double gamma(double KE, const simb::MCParticle *part)
DriftDirection_t DriftDirection() const
Returns an enumerator value describing the drift direction.
double TimeOffsetV() const override
double ModBoxCorrection(double dQdX) const override
double fElectronlifetime
microseconds
Encapsulate the construction of a single detector plane.
Contains all timing reference information for the detector.
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc'th TPC in the cryostat.
unsigned int fReadOutWindowSize
number of clock ticks per readout window
virtual double AtomicNumber() const =0
Atomic number of the liquid.
constexpr double kRecombk
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
int trigger_offset(DetectorClocksData const &data)
std::vector< double > fEfield
kV/cm (per inter-plane volume) !
Access the description of detector geometry.
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
constexpr double kRecombA
A constant.
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.
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
LArSoft geometry interface.
const double * PlaneLocation(unsigned int p) const
cet::coded_exception< error, detail::translate > exception
const geo::GeometryCore * fGeo
Encapsulate the construction of a single detector plane.
double Eloss(double mom, double mass, double tcut) const override
Restricted mean energy loss (dE/dx)
double fDriftVelFudgeFactor
bool fUseIcarusMicrobooneDriftModel