Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Types | Public Member Functions | Static Protected Attributes | Private Attributes | List of all members
MuonCalib::RtSimplePolynomial Class Reference

#include <RtSimplePolynomial.h>

Inheritance diagram for MuonCalib::RtSimplePolynomial:
Collaboration diagram for MuonCalib::RtSimplePolynomial:

Public Types

using ParVec = std::vector< double >
 

Public Member Functions

 RtSimplePolynomial (const ParVec &vec)
 
virtual std::string name () const override final
 get the class name More...
 
virtual double radius (double t) const override final
 get the drift velocity More...
 
virtual double driftVelocity (double t) const override final
 get the drift acceleration More...
 
virtual double driftAcceleration (double t) const override final
 Returns the acceleration of the r-t relation. More...
 
virtual double tLower () const override final
 < get the lower drift-time bound More...
 
virtual double tUpper () const override final
 Returns the upper time covered by the r-t. More...
 
virtual double tBinWidth () const override final
 Returns the step-size for the sampling. More...
 
virtual unsigned nDoF () const override final
 get the coefficients of the r(t) polynomial More...
 
std::vector< double > rtParameters () const
 
virtual std::string typeName () const override final
 
double GetTmaxDiff () const
 return the difference in total dirft time between the two multilayers (ML1 - ML2) More...
 
bool hasTmaxDiff () const
 
void SetTmaxDiff (const double d)
 set the difference in total drift time betwene the two multilayers (ML1 - ML2) More...
 
