ATLAS Offline Software
MuonSpectrometer
MuonCalib
MuonCalibUtils
MuonCalibMath
src
LegendrePolynomial.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6
// 29.06.2006, AUTHOR: OLIVER KORTNER
7
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8
9
//::::::::::::::::::
10
//:: HEADER FILES ::
11
//::::::::::::::::::
12
13
#include "
MuonCalibMath/LegendrePolynomial.h
"
14
#include "cmath"
15
16
//::::::::::::::::::::::::
17
//:: NAMESPACE SETTINGS ::
18
//::::::::::::::::::::::::
19
20
using namespace
MuonCalib
;
21
22
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
23
//:: IMPLEMENTATION OF METHODS DEFINED IN THE CLASS LegendrePolynomial ::
24
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
25
26
//*****************************************************************************
27
28
//::::::::::::::::::
29
//:: METHOD value ::
30
//::::::::::::::::::
31
32
double
LegendrePolynomial::value
(
const
int
&
k
,
const
double
&
x
)
const
{
33
34
36
// LOWER ORDER LEGENDRE POLYNOMIALS ARE GIVEN EXPLICITLY, HIGHER ORDERS ARE //
37
// CALCULATE RECURSIVELY. //
39
40
switch
(
k
) {
41
case
0:
42
return
1;
43
break
;
44
case
1:
45
return
x
;
46
break
;
47
case
2:
48
return
0.5*(3.0*
x
*
x
-1.0);
49
break
;
50
case
3:
51
return
0.5*(5.0*
x
*
x
*
x
-3.0*
x
);
52
break
;
53
case
4:
54
return
(35.0*
std::pow
(
x
, 4)-30.0*
x
*
x
+3.0)/8.0;
55
break
;
56
case
5:
57
return
(63.0*
std::pow
(
x
, 5)-70.0*
x
*
x
*
x
+15.0*
x
)/8.0;
58
break
;
59
case
6:
60
return
(231.0*
std::pow
(
x
, 6)-315.0*
std::pow
(
x
, 4)+105.0*
x
*
x
-5.0)
61
/16.0;
62
break
;
63
case
7:
64
return
(429.0*
std::pow
(
x
, 7)-693*
std::pow
(
x
, 5)+315.0*
x
*
x
*
x
65
-35.0*
x
)/16.0;
66
break
;
67
default
:
68
return
(2.0*
k
-1)*
x
*
value
(
k
-1,
x
)/
69
static_cast<
double
>
(
k
)
70
- (
k
-1)*
value
(
k
-2,
x
)/
71
static_cast<
double
>
(
k
);
72
break
;
73
}
74
75
}
conifer::pow
constexpr int pow(int x)
Definition:
conifer.h:20
x
#define x
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition:
CscCalcPed.cxx:22
MuonCalib::LegendrePolynomial::value
double value(const int &k, const double &x) const
get the value of the k-th base function at x
Definition:
LegendrePolynomial.cxx:32
LegendrePolynomial.h
fitman.k
k
Definition:
fitman.py:528
Generated on Thu Jul 4 2024 21:20:52 for ATLAS Offline Software by
1.8.18