BOSS 8.0.0
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
25#include "EvtItgAbsFunction.hh"
26
27//-------------
28// C Headers --
29//-------------
30extern "C" {}
32#include "assert.h"
33using std::endl;
34
36 : _upperRange( upperRange ), _lowerRange( lowerRange ) {}
37
39
40double EvtItgAbsFunction::value( double x ) const {
41 if ( x >= _lowerRange && x <= _upperRange ) return myFunction( x );
42 report( ERROR, "EvtGen" ) << "Error in EvtItgAbsFunction::value. Given co-ordinate " << x
43 << " is outside of allowed range [" << _lowerRange << ", "
44 << _upperRange << "]. Returning 0.0" << endl;
45 return 0.0; // Never get here
46}
47
48double EvtItgAbsFunction::operator()( double x ) const { return myFunction( x ); }
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ ERROR
Definition EvtReport.hh:49
virtual double operator()(double x) const
EvtItgAbsFunction(double lowerRange, double upperRange)
double lowerRange() const
double upperRange() const
virtual double myFunction(double x) const =0
virtual double value(double x) const