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