CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

GenericFunctions/LegendreFit.hh
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id: LegendreFit.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $
3 //---------------------LegendreFit------------------------------------------//
4 // //
5 // Class LegendreFit. This is a fitting function consisting of a super //
6 // position of N legendre polynomials. Cascading fractions and phases are //
7 // the input parameters. Function is normalized to one (on [-1,1]) //
8 // //
9 //--------------------------------------------------------------------------//
10 #ifndef LegendreFit_h
11 #define LegendreFit_h 1
16 namespace Genfun {
17 
22  class LegendreFit : public AbsFunction {
23 
25 
26  public:
27 
28  // Constructor
29  LegendreFit(unsigned int N);
30 
31  // Copy constructor
32  LegendreFit(const LegendreFit &right);
33 
34  // Destructor
35  virtual ~LegendreFit();
36 
37  // Retreive function value
38  virtual double operator ()(double argument) const;
39  virtual double operator ()(const Argument & a) const {return operator() (a[0]);}
40 
41  unsigned int order() const;
42 
43  Parameter *getFraction(unsigned int i);
44  const Parameter *getFraction(unsigned int i) const;
45 
46  Parameter *getPhase(unsigned int i);
47  const Parameter *getPhase(unsigned int i) const;
48 
49  // Gets the coefficients the coefficients of the function which is
50  // Squared to obtain a probability distribution (amplitude)
51  const LegendreCoefficientSet & coefficientsA() const;
52 
53  // Gets the coefficients the coefficients of the function which is
54  // Squared to obtain a probability distribution:
56 
57  // Recompute coefficients from the parameters:
58  void recomputeCoefficients() const;
59 
60 
61  private:
62 
63  // It is illegal to assign an adjustable constant
64  const LegendreFit & operator=(const LegendreFit &right);
65 
66  //
67  const unsigned int N;
68  std::vector <Genfun::Parameter *> fraction;
69  std::vector <Genfun::Parameter *> phase;
70  mutable LegendreCoefficientSet coefA;
71  mutable LegendreCoefficientSet coefASq;
72  mutable ClebschGordanCoefficientSet ClebschGordan;
73 
74  };
75 } // namespace Genfun
76 #include "CLHEP/GenericFunctions/LegendreFit.icc"
77 #endif
a
@ a
Definition: testCategories.cc:125
Parameter.hh
Genfun::LegendreFit::getFraction
Parameter * getFraction(unsigned int i)
AbsFunction.hh
LegendreCoefficientSet.hh
Genfun::LegendreFit::order
unsigned int order() const
Genfun::LegendreFit
Definition: CLHEP/GenericFunctions/LegendreFit.hh:22
Genfun::LegendreFit::recomputeCoefficients
void recomputeCoefficients() const
Genfun::Argument
Definition: CLHEP/GenericFunctions/Argument.hh:17
Genfun::LegendreFit::coefficientsASq
const LegendreCoefficientSet & coefficientsASq() const
Genfun::LegendreFit::getPhase
Parameter * getPhase(unsigned int i)
i
long i
Definition: JamesRandomSeeding.txt:27
ClebschGordanCoefficientSet.hh
Genfun::LegendreFit::LegendreFit
LegendreFit(unsigned int N)
Genfun::Parameter
Definition: CLHEP/GenericFunctions/Parameter.hh:35
Genfun::LegendreCoefficientSet
Definition: CLHEP/GenericFunctions/LegendreCoefficientSet.hh:6
Genfun::LegendreFit::operator()
virtual double operator()(double argument) const
Genfun::LegendreFit::coefficientsA
const LegendreCoefficientSet & coefficientsA() const
Genfun::ClebschGordanCoefficientSet
Definition: CLHEP/GenericFunctions/ClebschGordanCoefficientSet.hh:8
FUNCTION_OBJECT_DEF
#define FUNCTION_OBJECT_DEF(classname)
Definition: CLHEP/GenericFunctions/AbsFunction.hh:144
Genfun
Definition: CLHEP/GenericFunctions/Abs.hh:14
Genfun::LegendreFit::~LegendreFit
virtual ~LegendreFit()