ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigAFPHypo
src
AFPProtonTransportPolynomial.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
#include "
AFPProtonTransportPolynomial.h
"
6
7
AFPProtonTransportPolynomial::AFPProtonTransportPolynomial
(
int
n,
double
c0,
double
c1,
double
c2,
double
c3,
double
c4,
8
double
c5,
double
c6,
double
c7,
double
c8,
double
c9) {
9
setCoefficients
(n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9);
10
}
11
12
int
AFPProtonTransportPolynomial::numCoefficients
()
const
{
13
return
m_numCoefficients
;
14
}
15
16
void
AFPProtonTransportPolynomial::setCoefficients
17
(
int
n,
double
c0,
double
c1,
double
c2,
double
c3,
double
c4,
18
double
c5,
double
c6,
double
c7,
double
c8,
double
c9) {
19
m_numCoefficients
= n;
20
m_coefficients
[0] = c0;
21
m_coefficients
[1] = c1;
22
m_coefficients
[2] = c2;
23
m_coefficients
[3] = c3;
24
m_coefficients
[4] = c4;
25
m_coefficients
[5] = c5;
26
m_coefficients
[6] = c6;
27
m_coefficients
[7] = c7;
28
m_coefficients
[8] = c8;
29
m_coefficients
[9] = c9;
30
}
31
32
double
AFPProtonTransportPolynomial::evaluate
(
double
x
)
const
{
33
double
xn[10];
34
double
sum = 0;
35
36
xn[0] = 1;
37
for
(
int
iCoef = 1; iCoef < 10; iCoef++) {
38
xn[iCoef] = xn[iCoef - 1] *
x
;
39
}
40
41
for
(
int
iCoef = 0; iCoef < 10; iCoef++) {
42
sum +=
m_coefficients
[iCoef] * xn[iCoef];
43
}
44
return
sum;
45
}
AFPProtonTransportPolynomial.h
x
#define x
AFPProtonTransportPolynomial::AFPProtonTransportPolynomial
AFPProtonTransportPolynomial(int n, double c0, double c1=0, double c2=0, double c3=0, double c4=0, double c5=0, double c6=0, double c7=0, double c8=0, double c9=0)
Default constructor of kinRecoPolynomial. Takes number of coefficients and coefficients itself up to ...
Definition
AFPProtonTransportPolynomial.cxx:7
AFPProtonTransportPolynomial::m_coefficients
double m_coefficients[10]
Definition
AFPProtonTransportPolynomial.h:27
AFPProtonTransportPolynomial::evaluate
double evaluate(double x) const
This function of returns the sum of the polynomial coeficients of a given argument x.
Definition
AFPProtonTransportPolynomial.cxx:32
AFPProtonTransportPolynomial::numCoefficients
int numCoefficients() const
This function returns the number of coefficients.
Definition
AFPProtonTransportPolynomial.cxx:12
AFPProtonTransportPolynomial::setCoefficients
void setCoefficients(int n, double c0, double c1=0, double c2=0, double c3=0, double c4=0, double c5=0, double c6=0, double c7=0, double c8=0, double c9=0)
This function sets the coefficients of the polynomial.
Definition
AFPProtonTransportPolynomial.cxx:17
AFPProtonTransportPolynomial::m_numCoefficients
int m_numCoefficients
Definition
AFPProtonTransportPolynomial.h:26
Generated on
for ATLAS Offline Software by
1.17.0