]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TEvtGen/EvtGenModels/EvtItgThreeCoeffFcn.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenModels / EvtItgThreeCoeffFcn.cxx
CommitLineData
da0e9ce3 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//-------------
29extern "C" {
30}
31
32EvtItgThreeCoeffFcn::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 EvtItgAbsFunction(lowerRange, upperRange),
34 _myFunction(theFunction),
35 _coeffs1(coeffs1),
36 _coeffs2(coeffs2),
37 _coeffs3(coeffs3)
38{}
39
40EvtItgThreeCoeffFcn::~EvtItgThreeCoeffFcn( )
41{}
42
43
44double
45EvtItgThreeCoeffFcn::myFunction(double x) const{
46 return _myFunction(x, _coeffs1, _coeffs2, _coeffs3);
47}
48
49void
50EvtItgThreeCoeffFcn::setCoeff(int vect, int which, double value)
51{
52 if (vect == 1) _coeffs1[which] = value;
53 else if (vect == 2) _coeffs2[which] = value;
54 else if (vect == 3) _coeffs3[which] = value;
55}
56
57double
58EvtItgThreeCoeffFcn::getCoeff(int vect, int which)
59{
60 if (vect == 1) return _coeffs1[which];
61 else if (vect == 2) return _coeffs2[which];
62 else if (vect == 3) return _coeffs3[which];
63 else {return 0;}
64}