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