32 inline T
sqr(T v) {
return v*v; }
40 fLP(0), fClocks(0), fGeo(0)
50 std::set<std::string>
const& ignore_params
57 debug <<
"Asked to ignore " << ignore_params.size() <<
" keys:";
58 for (
auto const& key: ignore_params) debug <<
" '" << key <<
"'";
70 std::set<std::string>
const& ignore_params
73 providers.get<
geo::GeometryCore>(),
142 std::set<std::string>
const& ignore_params
145 ignorable_keys.insert(ignore_params.begin(), ignore_params.end());
150 return std::move(config_table());
157 std::set<std::string>
const& ignore_params
179 throw cet::exception(
"DetectorPropertiesStandard") <<
"requesting Electric field in a plane gap that is not defined\n";
189 if(temperature == 0.)
192 double density = -0.00615*temperature + 1.928;
220 double me = 0.510998918;
224 double bg = mom / mass;
225 double gamma = sqrt(1. + bg*bg);
226 double beta = bg / gamma;
227 double mer = 0.001 * me / mass;
228 double tmax = 2.*me* bg*bg / (1. + 2.*gamma*mer + mer*mer);
232 if(tcut == 0. || tcut > tmax)
237 double x = std::log10(bg);
248 - 0.5 * beta*beta * (1. + tcut / tmax) - 0.5 * delta;
270 double me = 0.510998918;
274 double bg = mom / mass;
275 double gamma2 = 1. + bg*bg;
276 double beta2 = bg*bg / gamma2;
299 mf::LogWarning(
"DetectorPropertiesStandard") <<
"DriftVelocity Warning! : E-field value of " 301 <<
" kV/cm is outside of range covered by drift" 302 <<
" velocity parameterization. Returned value" 303 <<
" may not be correct";
307 if(temperature == 0.)
310 if(temperature < 87.0 || temperature > 94.0)
311 mf::LogWarning(
"DetectorPropertiesStandard") <<
"DriftVelocity Warning! : Temperature value of " 313 <<
" K is outside of range covered by drift velocity" 314 <<
" parameterization. Returned value may not be" 320 double tshift = -87.203+temperature;
321 double xFit = 0.0938163-0.0052563*tshift-0.0001470*tshift*tshift;
322 double uFit = 5.18406+0.01448*tshift-0.003497*tshift*tshift-0.000516*tshift*tshift*tshift;
327 double P1 = -0.04640;
335 double P1W = -0.01481;
336 double P2W = -0.0075;
346 if (efield < xFit) vd=efield*uFit;
347 else if (efield<0.619) {
348 vd = ((P1*(temperature-T0)+1)
349 *(P3*efield*std::log(1+P4/efield) + P5*std::pow(efield,P6))
350 +P2*(temperature-T0));
352 else if (efield<0.699) {
353 vd = 12.5*(efield-0.619)*((P1W*(temperature-T0W)+1)
354 *(P3W*efield*std::log(1+P4W/efield) + P5W*std::pow(efield,P6W))
355 +P2W*(temperature-T0W))+
356 12.5*(0.699-efield)*((P1*(temperature-T0)+1)
357 *(P3*efield*std::log(1+P4/efield) + P5*std::pow(efield,P6))
358 +P2*(temperature-T0));
361 vd = ((P1W*(temperature-T0W)+1)
362 *(P3W*efield*std::log(1+P4W/efield) + P5W*std::pow(efield,P6W))
363 +P2W*(temperature-T0W));
388 double E_field =
Efield();
390 double dEdx = dQdx/(A3t/Wion-K3t/E_field*dQdx);
403 double E_field =
Efield();
406 double dEdx = (exp(Beta * Wion * dQdx ) - Alpha) / Beta;
454 if (!
fLP)
throw cet::exception(__FUNCTION__) <<
"LArPropertiesStandard is uninitialized!";
491 int nplane = tpcgeom.
Nplanes();
493 for(
int plane = 0; plane < nplane; ++plane) {
499 double driftVelocitygap[3];
500 double fXTicksCoefficientgap[3];
501 for (
int igap = 0; igap<3; ++igap){
502 efieldgap[igap] =
Efield(igap);
503 driftVelocitygap[igap] =
DriftVelocity(efieldgap[igap], temperature);
504 fXTicksCoefficientgap[igap] = 0.001 * driftVelocitygap[igap] * samplingRate;
524 for (
int ip = 0; ip < plane; ++ip){
539 for (
int ip = 0; ip < plane; ++ip){
565 throw cet::exception(__FUNCTION__) <<
"Bad view = " << view <<
"\n" ;
604 std::ostringstream errors;
609 errors <<
"TimeOffsetU has been specified, but no U view is present.\n";
611 errors <<
"TimeOffsetU missing for view U.\n";
615 errors <<
"TimeOffsetV has been specified, but no V view is present.\n";
617 errors <<
"TimeOffsetV missing for view Z.\n";
621 errors <<
"TimeOffsetZ has been specified, but no Z view is present.\n";
623 errors <<
"TimeOffsetZ missing for view Z.\n";
627 errors <<
"TimeOffsetY has been specified, but no Y view is present.\n";
629 errors <<
"TimeOffsetY missing for view Y.\n";
633 errors <<
"TimeOffsetX has been specified, but no X view is present.\n";
635 errors <<
"TimeOffsetX missing for view X.\n";
649 if (!errors.empty()) {
651 <<
"Detected configuration errors: \n" << errors;
virtual double TPCTDC2Tick(double tdc) const =0
Given electronics clock count [tdc] returns TPC time-tick.
double fTimeOffsetZ
time offset to convert spacepoint coordinates to hit times on view Z
virtual double ConvertTicksToTDC(double ticks) const override
const detinfo::LArProperties * fLP
virtual double Temperature() const override
In kelvin.
double PlanePitch(unsigned int p1=0, unsigned int p2=1) const
Returns the center of the TPC volume in world coordinates [cm].
virtual double GetXTicksCoefficient() const override
double fXTicksCoefficient
Parameters for x<–>ticks.
virtual const ::detinfo::ElecClock & TPCClock() const =0
Lends a constant TPC clock with time set to trigger time.
fhicl::OptionalAtom< double > TimeOffsetX
fhicl::Atom< double > SternheimerX1
fhicl::Atom< double > SternheimerA
fhicl::Atom< double > ElectronsToADC
virtual double ConvertTDCToTicks(double tdc) const override
Encapsulate the construction of a single cyostat.
virtual int TriggerOffset() const override
double fTemperature
kelvin
double fElectronsToADC
conversion factor for # of ionization electrons to 1 ADC count
void DoUpdateClocks()
Time-independent implementation of clock updates.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
virtual double Efield(unsigned int planegap=0) const override
kV/cm
void ValidateAndConfigure(fhicl::ParameterSet const &p, std::set< std::string > const &ignore_params={})
Configures the provider, first validating the configuration.
fhicl::OptionalAtom< double > TimeOffsetZ
unsigned int Nplanes() const
Number of planes in this tpc.
std::set< geo::View_t > const & Views() const
Returns a list of possible views in the detector.
virtual double ElossVar(double mom, double mass) const override
Energy loss fluctuation ( )
Planes which measure X direction.
Geometry information for a single TPC.
bool UpdateClocks(const detinfo::DetectorClocks *clks)
virtual 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
void SetDetectorClocks(const detinfo::DetectorClocks *clks)
std::vector< std::vector< double > > fDriftDirection
fhicl::Atom< double > SternheimerCbar
virtual double TriggerOffsetTPC() const =0
Time offset from hardware trigger to TPC electronics start time.
double fTimeOffsetU
time offset to convert spacepoint coordinates to hit times on view U
Planes which measure Z direction.
Provider const * get() const
Returns the provider with the specified type.
int Ticks() const
Current clock tick (that is, the number of tick Time() falls in).
double fHasTimeOffsetV
whether time offset was configured for view V
std::vector< std::vector< std::vector< double > > > fXTicksOffsets
double fTimeOffsetY
time offset to convert spacepoint coordinates to hit times on view Y
Drift towards negative X values.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
double cbar
parameter Cbar
DetectorPropertiesStandard()
Planes which measure Y direction.
virtual double ExcitationEnergy() const =0
Mean excitation energy of the liquid (eV)
void SetGeometry(const geo::GeometryCore *g)
double fHasTimeOffsetX
whether time offset was configured for view X
void Configure(Configuration_t const &config)
Extracts the relevant configuration from the specified object.
fhicl::Atom< double > Electronlifetime
double fTimeOffsetV
time offset to convert spacepoint coordinates to hit times on view V
Access the description of detector geometry.
void SetLArProperties(const detinfo::LArProperties *lp)
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
fhicl::Atom< bool > SimpleBoundary
std::vector< double > fEfield
kV/cm (per inter-plane volume)
constexpr double kModBoxB
Modified Box Beta in g/(MeV cm²)*kV/cm.
virtual double SamplingRate() const override
Returns the period of the TPC readout electronics clock.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
fhicl::OptionalAtom< double > TimeOffsetU
SternheimerParameters_t fSternheimerParameters
Sternheimer parameters.
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.
std::string CheckTimeOffsetConfigurationAfterSetup() const
Checks the configuration of time offsets.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
double fHasTimeOffsetZ
whether time offset was configured for view Z
fhicl::Atom< unsigned int > NumberTimeSamples
virtual double GetXTicksOffset(int p, int t, int c) const override
General LArSoft Utilities.
Description of geometry of one entire detector.
fhicl::Atom< double > Temperature
double fHasTimeOffsetU
whether time offset was configured for view U
fhicl::OptionalAtom< double > TimeOffsetY
DriftDirection_t DriftDirection() const
Returns an enumerator value describing the drift direction.
fhicl::OptionalAtom< double > TimeOffsetV
Conversion of times between different formats and references.
void CheckConfigurationAfterSetup() const
::detinfo::ElecClock fTPCClock
TPC electronics clock.
virtual double ModBoxCorrection(double dQdX) const override
virtual double TPCTick2TDC(double tick) const =0
Converts a TPC time tick into a electronics time tick.
double fElectronlifetime
microseconds
virtual double ConvertXToTicks(double X, int p, int t, int c) const override
Encapsulate the construction of a single detector plane.
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc'th TPC in the cryostat.
fhicl::Atom< double > SternheimerX0
Structure for configuration parameters.
unsigned int fReadOutWindowSize
number of clock ticks per readout window
fhicl::Atom< double > SternheimerK
Container for a list of pointers to providers.
double fTimeOffsetX
time offset to convert spacepoint coordinates to hit times on view X
virtual double AtomicNumber() const =0
Atomic number of the liquid.
constexpr double kRecombk
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void CalculateXTicksParams()
Simple utilities for service providers.
const detinfo::DetectorClocks * fClocks
Configuration_t ValidateConfiguration(fhicl::ParameterSet const &p, std::set< std::string > const &ignore_params={})
Validates the specified configuration.
virtual double ConvertTicksToX(double ticks, int p, int t, int c) const override
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
fhicl::Atom< unsigned int > ReadOutWindowSize
constexpr double kRecombA
A constant.
virtual double DriftVelocity(double efield=0., double temperature=0.) const override
cm/us
constexpr double kModBoxA
Modified Box Alpha.
void CheckIfConfigured() const
virtual double Density() const override
Returns argon density at the temperature from Temperature()
Namespace collecting geometry-related classes utilities.
double fHasTimeOffsetY
whether time offset was configured for view Y
fhicl::Sequence< double > Efield
void Setup(providers_type providers)
Sets all the providers at once.
const double * PlaneLocation(unsigned int p) const
Returns the coordinates of the center of the specified plane [cm].
cet::coded_exception< error, detail::translate > exception
const geo::GeometryCore * fGeo
Encapsulate the construction of a single detector plane.
virtual double Eloss(double mom, double mass, double tcut) const override
Restricted mean energy loss (dE/dx)