Line data Source code
1 : //--------------------------------------------------------------------------
2 : //
3 : //
4 : // Copyright Information: See EvtGen/COPYRIGHT
5 : //
6 : // Environment:
7 : // This software is part of the EvtGen package developed jointly
8 : // for the BaBar and CLEO collaborations. If you use all or part
9 : // of it, please give an appropriate acknowledgement.
10 : //
11 : // Module: EvtItgThreeCoeffFcn.cc
12 : //
13 : // Description:
14 : // Class describing a function with three vectors of coefficients.
15 : //
16 : // Modification history:
17 : //
18 : // Jane Tinslay March 21, 2001 Module created
19 : //
20 : //------------------------------------------------------------------------
21 : #include "EvtGenBase/EvtPatches.hh"
22 :
23 :
24 : #include "EvtGenModels/EvtItgThreeCoeffFcn.hh"
25 :
26 : //-------------
27 : // C Headers --
28 : //-------------
29 : extern "C" {
30 : }
31 :
32 : EvtItgThreeCoeffFcn::EvtItgThreeCoeffFcn( double (*theFunction)(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):
33 0 : EvtItgAbsFunction(lowerRange, upperRange),
34 0 : _myFunction(theFunction),
35 0 : _coeffs1(coeffs1),
36 0 : _coeffs2(coeffs2),
37 0 : _coeffs3(coeffs3)
38 0 : {}
39 :
40 : EvtItgThreeCoeffFcn::~EvtItgThreeCoeffFcn( )
41 0 : {}
42 :
43 :
44 : double
45 : EvtItgThreeCoeffFcn::myFunction(double x) const{
46 0 : return _myFunction(x, _coeffs1, _coeffs2, _coeffs3);
47 : }
48 :
49 : void
50 : EvtItgThreeCoeffFcn::setCoeff(int vect, int which, double value)
51 : {
52 0 : if (vect == 1) _coeffs1[which] = value;
53 0 : else if (vect == 2) _coeffs2[which] = value;
54 0 : else if (vect == 3) _coeffs3[which] = value;
55 0 : }
56 :
57 : double
58 : EvtItgThreeCoeffFcn::getCoeff(int vect, int which)
59 : {
60 0 : if (vect == 1) return _coeffs1[which];
61 0 : else if (vect == 2) return _coeffs2[which];
62 0 : else if (vect == 3) return _coeffs3[which];
63 0 : else {return 0;}
64 0 : }
|