ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCalib
MdtCalib
MdtCalibData
src
TrChebyshev.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include <
MdtCalibData/TrChebyshev.h
>
6
#include "GeoModelKernel/throwExcept.h"
7
#include "Acts/Utilities/detail/Polynomials.hpp"
8
namespace
MuonCalib
{
9
TrChebyshev::TrChebyshev
(
const
ParVec
&
vec
) :
ITrRelation
{
vec
} {
10
if
(
minRadius
() >=
maxRadius
()) {
11
THROW_EXCEPTION
(
"Minimum radius greater than maximum radius!"
);
12
}
13
}
14
std::string
TrChebyshev::name
()
const
{
return
"TrChebyshev"
; }
15
16
std::optional<double>
TrChebyshev::driftTime
(
const
double
r
)
const
{
17
if
(
r
<
minRadius
() ||
r
>
maxRadius
())
return
std::nullopt;
18
const
double
reducedR =
getReducedR
(
r
);
19
double
time{0.};
20
for
(
unsigned
int
k = 0; k <
nDoF
(); ++k) {
21
time +=
par
(k+2) * Acts::detail::chebychevPolyTn(reducedR, k);
22
}
23
return
std::make_optional(time);
24
25
26
}
27
std::optional<double>
TrChebyshev::driftTimePrime
(
const
double
r
)
const
{
28
if
(
r
<
minRadius
() ||
r
>
maxRadius
())
return
std::nullopt;
29
const
double
reducedR =
getReducedR
(
r
);
30
const
double
dt_dr =
getReducedRPrime
();
31
double
dtdr{0.};
32
for
(
unsigned
int
k = 1; k <
nDoF
(); ++k) {
33
dtdr +=
par
(k+2) * Acts::detail::chebychevPolyTn(reducedR, k, 1) * dt_dr;
34
}
35
return
std::make_optional(dtdr);
36
37
}
38
std::optional<double>
TrChebyshev::driftTime2Prime
(
const
double
r
)
const
{
39
if
(
r
<
minRadius
() ||
r
>
maxRadius
())
return
std::nullopt;
40
const
double
reducedR =
getReducedR
(
r
);
41
const
double
dt_dr = std::pow(
getReducedRPrime
(), 2);
42
double
d2tdr2{0.};
43
for
(
unsigned
int
k = 2; k <
nDoF
(); ++k) {
44
d2tdr2 +=
par
(k+2) * Acts::detail::chebychevPolyTn(reducedR, k, 2) * dt_dr;
45
}
46
return
std::make_optional(d2tdr2);
47
}
48
49
double
TrChebyshev::minRadius
()
const
{
return
par
(0); }
50
double
TrChebyshev::maxRadius
()
const
{
return
par
(1); }
51
unsigned
TrChebyshev::nDoF
()
const
{
return
nPar
() -2; }
52
}
vec
std::vector< size_t > vec
Definition
CombinationsGeneratorTest.cxx:9
TrChebyshev.h
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::ITrRelation::getReducedR
double getReducedR(const double r) const
Maps the radius interval [minRadius;maxRadius] to [-1;1] where the minimal radius is on the lower end...
Definition
ITrRelation.h:42
MuonCalib::ITrRelation::ITrRelation
ITrRelation(const ParVec ¶meters)
Constructor taking the input r-t relation & the vector of parameters.
Definition
ITrRelation.h:20
MuonCalib::ITrRelation::getReducedRPrime
double getReducedRPrime() const
Returns the derivative of the reduced radisu w.r.t r.
Definition
ITrRelation.h:46
MuonCalib::TrChebyshev::driftTime
virtual std::optional< double > driftTime(const double r) const override final
Interface method for fetching the drift-time from the radius Returns a nullopt if the time is out of ...
Definition
TrChebyshev.cxx:16
MuonCalib::TrChebyshev::minRadius
virtual double minRadius() const override final
Returns the minimum drift-radius.
Definition
TrChebyshev.cxx:49
MuonCalib::TrChebyshev::name
virtual std::string name() const override final
Definition
TrChebyshev.cxx:14
MuonCalib::TrChebyshev::driftTimePrime
virtual std::optional< double > driftTimePrime(const double r) const override final
Definition
TrChebyshev.cxx:27
MuonCalib::TrChebyshev::TrChebyshev
TrChebyshev(const ParVec &vec)
Definition
TrChebyshev.cxx:9
MuonCalib::TrChebyshev::driftTime2Prime
virtual std::optional< double > driftTime2Prime(const double r) const override final
Definition
TrChebyshev.cxx:38
MuonCalib::TrChebyshev::nDoF
virtual unsigned nDoF() const override final
Returns the number of degrees of freedom of the tr relation.
Definition
TrChebyshev.cxx:51
MuonCalib::TrChebyshev::maxRadius
virtual double maxRadius() const override final
Returns the maximum drift-radius.
Definition
TrChebyshev.cxx:50
r
int r
Definition
globals.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