ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCalib
MdtCalib
MdtCalibData
src
RtLegendre.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/RtLegendre.h
"
5
#include "Acts/Utilities/detail/Polynomials.hpp"
6
#include "GeoModelKernel/throwExcept.h"
7
#include <cmath>
8
using namespace
MuonCalib
;
9
10
RtLegendre::RtLegendre
(
const
ParVec
&
vec
) :
11
IRtRelation
(
vec
) {
12
// check for consistency //
13
if
(
nPar
() < 3) {
14
THROW_EXCEPTION
(
"RtLegendre::_init() - Not enough parameters!"
);
15
}
16
if
(
tLower
() >=
tUpper
()) {
17
THROW_EXCEPTION
(
"Lower time boundary >= upper time boundary!"
);
18
}
19
}
// end RtLegendre::_init
20
21
std::string
RtLegendre::name
()
const
{
return
"RtLegendre"
; }
22
double
RtLegendre::tBinWidth
()
const
{
return
s_tBinWidth
; }
23
24
double
RtLegendre::radius
(
double
t)
const
{
26
// INITIAL TIME CHECK //
28
if
(t <
tLower
())
return
0.0;
29
if
(t >
tUpper
())
return
14.6;
30
32
// VARIABLES //
34
// argument of the Legendre polynomials
35
double
x
=
getReducedTime
(t);
36
double
rad{0.0};
// auxiliary radius
37
39
// CALCULATE r(t) //
41
for
(
unsigned
int
k = 0; k <
nDoF
(); k++) {
42
rad +=
par
(k+2) * Acts::detail::legendrePoly(
x
,k);
43
}
44
return
std::max(rad, 0.);
45
}
46
47
//*****************************************************************************
48
double
RtLegendre::driftVelocity
(
double
t)
const
{
49
return
(
radius
(t + 1.0) -
radius
(t));
50
51
}
52
double
RtLegendre::driftAcceleration
(
double
t)
const
{
53
double
acc{0.};
54
// Argument of the Legendre polynomials
55
const
double
x
=
getReducedTime
(t);
56
const
double
dx_dt = std::pow(
dReducedTimeDt
(), 2);
57
for
(
unsigned
int
k = 0; k <
nDoF
(); ++k) {
58
acc +=
par
(k+2) * Acts::detail::legendrePoly(
x
,k, 2) * dx_dt;
59
}
60
return
acc * t;
61
}
62
double
RtLegendre::tLower
()
const
{
return
par
(0); }
63
double
RtLegendre::tUpper
()
const
{
return
par
(1); }
64
unsigned
int
RtLegendre::nDoF
()
const
{
return
nPar
() -2; }
65
66
std::vector<double>
RtLegendre::rtParameters
()
const
{
67
return
std::vector<double>{
parameters
().begin() +2,
parameters
().end()};
68
}
vec
std::vector< size_t > vec
Definition
CombinationsGeneratorTest.cxx:9
RtLegendre.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::RtLegendre::rtParameters
std::vector< double > rtParameters() const
Definition
RtLegendre.cxx:66
MuonCalib::RtLegendre::driftVelocity
virtual double driftVelocity(double t) const override final
get the drift acceleration
Definition
RtLegendre.cxx:48
MuonCalib::RtLegendre::RtLegendre
RtLegendre(const ParVec &vec)
initialization constructor,
Definition
RtLegendre.cxx:10
MuonCalib::RtLegendre::radius
virtual double radius(double t) const override final
get the drift velocity
Definition
RtLegendre.cxx:24
MuonCalib::RtLegendre::tLower
virtual double tLower() const override final
< get the lower drift-time bound
Definition
RtLegendre.cxx:62
MuonCalib::RtLegendre::nDoF
virtual unsigned nDoF() const override final
Returns the number of degrees of freedom of the relation function.
Definition
RtLegendre.cxx:64
MuonCalib::RtLegendre::tUpper
virtual double tUpper() const override final
Returns the upper time covered by the r-t.
Definition
RtLegendre.cxx:63
MuonCalib::RtLegendre::name
virtual std::string name() const override final
get the class name
Definition
RtLegendre.cxx:21
MuonCalib::RtLegendre::driftAcceleration
virtual double driftAcceleration(double t) const override final
Returns the acceleration of the r-t relation.
Definition
RtLegendre.cxx:52
MuonCalib::RtLegendre::tBinWidth
virtual double tBinWidth() const override final
get the number of parameters used to describe the r(t) relationship
Definition
RtLegendre.cxx:22
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