double getReducedTime (const double t) const
 map the in the interval [tLower;tUpper] onto the interval [-1. More...
 
double dReducedTimeDt () const
 
 CalibFunc (const ParVec &vec)
 
unsigned int nPar () const
 
const ParVecparameters () const
 
double par (unsigned int index) const
 

Static Protected Attributes

static constexpr double s_tBinWidth = 1.e-3
 

Private Attributes

std::optional< double > m_tmax_diff {std::nullopt}
 
ParVec m_parameters {}
 

Detailed Description

Definition at line 15 of file RtSimplePolynomial.h.

Member Typedef Documentation

◆ ParVec

using MuonCalib::CalibFunc::ParVec = std::vector<double>
inherited

Definition at line 35 of file CalibFunc.h.

Constructor & Destructor Documentation

◆ RtSimplePolynomial()

RtSimplePolynomial::RtSimplePolynomial ( const ParVec vec)
explicit

Definition at line 9 of file RtSimplePolynomial.cxx.

9  :
10  IRtRelation(vec) {
11  // check for consistency //
12  if (nPar() < 3) {
13  THROW_EXCEPTION("RtSimplePolynomial::_init() - Not enough parameters!");
14  }
15  if (tLower() >= tUpper()) {
16  THROW_EXCEPTION("Lower time boundary ("<<tLower()<<")>= upper time ("<<tUpper()<<") boundary!");
17  }
18 } // end RtSimplePolynomial::_init

Member Function Documentation

◆ CalibFunc()

MuonCalib::CalibFunc::CalibFunc
inlineexplicitinherited

Definition at line 36 of file CalibFunc.h.

36  :
37  m_parameters{vec} {}

◆ dReducedTimeDt()

double MuonCalib::IRtRelation::dReducedTimeDt ( ) const
inlineinherited

Definition at line 53 of file IRtRelation.h.

53  {
54  return unitIntervalPrime(tLower(), tUpper());
55  }

◆ driftAcceleration()

double RtSimplePolynomial::driftAcceleration ( double  t) const
finaloverridevirtual

Returns the acceleration of the r-t relation.

Implements MuonCalib::IRtRelation.

Definition at line 56 of file RtSimplePolynomial.cxx.

56  {
57  double acc{0.};
58  const double x = getReducedTime(t);
59  // Chain rule
60  const double dx_dt = dReducedTimeDt();
61  for (unsigned int k = 2; k < nDoF(); ++k) {
62  acc += par(k+2) *k * (k-1) * std::pow(x,k-2)*std::pow(dx_dt,2);
63  }
64  return acc * t;
65 }

◆ driftVelocity()

double RtSimplePolynomial::driftVelocity ( double  t) const
finaloverridevirtual

get the drift acceleration

Implements MuonCalib::IRtRelation.

Definition at line 42 of file RtSimplePolynomial.cxx.

42  {
43  // Set derivative to 0 outside of the bounds
44  if (t < tLower() || t > tUpper()) return 0.0;
45 
46  // Chain rule
47  double drdt{0.};
48  const double x = getReducedTime(t);
49  // Chain rule
50  const double dx_dt = dReducedTimeDt();
51  for (unsigned int k = 1; k < nDoF(); ++k) {
52  drdt += par(k+2) * k * std::pow(x,k-1)*dx_dt;
53  }
54  return drdt;
55 }

◆ getReducedTime()

double MuonCalib::IRtRelation::getReducedTime ( const double  t) const
inlineinherited

map the in the interval [tLower;tUpper] onto the interval [-1.

;1.] where tLower is mapped to -1. & tUpper to 1.;

Definition at line 49 of file IRtRelation.h.

49  {
50  return mapToUnitInterval(t, tLower(), tUpper());
51  }

◆ GetTmaxDiff()

double MuonCalib::IRtRelation::GetTmaxDiff ( ) const
inlineinherited

return the difference in total dirft time between the two multilayers (ML1 - ML2)

Definition at line 40 of file IRtRelation.h.

40 { return m_tmax_diff.value_or(0.); }

◆ hasTmaxDiff()

bool MuonCalib::IRtRelation::hasTmaxDiff ( ) const
inlineinherited

Definition at line 42 of file IRtRelation.h.

42 { return m_tmax_diff.has_value(); }

◆ name()

std::string RtSimplePolynomial::name ( ) const
finaloverridevirtual

get the class name

get the radius corresponding to the drift time t; if t is not within [t_low, t_up] an unphysical radius of 99999 is returned

Implements MuonCalib::CalibFunc.

Definition at line 20 of file RtSimplePolynomial.cxx.

20 { return "RtSimplePolynomial"; }

◆ nDoF()

unsigned RtSimplePolynomial::nDoF ( ) const
finaloverridevirtual

get the coefficients of the r(t) polynomial

Implements MuonCalib::IRtRelation.

Definition at line 68 of file RtSimplePolynomial.cxx.

68 { return nPar() -2; }

◆ nPar()

unsigned int MuonCalib::CalibFunc::nPar ( ) const
inlineinherited

Definition at line 39 of file CalibFunc.h.

39 { return m_parameters.size(); }

◆ par()

double MuonCalib::CalibFunc::par ( unsigned int  index) const
inlineinherited

Definition at line 41 of file CalibFunc.h.

41  {
42  return index < nPar() ? m_parameters[index] : 0.;
43  }

◆ parameters()

const ParVec& MuonCalib::CalibFunc::parameters ( ) const
inlineinherited

Definition at line 40 of file CalibFunc.h.

40 { return m_parameters; }

◆ radius()

double RtSimplePolynomial::radius ( double  t) const
finaloverridevirtual

get the drift velocity

Implements MuonCalib::IRtRelation.

Definition at line 23 of file RtSimplePolynomial.cxx.

23  {
25  // INITIAL TIME CHECK //
27  if (t < tLower()) return 0.0;
28  if (t > tUpper()) return 14.6;
29 
30  double rad{0.0}; // auxiliary radius
31  const double x = getReducedTime(t);
33  // CALCULATE r(t) //
35  for (unsigned int k = 0; k < nDoF(); k++) {
36  rad += par(k+2) * std::pow(x,k);
37  }
38  return std::max(rad, 0.);
39 }

◆ rtParameters()

std::vector< double > RtSimplePolynomial::rtParameters ( ) const

Definition at line 70 of file RtSimplePolynomial.cxx.

70  {
71  return std::vector<double>{parameters().begin() +2, parameters().end()};
72 }

◆ SetTmaxDiff()

void MuonCalib::IRtRelation::SetTmaxDiff ( const double  d)
inlineinherited

set the difference in total drift time betwene the two multilayers (ML1 - ML2)

Definition at line 45 of file IRtRelation.h.

45 { m_tmax_diff = d; }

◆ tBinWidth()

double RtSimplePolynomial::tBinWidth ( ) const
finaloverridevirtual

Returns the step-size for the sampling.

Implements MuonCalib::IRtRelation.

Definition at line 21 of file RtSimplePolynomial.cxx.

21 { return s_tBinWidth; }

◆ tLower()

double RtSimplePolynomial::tLower ( ) const
finaloverridevirtual

< get the lower drift-time bound

get the upper drift-time bound

Implements MuonCalib::IRtRelation.

Definition at line 66 of file RtSimplePolynomial.cxx.

66 { return par(0); }

◆ tUpper()

double RtSimplePolynomial::tUpper ( ) const
finaloverridevirtual

Returns the upper time covered by the r-t.

Implements MuonCalib::IRtRelation.

Definition at line 67 of file RtSimplePolynomial.cxx.

67 { return par(1); }

◆ typeName()

virtual std::string MuonCalib::IRtRelation::typeName ( ) const
inlinefinaloverridevirtualinherited

Implements MuonCalib::CalibFunc.

Definition at line 23 of file IRtRelation.h.

23 { return "IRtRelation"; }

Member Data Documentation

◆ m_parameters

ParVec MuonCalib::CalibFunc::m_parameters {}
privateinherited

Definition at line 48 of file CalibFunc.h.

◆ m_tmax_diff

std::optional<double> MuonCalib::IRtRelation::m_tmax_diff {std::nullopt}
privateinherited

Definition at line 58 of file IRtRelation.h.

◆ s_tBinWidth

constexpr double MuonCalib::IRtRelation::s_tBinWidth = 1.e-3
staticconstexprprotectedinherited

Definition at line 60 of file IRtRelation.h.


The documentation for this class was generated from the following files:
index
Definition: index.py:1
hist_file_dump.d
d
Definition: hist_file_dump.py:143
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:9
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
x
#define x
MuonCalib::CalibFunc::par
double par(unsigned int index) const
Definition: CalibFunc.h:41
MuonCalib::RtSimplePolynomial::tUpper
virtual double tUpper() const override final
Returns the upper time covered by the r-t.
Definition: RtSimplePolynomial.cxx:67
MuonCalib::unitIntervalPrime
double unitIntervalPrime(const double lowerEdge, const double upperEdge)
Definition: UtilFunc.h:15
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
MuonCalib::IRtRelation::tUpper
virtual double tUpper() const =0
Returns the upper time covered by the r-t.
MuonCalib::RtSimplePolynomial::tLower
virtual double tLower() const override final
< get the lower drift-time bound
Definition: RtSimplePolynomial.cxx:66
MuonCalib::IRtRelation::s_tBinWidth
static constexpr double s_tBinWidth
Definition: IRtRelation.h:60
MuonCalib::RtSimplePolynomial::nDoF
virtual unsigned nDoF() const override final
get the coefficients of the r(t) polynomial
Definition: RtSimplePolynomial.cxx:68
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition: throwExcept.h:10
MuonCalib::IRtRelation::m_tmax_diff
std::optional< double > m_tmax_diff
Definition: IRtRelation.h:58
MuonCalib::IRtRelation::tLower
virtual double tLower() const =0
Returns the lower time covered by the r-t.
DeMoScan.index
string index
Definition: DeMoScan.py:364
MuonCalib::CalibFunc::parameters
const ParVec & parameters() const
Definition: CalibFunc.h:40
MuonCalib::IRtRelation::dReducedTimeDt
double dReducedTimeDt() const
Definition: IRtRelation.h:53
MuonCalib::CalibFunc::m_parameters
ParVec m_parameters
Definition: CalibFunc.h:48
MuonCalib::CalibFunc::nPar
unsigned int nPar() const
Definition: CalibFunc.h:39
MuonCalib::mapToUnitInterval
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
MuonCalib::IRtRelation::getReducedTime
double getReducedTime(const double t) const
map the in the interval [tLower;tUpper] onto the interval [-1.
Definition: IRtRelation.h:49
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
MuonCalib::IRtRelation
generic interface for a rt-relation
Definition: IRtRelation.h:19
python.SystemOfUnits.rad
int rad
Definition: SystemOfUnits.py:111
fitman.k
k
Definition: fitman.py:528