ATLAS Offline Software
Loading...
Searching...
No Matches
IRtRelation.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONCALIB_IRTRELATION_H
6#define MUONCALIB_IRTRELATION_H
7
11
12#include <optional>
13
14namespace MuonCalib {
15
16 class IRtRelation;
19 class IRtRelation : public CalibFunc {
20 public:
22 virtual ~IRtRelation() = default;
23 virtual std::string typeName() const override final { return "IRtRelation"; }
24
26 virtual double radius(double t) const = 0;
28 virtual double driftVelocity(double t) const = 0;
30 virtual double driftAcceleration(double t) const = 0;
32 virtual double tLower() const = 0;
34 virtual double tUpper() const = 0;
36 virtual double tBinWidth() const =0;
38 virtual unsigned nDoF() const = 0;
40 double GetTmaxDiff() const { return m_tmax_diff.value_or(0.); }
41
42 bool hasTmaxDiff() const { return m_tmax_diff.has_value(); }
43
45 void SetTmaxDiff(const double d) { m_tmax_diff = d; }
46
49 double getReducedTime(const double t) const {
50 return mapToUnitInterval(t, tLower(), tUpper());
51 }
52 /* @brief Returns the derivative term of the reduced time w.r.t. the time*/
53 double dReducedTimeDt() const {
54 return unitIntervalPrime(tLower(), tUpper());
55 }
56
57 private:
58 std::optional<double> m_tmax_diff{std::nullopt};
59 protected:
60 static constexpr double s_tBinWidth = 1.e-3;
61 };
62
63} // namespace MuonCalib
64
65#endif
The TransientConstSharedPtr allows non-const access if the pointer itself is non-const but in the con...
CalibFunc(const ParVec &vec)
Definition CalibFunc.h:36
generic interface for a rt-relation
Definition IRtRelation.h:19
virtual unsigned nDoF() const =0
Returns the number of degrees of freedom of the relation function.
virtual double tLower() const =0
Returns the lower time covered by the r-t.
virtual double tBinWidth() const =0
Returns the step-size for the sampling.
std::optional< double > m_tmax_diff
Definition IRtRelation.h:58
virtual double driftAcceleration(double t) const =0
Returns the acceleration of the r-t relation.
static constexpr double s_tBinWidth
Definition IRtRelation.h:60
virtual double radius(double t) const =0
returns drift radius for a given time
double GetTmaxDiff() const
return the difference in total dirft time between the two multilayers (ML1 - ML2)
Definition IRtRelation.h:40
void SetTmaxDiff(const double d)
set the difference in total drift time betwene the two multilayers (ML1 - ML2)
Definition IRtRelation.h:45
bool hasTmaxDiff() const
Definition IRtRelation.h:42
virtual double tUpper() const =0
Returns the upper time covered by the r-t.
double dReducedTimeDt() const
Definition IRtRelation.h:53
virtual ~IRtRelation()=default
virtual std::string typeName() const override final
Definition IRtRelation.h:23
CalibFunc(const ParVec &vec)
Definition CalibFunc.h:36
virtual double driftVelocity(double t) const =0
Returns the drift velocity for a given time.
double getReducedTime(const double t) const
map the in the interval [tLower;tUpper] onto the interval [-1.;1.
Definition IRtRelation.h:49
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
GeoModel::TransientConstSharedPtr< IRtRelation > IRtRelationPtr
Definition IRtRelation.h:17
double mapToUnitInterval(const double x, const double lowerEdge, const double upperEdge)
Maps the number x which is in [lowEdge;upperEdge] to the interval [-1;1].
Definition UtilFunc.h:12
double unitIntervalPrime(const double lowerEdge, const double upperEdge)
Definition UtilFunc.h:15