ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCalib
MdtCalib
MdtCalibData
src
RtResolutionChebyshev.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/RtResolutionChebyshev.h
"
5
#include "Acts/Utilities/detail/Polynomials.hpp"
6
#include "
MuonCalibMath/UtilFunc.h
"
7
#include "GeoModelKernel/throwExcept.h"
8
9
#include <algorithm>
10
using namespace
MuonCalib
;
11
12
RtResolutionChebyshev::RtResolutionChebyshev
(
const
ParVec
&
vec
) :
13
IRtResolution
(
vec
) {
14
// check for consistency //
15
if
(
nPar
() < 3) {
16
THROW_EXCEPTION
(
"Not enough parameters!"
);
17
}
18
if
(
tLower
() >=
tUpper
()) {
19
THROW_EXCEPTION
(
"Lower time boundary >= upper time boundary!"
);
20
}
21
}
22
std::string
RtResolutionChebyshev::name
()
const
{
return
"RtResolutionChebyshev"
; }
23
double
RtResolutionChebyshev::resolution
(
double
t,
double
/*bgRate*/
)
const
{
25
// INITIAL TIME CHECK //
27
t = std::clamp(t,
tLower
(),
tUpper
());
28
30
// VARIABLES //
32
// argument of the Chebyshev polynomials
33
const
double
x
=
mapToUnitInterval
(t,
tLower
(),
tUpper
());
34
double
resol{0.0};
// auxiliary resolution
35
37
// CALCULATE r(t) //
39
for
(
unsigned
int
k = 0; k <
nDoF
(); k++) {
40
resol = resol +
parameters
()[k + 2] * Acts::detail::chebychevPolyTn(
x
, k);
41
}
42
43
return
resol;
44
}
45
double
RtResolutionChebyshev::tLower
()
const
{
return
par
(0); }
46
double
RtResolutionChebyshev::tUpper
()
const
{
return
par
(1); }
47
unsigned
int
RtResolutionChebyshev::nDoF
()
const
{
return
nPar
() -2; }
48
std::vector<double>
RtResolutionChebyshev::resParameters
()
const
{
49
std::vector<double> alpha{};
50
alpha.insert(alpha.begin(),
parameters
().begin()+2,
parameters
().end());
51
return
alpha;
52
}
vec
std::vector< size_t > vec
Definition
CombinationsGeneratorTest.cxx:9
RtResolutionChebyshev.h
UtilFunc.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::IRtResolution
Generic interface to retrieve the resolution on the drift radius as a function of the drift time.
Definition
IRtResolution.h:20
MuonCalib::RtResolutionChebyshev::tLower
virtual double tLower() const
< get the lower drift-time bound
Definition
RtResolutionChebyshev.cxx:45
MuonCalib::RtResolutionChebyshev::tUpper
virtual double tUpper() const
get the number of parameters used to describe the resolution
Definition
RtResolutionChebyshev.cxx:46
MuonCalib::RtResolutionChebyshev::resParameters
std::vector< double > resParameters() const
Definition
RtResolutionChebyshev.cxx:48
MuonCalib::RtResolutionChebyshev::nDoF
virtual unsigned int nDoF() const override final
get the coefficients of the r(t) polynomial
Definition
RtResolutionChebyshev.cxx:47
MuonCalib::RtResolutionChebyshev::resolution
virtual double resolution(double t, double bgRate=0.0) const override final
returns resolution for a give time and background rate
Definition
RtResolutionChebyshev.cxx:23
MuonCalib::RtResolutionChebyshev::RtResolutionChebyshev
RtResolutionChebyshev(const ParVec &vec)
initialization constructor,
Definition
RtResolutionChebyshev.cxx:12
MuonCalib::RtResolutionChebyshev::name
virtual std::string name() const override final
Initialization from a.
Definition
RtResolutionChebyshev.cxx:22
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition
CscCalcPed.cxx:21
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
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition
throwExcept.h:10
Generated on
for ATLAS Offline Software by
1.17.0