evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtItgFourCoeffFcn.cpp
Go to the documentation of this file.
1 
2 /***********************************************************************
3 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4 * *
5 * This file is part of EvtGen. *
6 * *
7 * EvtGen is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * EvtGen is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19 ***********************************************************************/
20 
22 
23 #include "EvtGenBase/EvtPatches.hh"
24 
25 //-------------
26 // C Headers --
27 //-------------
28 extern "C" {
29 }
30 
32  double ( *theFunction )( double, const std::vector<double>&,
33  const std::vector<double>&,
34  const std::vector<double>&,
35  const std::vector<double>& ),
36  double lowerRange, double upperRange, const std::vector<double>& coeffs1,
37  const std::vector<double>& coeffs2, const std::vector<double>& coeffs3,
38  const std::vector<double>& coeffs4 ) :
39  EvtItgAbsFunction( lowerRange, upperRange ),
40  _myFunction( theFunction ),
41  _coeffs1( coeffs1 ),
42  _coeffs2( coeffs2 ),
43  _coeffs3( coeffs3 ),
44  _coeffs4( coeffs4 )
45 {
46 }
47 
48 double EvtItgFourCoeffFcn::myFunction( double x ) const
49 {
51 }
52 
53 void EvtItgFourCoeffFcn::setCoeff( int vect, int which, double value )
54 {
55  if ( vect == 1 )
56  _coeffs1[which] = value;
57  else if ( vect == 2 )
58  _coeffs2[which] = value;
59  else if ( vect == 3 )
60  _coeffs3[which] = value;
61  else if ( vect == 4 )
62  _coeffs4[which] = value;
63 }
64 
65 double EvtItgFourCoeffFcn::getCoeff( int vect, int which )
66 {
67  if ( vect == 1 )
68  return _coeffs1[which];
69  else if ( vect == 2 )
70  return _coeffs2[which];
71  else if ( vect == 3 )
72  return _coeffs3[which];
73  else if ( vect == 4 )
74  return _coeffs4[which];
75  else {
76  return 0;
77  }
78 }
double myFunction(double x) const override
double getCoeff(int, int) override
std::vector< double > _coeffs4
void setCoeff(int, int, double) override
EvtItgFourCoeffFcn(double(*theFunction)(double, const std::vector< 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, const std::vector< double > &coeffs4)
virtual double value(double x) const
std::vector< double > _coeffs1
std::vector< double > _coeffs2
double(* _myFunction)(double x, const std::vector< double > &coeffs1, const std::vector< double > &coeffs2, const std::vector< double > &coeffs3, const std::vector< double > &coeffs4)
std::vector< double > _coeffs3