ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCalib
MdtCalib
MdtCalibData
src
RtChebyshev.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
MdtCalibData/RtChebyshev.h
"
5
#include "Acts/Utilities/detail/Polynomials.hpp"
6
#include "GeoModelKernel/throwExcept.h"
7
using namespace
MuonCalib
;
8
9
RtChebyshev::RtChebyshev
(
const
ParVec
&
vec
) :
10
IRtRelation
(
vec
) {
11
// check for consistency //
12
if
(
nPar
() < 3) {
13
THROW_EXCEPTION
(
"RtChebyshev::_init() - Not enough parameters!"
);
14
}
15
if
(
tLower
() >=
tUpper
()) {
16
THROW_EXCEPTION
(
"Lower time boundary ("
<<
tLower
()<<
")>= upper time ("
<<
tUpper
()<<
") boundary!"
);
17
}
18
}
// end RtChebyshev::_init
19
20
std::string
RtChebyshev::name
()
const
{
return
"RtChebyshev"
; }
21
double
RtChebyshev::tBinWidth
()
const
{
return
s_tBinWidth
; }
22
23
double
RtChebyshev::radius
(
double
t)
const
{
25
// INITIAL TIME CHECK //
27
if
(t <
tLower
())
return
0.0;
28
if
(t >
tUpper
())
return
14.6;
29
31
// VARIABLES //
33
// argument of the Chebyshev polynomials
34
double
x
=
getReducedTime
(t);
35
double
rad{0.0};
// auxiliary radius
36
38
// CALCULATE r(t) //
40
for
(
unsigned
int
k = 0; k <
nDoF
(); k++) {
41
rad +=
par
(k+2) * Acts::detail::chebychevPolyTn(
x
, k);
42
}
43
return
std::max(rad, 0.);
44
}
45
46
//*****************************************************************************
47
double
RtChebyshev::driftVelocity
(
double
t)
const
{
48
// Set derivative to 0 outside of the bounds
49
if
(t <
tLower
() || t >
tUpper
())
return
0.0;
50
51
// Argument of the Chebyshev polynomials
52
const
double
x
=
getReducedTime
(t);
53
// Chain rule
54
const
double
dx_dt =
dReducedTimeDt
();
55
double
drdt{0.};
56
for
(
unsigned
int
k = 1; k <
nDoF
(); ++k) {
57
// Calculate the contribution to dr/dt using k * U_{k-1}(x) * dx/dt
58
drdt +=
par
(k+2) * Acts::detail::chebychevPolyTn(
x
, k, 1) * dx_dt;
59
}
60
return
drdt;
61
}
62
double
RtChebyshev::driftAcceleration
(
double
t)
const
{
63
double
acc{0.};
64
// Argument of the Chebyshev polynomials
65
const
double
x
=
getReducedTime
(t);
66
const
double
dx_dt = std::pow(
dReducedTimeDt
(), 2);
67
for
(
unsigned
int
k = 2; k <
nDoF
(); ++k) {
68
acc +=
par
(k+2) * Acts::detail::chebychevPolyTn(
x
, k, 2) * dx_dt;
69
}
70
return
acc * t;
71
}
72
double
RtChebyshev::tLower
()
const
{
return
par
(0); }
73
double
RtChebyshev::tUpper
()
const
{
return
par
(1); }
74
unsigned
RtChebyshev::nDoF
()
const
{
return
nPar
() -2; }
75
76
std::vector<double>
RtChebyshev::rtParameters
()
const
{
77
return
std::vector<double>{
parameters
().begin() +2,
parameters
().end()};
78
}
vec
std::vector< size_t > vec
Definition
CombinationsGeneratorTest.cxx:9
RtChebyshev.h
x
#define x
MuonCalib::CalibFunc::parameters
const ParVec & parameters() const
Definition
CalibFunc.h:40
MuonCalib::CalibFunc::par
double par(unsigned int index) const
Definition
CalibFunc.h:41
MuonCalib::CalibFunc::nPar
unsigned int nPar() const
Definition
CalibFunc.h:39
MuonCalib::CalibFunc::ParVec
std::vector< double > ParVec
Definition
CalibFunc.h:35
MuonCalib::IRtRelation
generic interface for a rt-relation
Definition
IRtRelation.h:19
MuonCalib::IRtRelation::s_tBinWidth
static constexpr double s_tBinWidth
Definition
IRtRelation.h:60
MuonCalib::IRtRelation::dReducedTimeDt
double dReducedTimeDt() const
Definition
IRtRelation.h:53
MuonCalib::IRtRelation::getReducedTime
double getReducedTime(const double t) const
map the in the interval [tLower;tUpper] onto the interval [-1.;1.
Definition
IRtRelation.h:49
MuonCalib::RtChebyshev::driftAcceleration
virtual double driftAcceleration(double t) const override final
Returns the acceleration of the r-t relation.
Definition
RtChebyshev.cxx:62
MuonCalib::RtChebyshev::tUpper
virtual double tUpper() const override final
Returns the upper time covered by the r-t.
Definition
RtChebyshev.cxx:73
MuonCalib::RtChebyshev::nDoF
virtual unsigned nDoF() const override final
get the coefficients of the r(t) polynomial
Definition
RtChebyshev.cxx:74
MuonCalib::RtChebyshev::rtParameters
std::vector< double > rtParameters() const
Definition
RtChebyshev.cxx:76
MuonCalib::RtChebyshev::name
virtual std::string name() const override final
get the class name
Definition
RtChebyshev.cxx:20
MuonCalib::RtChebyshev::RtChebyshev
RtChebyshev(const ParVec &vec)
initialization constructor,
Definition
RtChebyshev.cxx:9
MuonCalib::RtChebyshev::tBinWidth
virtual double tBinWidth() const override final
Returns the step-size for the sampling.
Definition
RtChebyshev.cxx:21
MuonCalib::RtChebyshev::radius
virtual double radius(double t) const override final
get the drift velocity
Definition
RtChebyshev.cxx:23
MuonCalib::RtChebyshev::tLower
virtual double tLower() const override final
< get the lower drift-time bound
Definition
RtChebyshev.cxx:72
MuonCalib::RtChebyshev::driftVelocity
virtual double driftVelocity(double t) const override final
get the drift acceleration
Definition
RtChebyshev.cxx:47
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition
CscCalcPed.cxx:21
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition
throwExcept.h:10
Generated on
for ATLAS Offline Software by
1.17.0