ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCalib
MdtCalib
MdtCalibData
src
RtScaleFunction.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MdtCalibData/RtScaleFunction.h
"
6
7
#include "
MdtCalibData/IRtRelation.h
"
8
#include <array>
9
namespace
MuonCalib
{
10
11
static
constexpr
std::array<double, 6>
RtScaleFunction_p
{-0.00102327, 0.00582117, -0.00676815, 0.00167504, -8.67371e-05, 1.66509e-06};
12
13
float
RtScalePolynomial
(
const
float
r
) {
14
// calculate polynomial
15
float
p = 0;
16
for
(
int
i = 5; i >= 0; i--) { p =
RtScaleFunction_p
[i] +
r
* p; }
17
return
p;
18
}
19
20
float
RtScaleFunction
(
const
float
t,
const
bool
ml2,
const
IRtRelation
&rt) {
21
if
(t < rt.
tLower
() || !rt.
hasTmaxDiff
())
return
0.0;
22
// apply linear scale and calculate r as input to the polinomial
23
float
rt_length = rt.
tUpper
() - rt.
tLower
();
24
float
corr_val = (t / rt_length) * rt.
GetTmaxDiff
() * (ml2 ? -0.5 : +0.5);
25
float
newt = t - corr_val;
26
// keep linear scale for t>t_max
27
if
(newt > rt.
tUpper
())
return
corr_val;
28
29
// calculate polynomial
30
float
p = 0;
31
float
r
= rt.
radius
(newt);
32
for
(
int
i = 5; i >= 0; i--) { p =
RtScaleFunction_p
[i] +
r
* p; }
33
return
p * rt.
GetTmaxDiff
() * (ml2 ? -0.5 : +0.5);
34
}
35
36
}
// namespace MuonCalib
IRtRelation.h
RtScaleFunction.h
MuonCalib::IRtRelation
generic interface for a rt-relation
Definition
IRtRelation.h:19
MuonCalib::IRtRelation::tLower
virtual double tLower() const =0
Returns the lower time covered by the r-t.
MuonCalib::IRtRelation::radius
virtual double radius(double t) const =0
returns drift radius for a given time
MuonCalib::IRtRelation::GetTmaxDiff
double GetTmaxDiff() const
return the difference in total dirft time between the two multilayers (ML1 - ML2)
Definition
IRtRelation.h:40
MuonCalib::IRtRelation::hasTmaxDiff
bool hasTmaxDiff() const
Definition
IRtRelation.h:42
MuonCalib::IRtRelation::tUpper
virtual double tUpper() const =0
Returns the upper time covered by the r-t.
r
int r
Definition
globals.cxx:22
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition
CscCalcPed.cxx:21
MuonCalib::RtScaleFunction_p
static constexpr std::array< double, 6 > RtScaleFunction_p
Definition
RtScaleFunction.cxx:11
MuonCalib::RtScalePolynomial
float RtScalePolynomial(const float r)
Definition
RtScaleFunction.cxx:13
MuonCalib::RtScaleFunction
float RtScaleFunction(const float t, const bool ml2, const IRtRelation &rtrelation)
Definition
RtScaleFunction.cxx:20
Generated on
for ATLAS Offline Software by
1.17.0