File indexing completed on 2025-01-18 09:54:35
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef LegendreFit_h
0011 #define LegendreFit_h 1
0012 #include "CLHEP/GenericFunctions/AbsFunction.hh"
0013 #include "CLHEP/GenericFunctions/Parameter.hh"
0014 #include "CLHEP/GenericFunctions/LegendreCoefficientSet.hh"
0015 #include "CLHEP/GenericFunctions/ClebschGordanCoefficientSet.hh"
0016 namespace Genfun {
0017
0018
0019
0020
0021
0022 class LegendreFit : public AbsFunction {
0023
0024 FUNCTION_OBJECT_DEF(LegendreFit)
0025
0026 public:
0027
0028
0029 LegendreFit(unsigned int N);
0030
0031
0032 LegendreFit(const LegendreFit &right);
0033
0034
0035 virtual ~LegendreFit();
0036
0037
0038 virtual double operator ()(double argument) const override;
0039 virtual double operator ()(const Argument & a) const override {return operator() (a[0]);}
0040
0041 unsigned int order() const;
0042
0043 Parameter *getFraction(unsigned int i);
0044 const Parameter *getFraction(unsigned int i) const;
0045
0046 Parameter *getPhase(unsigned int i);
0047 const Parameter *getPhase(unsigned int i) const;
0048
0049
0050
0051 const LegendreCoefficientSet & coefficientsA() const;
0052
0053
0054
0055 const LegendreCoefficientSet & coefficientsASq() const;
0056
0057
0058 void recomputeCoefficients() const;
0059
0060
0061 private:
0062
0063
0064 const LegendreFit & operator=(const LegendreFit &right);
0065
0066
0067 const unsigned int N;
0068 std::vector <Genfun::Parameter *> fraction;
0069 std::vector <Genfun::Parameter *> phase;
0070 mutable LegendreCoefficientSet coefA;
0071 mutable LegendreCoefficientSet coefASq;
0072 mutable ClebschGordanCoefficientSet ClebschGordan;
0073
0074 };
0075 }
0076 #include "CLHEP/GenericFunctions/LegendreFit.icc"
0077 #endif