#include <EvtItgPtrFunction.hh>
Inheritance diagram for EvtItgPtrFunction:
Public Member Functions | |
EvtItgPtrFunction (double(*theFunction)(double, const std::vector< double > &), double lowerRange, double upperRange, const std::vector< double > &coeffs1) | |
virtual | ~EvtItgPtrFunction () |
virtual void | setCoeff (int, int, double) |
virtual double | getCoeff (int, int) |
virtual double | value (double x) const |
virtual double | operator() (double x) const |
double | upperRange () const |
double | lowerRange () const |
void | getRange (double &lower, double &upper) const |
Protected Member Functions | |
virtual double | myFunction (double x) const |
void | setRange (double x1, double x2) |
Private Member Functions | |
EvtItgPtrFunction (const EvtItgPtrFunction &) | |
EvtItgPtrFunction & | operator= (const EvtItgPtrFunction &) |
Private Attributes | |
double(* | _myFunction )(double x, const std::vector< double > &coeffs1) |
std::vector< double > | _coeffs1 |
Definition at line 30 of file EvtItgPtrFunction.hh.
EvtItgPtrFunction::EvtItgPtrFunction | ( | double(*)(double, const std::vector< double > &) | theFunction, | |
double | lowerRange, | |||
double | upperRange, | |||
const std::vector< double > & | coeffs1 | |||
) |
Definition at line 35 of file EvtItgPtrFunction.cc.
00035 : 00036 EvtItgAbsFunction(lowerRange, upperRange), 00037 _myFunction(theFunction), 00038 _coeffs1(coeffs1) 00039 {}
EvtItgPtrFunction::~EvtItgPtrFunction | ( | ) | [virtual] |
EvtItgPtrFunction::EvtItgPtrFunction | ( | const EvtItgPtrFunction & | ) | [private] |
double EvtItgPtrFunction::getCoeff | ( | int | , | |
int | ||||
) | [virtual] |
Implements EvtItgAbsFunction.
Definition at line 62 of file EvtItgPtrFunction.cc.
References _coeffs1.
00063 { 00064 if (vect == 1) return _coeffs1[which]; 00065 else {return 0;} 00066 }
void EvtItgAbsFunction::getRange | ( | double & | lower, | |
double & | upper | |||
) | const [inline, inherited] |
Definition at line 53 of file EvtItgAbsFunction.hh.
References EvtItgAbsFunction::_lowerRange, and EvtItgAbsFunction::_upperRange.
00053 { lower = _lowerRange; upper = _upperRange; }
double EvtItgAbsFunction::lowerRange | ( | ) | const [inline, inherited] |
Definition at line 52 of file EvtItgAbsFunction.hh.
References EvtItgAbsFunction::_lowerRange.
Referenced by EvtItgAbsIntegrator::boundsCheck(), and EvtItgAbsIntegrator::normalisation().
00052 {return _lowerRange;}
double EvtItgPtrFunction::myFunction | ( | double | x | ) | const [protected, virtual] |
Implements EvtItgAbsFunction.
Definition at line 51 of file EvtItgPtrFunction.cc.
References _coeffs1, and _myFunction.
00051 { 00052 return _myFunction(x, _coeffs1); 00053 }
double EvtItgAbsFunction::operator() | ( | double | x | ) | const [virtual, inherited] |
Definition at line 54 of file EvtItgAbsFunction.cc.
References EvtItgAbsFunction::myFunction().
00054 { 00055 return myFunction(x); 00056 }
EvtItgPtrFunction& EvtItgPtrFunction::operator= | ( | const EvtItgPtrFunction & | ) | [private] |
void EvtItgPtrFunction::setCoeff | ( | int | , | |
int | , | |||
double | ||||
) | [virtual] |
Implements EvtItgAbsFunction.
Definition at line 56 of file EvtItgPtrFunction.cc.
References _coeffs1.
void EvtItgAbsFunction::setRange | ( | double | x1, | |
double | x2 | |||
) | [inline, protected, inherited] |
Definition at line 60 of file EvtItgAbsFunction.hh.
References EvtItgAbsFunction::_lowerRange, and EvtItgAbsFunction::_upperRange.
00060 { _lowerRange=x1; _upperRange=x2; };
double EvtItgAbsFunction::upperRange | ( | ) | const [inline, inherited] |
Definition at line 51 of file EvtItgAbsFunction.hh.
References EvtItgAbsFunction::_upperRange.
Referenced by EvtItgAbsIntegrator::boundsCheck(), and EvtItgAbsIntegrator::normalisation().
00051 {return _upperRange;}
double EvtItgAbsFunction::value | ( | double | x | ) | const [virtual, inherited] |
Definition at line 45 of file EvtItgAbsFunction.cc.
References EvtItgAbsFunction::_lowerRange, EvtItgAbsFunction::_upperRange, calibUtil::ERROR, EvtItgAbsFunction::myFunction(), and report().
Referenced by EvtBtoXsgammaRootFinder::GetRootSingleFunc().
00045 { 00046 if (x >= _lowerRange && x <= _upperRange) return myFunction(x); 00047 report(ERROR,"EvtGen") << "Error in EvtItgAbsFunction::value. Given co-ordinate " << x 00048 << " is outside of allowed range [" << _lowerRange << ", " 00049 << _upperRange << "]. Returning 0.0" << endl; 00050 return 0.0; // Never get here 00051 }
std::vector<double> EvtItgPtrFunction::_coeffs1 [private] |
Definition at line 55 of file EvtItgPtrFunction.hh.
Referenced by getCoeff(), myFunction(), and setCoeff().
double(* EvtItgPtrFunction::_myFunction)(double x, const std::vector< double > &coeffs1) [private] |
Referenced by myFunction().