ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCalib
MdtCalib
MdtCalibData
src
RtResolutionFromPoints.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MdtCalibData/RtResolutionFromPoints.h
"
6
7
#include "
AthenaKernel/getMessageSvc.h
"
8
#include "GaudiKernel/MsgStream.h"
9
#include "
MdtCalibData/SamplePointUtils.h
"
10
#include "
MuonCalibMath/BaseFunctionFitter.h
"
11
#include "
MuonCalibMath/ChebyshevPolynomial.h
"
12
#include "
MuonCalibMath/PolygonBase.h
"
13
14
using namespace
MuonCalib
;
15
16
17
//*****************************************************************************
18
19
//:::::::::::::::::::::::::::::::::::::
20
//:: METHOD getRtResolutionChebyshev ::
21
//:::::::::::::::::::::::::::::::::::::
22
RtResolutionChebyshev
RtResolutionFromPoints::getRtResolutionChebyshev
(
const
std::vector<SamplePoint> &sample_points,
23
const
unsigned
int
order) {
25
// VARIABLES //
27
MsgStream log(
Athena::getMessageSvc
(),
"RtResolutionChebyshev"
);
28
29
std::vector<double> res_param(order + 3);
// input parameters of RtChebyshev
30
BaseFunctionFitter
fitter(order + 1);
// Chebyshev fitter
31
ChebyshevPolynomial
chebyshev;
// Chebyshev polynomial
32
std::vector<SamplePoint> my_points(sample_points);
// copy of the sample to add reduced times
33
35
// GET THE MINIMUM AND MAXIMUM TIMES AND CALCULATE REDUCED TIMES //
37
const
auto
[tLow ,tHigh] =
interval
(sample_points);
38
res_param[0] = tLow;
39
res_param[1] = tHigh;
40
double
mean
(0.5 * (res_param[1] + res_param[0]));
41
double
length
(res_param[1] - res_param[0]);
42
for
(
unsigned
int
k = 0; k < my_points.size(); k++) { my_points[k].set_x1(2 * (sample_points[k].x1() -
mean
) /
length
); }
43
45
// PERFORM A CHEBYSHEV FIT TO THE SAMPLE POINTS //
47
fitter.fit_parameters(my_points, 1, sample_points.size(), chebyshev);
48
for
(
unsigned
int
k = 0; k < order + 1; k++) { res_param[k + 2] = fitter.coefficients()[k]; }
49
51
// CREATE AN RtChebyshev OBJECT WITH THE CORRECT PARAMETERS //
53
return
RtResolutionChebyshev
{res_param};
54
}
55
56
//*****************************************************************************
57
58
//::::::::::::::::::::::::::::::::::
59
//:: METHOD getRtResolutionLookUp ::
60
//::::::::::::::::::::::::::::::::::
61
RtResolutionLookUp
RtResolutionFromPoints::getRtResolutionLookUp
(
const
std::vector<SamplePoint> &sample_points) {
63
// VARIABLES //
65
RtResolutionChebyshev
res
(
getRtResolutionChebyshev
(sample_points, 8));
// auxiliary resolution-t
66
unsigned
int
nb_points(100);
// number of (r, t) points
67
double
bin_width((
res
.tUpper() -
res
.tLower()) /
static_cast<
double
>
(nb_points));
// step size
68
std::vector<double> res_param(nb_points + 2);
// r-t parameters
69
71
// CREATE AN RtRelationLookUp OBJECT WITH THE CORRECT PARAMETERS //
73
res_param[0] =
res
.tLower();
74
res_param[1] = bin_width;
75
for
(
unsigned
int
k = 0; k < nb_points; k++) { res_param[k + 2] =
res
.resolution(
res
.tLower() + k * bin_width); }
76
RtResolutionLookUp
rt_res_relation_look_up(res_param);
77
78
return
rt_res_relation_look_up;
79
}
BaseFunctionFitter.h
ChebyshevPolynomial.h
length
double length(const pvec &v)
Definition
FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
res
std::pair< std::vector< unsigned int >, bool > res
Definition
JetGroupProductTest.cxx:11
PolygonBase.h
RtResolutionFromPoints.h
SamplePointUtils.h
MuonCalib::BaseFunctionFitter
This class performs a fit of a linear combination of base functions to a set of sample points.
Definition
BaseFunctionFitter.h:39
MuonCalib::ChebyshevPolynomial
This class class provides a Chebyshev polynomial of order k.
Definition
ChebyshevPolynomial.h:17
MuonCalib::RtResolutionChebyshev
This class contains the implementation of a spatial resolution parametrized by a linear combination ...
Definition
RtResolutionChebyshev.h:35
MuonCalib::RtResolutionFromPoints::getRtResolutionLookUp
static RtResolutionLookUp getRtResolutionLookUp(const std::vector< SamplePoint > &sample_points)
Definition
RtResolutionFromPoints.cxx:61
MuonCalib::RtResolutionFromPoints::getRtResolutionChebyshev
static RtResolutionChebyshev getRtResolutionChebyshev(const std::vector< SamplePoint > &sample_points, const unsigned int order)
< get an RtResolutionChebyshev resembling the sigma(t) function as described by the sample points in ...
Definition
RtResolutionFromPoints.cxx:22
MuonCalib::RtResolutionLookUp
Equidistant look up table for resolution tables with the time as key.
Definition
RtResolutionLookUp.h:23
mean
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
Definition
dependence.cxx:254
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition
getMessageSvc.cxx:20
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition
CscCalcPed.cxx:21
MuonCalib::interval
std::pair< double, double > interval(const std::vector< SamplePoint > &points)
Returns the interval covered by the sample points.
Definition
SamplePointUtils.cxx:94
Generated on
for ATLAS Offline Software by
1.17.0