ATLAS Offline Software
Public Member Functions | List of all members
MuonCalib::LegendrePolynomial Class Reference

#include <LegendrePolynomial.h>

Inheritance diagram for MuonCalib::LegendrePolynomial:
Collaboration diagram for MuonCalib::LegendrePolynomial:

Public Member Functions

 LegendrePolynomial (void)
 Default constructor. More...
 
double value (const int &k, const double &x) const
 get the value of the k-th base function at x More...
 

Detailed Description

This class provides a legendre polynomial of order k. It is derived from BaseFunction.

Author
Olive.nosp@m.r.Ko.nosp@m.rtner.nosp@m.@CER.nosp@m.N.CH
Date
02.07.2006

Definition at line 39 of file LegendrePolynomial.h.

Constructor & Destructor Documentation

◆ LegendrePolynomial()

MuonCalib::LegendrePolynomial::LegendrePolynomial ( void  )
inline

Default constructor.

Definition at line 43 of file LegendrePolynomial.h.

Member Function Documentation

◆ value()

double LegendrePolynomial::value ( const int &  k,
const double &  x 
) const
virtual

get the value of the k-th base function at x

Implements MuonCalib::BaseFunction.

Definition at line 32 of file LegendrePolynomial.cxx.

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

The documentation for this class was generated from the following files:
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
x
#define x
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
fitman.k
k
Definition: fitman.py:528