BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtItgAbsFunction.cc
Go to the documentation of this file.
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: EvtItgAbsFunction.hh
11//
12// Description:
13// Abstraction of a generic function for use in integration methods elsewhere
14// in this package. (Stolen and modified from the BaBar IntegrationUtils package
15// - author: Phil Strother).
16//
17// Modification history:
18//
19// Jane Tinslay March 21, 2001 Module adapted for use in
20// EvtGen
21//
22//------------------------------------------------------------------------
24
26
27//-------------
28// C Headers --
29//-------------
30extern "C" {
31}
32#include "assert.h"
34using std::endl;
35
36EvtItgAbsFunction::EvtItgAbsFunction(double lowerRange, double upperRange):
37 _upperRange(upperRange),
38 _lowerRange(lowerRange){}
39
41{}
42
43
44double
45EvtItgAbsFunction::value( double x) const{
46 if (x >= _lowerRange && x <= _upperRange) return myFunction(x);
47 report(ERROR,"EvtGen") << "Error in EvtItgAbsFunction::value. Given co-ordinate " << x
48 << " is outside of allowed range [" << _lowerRange << ", "
49 << _upperRange << "]. Returning 0.0" << endl;
50 return 0.0; // Never get here
51}
52
53double
55 return myFunction(x);
56}
Double_t x[10]
ostream & report(Severity severity, const char *facility)
Definition: EvtReport.cc:36
@ ERROR
Definition: EvtReport.hh:49
virtual double operator()(double x) const
EvtItgAbsFunction(double lowerRange, double upperRange)
virtual ~EvtItgAbsFunction()
virtual double myFunction(double x) const =0
virtual double value(double x) const