CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
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
12#include "CLHEP/GenericFunctions/AbsFunction.hh"
13#include "CLHEP/GenericFunctions/Parameter.hh"
14#include "CLHEP/GenericFunctions/LegendreCoefficientSet.hh"
15#include "CLHEP/GenericFunctions/ClebschGordanCoefficientSet.hh"
16namespace Genfun {
17
18 /**
19 * @author
20 * @ingroup genfun
21 */
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 override;
39 virtual double operator ()(const Argument & a) const override {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)
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:
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
#define FUNCTION_OBJECT_DEF(classname)
Definition: AbsFunction.hh:143
Parameter * getFraction(unsigned int i)
LegendreFit(const LegendreFit &right)
const Parameter * getFraction(unsigned int i) const
virtual double operator()(double argument) const override
LegendreFit(unsigned int N)
Parameter * getPhase(unsigned int i)
virtual ~LegendreFit()
const Parameter * getPhase(unsigned int i) const
void recomputeCoefficients() const
unsigned int order() const
const LegendreCoefficientSet & coefficientsASq() const
const LegendreCoefficientSet & coefficientsA() const
Definition: Abs.hh:14