00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "EvtGenBase/EvtPatches.hh"
00021 #include "EvtGenModels/EvtItgFourCoeffFcn.hh"
00022
00023
00024
00025
00026 extern "C" {
00027 }
00028
00029 EvtItgFourCoeffFcn::EvtItgFourCoeffFcn( double (*theFunction)(double, const std::vector<double> &, const std::vector<double> &, const std::vector<double> &, const std::vector<double> &), double lowerRange, double upperRange, const std::vector<double> &coeffs1, const std::vector<double> &coeffs2, const std::vector<double> &coeffs3, const std::vector<double> &coeffs4):
00030 EvtItgAbsFunction(lowerRange, upperRange),
00031 _myFunction(theFunction),
00032 _coeffs1(coeffs1),
00033 _coeffs2(coeffs2),
00034 _coeffs3(coeffs3),
00035 _coeffs4(coeffs4)
00036 {}
00037
00038 EvtItgFourCoeffFcn::~EvtItgFourCoeffFcn( )
00039 {}
00040
00041
00042 double
00043 EvtItgFourCoeffFcn::myFunction(double x) const{
00044 return _myFunction(x, _coeffs1, _coeffs2, _coeffs3, _coeffs4);
00045 }
00046
00047 void
00048 EvtItgFourCoeffFcn::setCoeff(int vect, int which, double value)
00049 {
00050 if (vect == 1) _coeffs1[which] = value;
00051 else if (vect == 2) _coeffs2[which] = value;
00052 else if (vect == 3) _coeffs3[which] = value;
00053 else if (vect == 4) _coeffs4[which] = value;
00054 }
00055
00056 double
00057 EvtItgFourCoeffFcn::getCoeff(int vect, int which)
00058 {
00059 if (vect == 1) return _coeffs1[which];
00060 else if (vect == 2) return _coeffs2[which];
00061 else if (vect == 3) return _coeffs3[which];
00062 else if (vect == 4) return _coeffs4[which];
00063 else {return 0;}
00064 }