CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 // -*- C++ -*- 00002 // $Id: LegendreFit.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $ 00003 //---------------------LegendreFit------------------------------------------// 00004 // // 00005 // Class LegendreFit. This is a fitting function consisting of a super // 00006 // position of N legendre polynomials. Cascading fractions and phases are // 00007 // the input parameters. Function is normalized to one (on [-1,1]) // 00008 // // 00009 //--------------------------------------------------------------------------// 00010 #ifndef LegendreFit_h 00011 #define LegendreFit_h 1 00012 #include "CLHEP/GenericFunctions/AbsFunction.hh" 00013 #include "CLHEP/GenericFunctions/Parameter.hh" 00014 #include "CLHEP/GenericFunctions/LegendreCoefficientSet.hh" 00015 #include "CLHEP/GenericFunctions/ClebschGordanCoefficientSet.hh" 00016 namespace Genfun { 00017 00022 class LegendreFit : public AbsFunction { 00023 00024 FUNCTION_OBJECT_DEF(LegendreFit) 00025 00026 public: 00027 00028 // Constructor 00029 LegendreFit(unsigned int N); 00030 00031 // Copy constructor 00032 LegendreFit(const LegendreFit &right); 00033 00034 // Destructor 00035 virtual ~LegendreFit(); 00036 00037 // Retreive function value 00038 virtual double operator ()(double argument) const; 00039 virtual double operator ()(const Argument & a) const {return operator() (a[0]);} 00040 00041 unsigned int order() const; 00042 00043 Parameter *getFraction(unsigned int i); 00044 const Parameter *getFraction(unsigned int i) const; 00045 00046 Parameter *getPhase(unsigned int i); 00047 const Parameter *getPhase(unsigned int i) const; 00048 00049 // Gets the coefficients the coefficients of the function which is 00050 // Squared to obtain a probability distribution (amplitude) 00051 const LegendreCoefficientSet & coefficientsA() const; 00052 00053 // Gets the coefficients the coefficients of the function which is 00054 // Squared to obtain a probability distribution: 00055 const LegendreCoefficientSet & coefficientsASq() const; 00056 00057 // Recompute coefficients from the parameters: 00058 void recomputeCoefficients() const; 00059 00060 00061 private: 00062 00063 // It is illegal to assign an adjustable constant 00064 const LegendreFit & operator=(const LegendreFit &right); 00065 00066 // 00067 const unsigned int N; 00068 std::vector <Genfun::Parameter *> fraction; 00069 std::vector <Genfun::Parameter *> phase; 00070 mutable LegendreCoefficientSet coefA; 00071 mutable LegendreCoefficientSet coefASq; 00072 mutable ClebschGordanCoefficientSet ClebschGordan; 00073 00074 }; 00075 } // namespace Genfun 00076 #include "CLHEP/GenericFunctions/LegendreFit.icc" 00077 #endif