ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
AFPProtonTransportPolynomial Class Reference

#include <AFPProtonTransportPolynomial.h>

Collaboration diagram for AFPProtonTransportPolynomial:

Public Member Functions

 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 10 as arguments. More...
 
int numCoefficients () const
 This function returns the number of coefficients. More...
 
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. More...
 
double evaluate (double x) const
 This function of returns the sum of the polynomial coeficients of a given argument x. More...
 

Private Attributes

int m_numCoefficients = 0
 
double m_coefficients [10]
 

Detailed Description

Definition at line 8 of file AFPProtonTransportPolynomial.h.

Constructor & Destructor Documentation

◆ 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 10 as arguments.

Definition at line 7 of file AFPProtonTransportPolynomial.cxx.

8  {
9  setCoefficients(n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9);
10 }

Member Function Documentation

◆ evaluate()

double AFPProtonTransportPolynomial::evaluate ( double  x) const

This function of returns the sum of the polynomial coeficients of a given argument x.

Definition at line 32 of file AFPProtonTransportPolynomial.cxx.

32  {
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 }

◆ numCoefficients()

int AFPProtonTransportPolynomial::numCoefficients ( ) const

This function returns the number of coefficients.

Definition at line 12 of file AFPProtonTransportPolynomial.cxx.

12  {
13  return m_numCoefficients;
14 }

◆ setCoefficients()

void AFPProtonTransportPolynomial::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 at line 16 of file AFPProtonTransportPolynomial.cxx.

18  {
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 }

Member Data Documentation

◆ m_coefficients

double AFPProtonTransportPolynomial::m_coefficients[10]
private

Definition at line 27 of file AFPProtonTransportPolynomial.h.

◆ m_numCoefficients

int AFPProtonTransportPolynomial::m_numCoefficients = 0
private

Definition at line 26 of file AFPProtonTransportPolynomial.h.


The documentation for this class was generated from the following files:
AFPProtonTransportPolynomial::m_numCoefficients
int m_numCoefficients
Definition: AFPProtonTransportPolynomial.h:26
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
extractSporadic.c1
c1
Definition: extractSporadic.py:134
AFPProtonTransportPolynomial::m_coefficients
double m_coefficients[10]
Definition: AFPProtonTransportPolynomial.h:27
x
#define x
hotSpotInTAG.c0
c0
Definition: hotSpotInTAG.py:192
python.DataFormatRates.c3
c3
Definition: DataFormatRates.py:127
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
beamspotman.n
n
Definition: beamspotman.py:731
python.DataFormatRates.c2
c2
Definition: DataFormatRates.py:123