Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EvtItgAbsIntegrator Class Reference

#include <EvtItgAbsIntegrator.hh>

Inheritance diagram for EvtItgAbsIntegrator:

EvtItgSimpsonIntegrator List of all members.

Public Member Functions

double evaluate (double lower, double upper) const
 EvtItgAbsIntegrator (const EvtItgAbsFunction &)
double normalisation () const
virtual ~EvtItgAbsIntegrator ()

Protected Member Functions

virtual double evaluateIt (double lower, double higher) const =0
double myFunction (double x) const
double trapezoid (double lower, double higher, int n, double &result) const

Private Member Functions

void boundsCheck (double &, double &) const
 EvtItgAbsIntegrator (const EvtItgAbsIntegrator &)
 EvtItgAbsIntegrator ()
EvtItgAbsIntegratoroperator= (const EvtItgAbsIntegrator &)

Private Attributes

const EvtItgAbsFunction_myFunction

Constructor & Destructor Documentation

EvtItgAbsIntegrator::EvtItgAbsIntegrator const EvtItgAbsFunction  ) 
 

00039                                                                             :
00040   _myFunction(theFunction)
00041 {}

EvtItgAbsIntegrator::~EvtItgAbsIntegrator  )  [virtual]
 

00044 {}

EvtItgAbsIntegrator::EvtItgAbsIntegrator  )  [private]
 

EvtItgAbsIntegrator::EvtItgAbsIntegrator const EvtItgAbsIntegrator  )  [private]
 


Member Function Documentation

void EvtItgAbsIntegrator::boundsCheck double &  ,
double & 
const [private]
 

00089                                                                   {
00090 
00091   if (lower < _myFunction.lowerRange() ) {
00092     report(WARNING,"EvtGen") << "Warning in EvtItgAbsIntegrator::evaluate.  Lower bound " << lower << " of integral " 
00093                     << " is less than lower bound " << _myFunction.lowerRange() 
00094                     << " of function.  No contribution from this range will be counted." << endl;
00095     lower = _myFunction.lowerRange();
00096   }
00097 
00098   if (upper > _myFunction.upperRange() ) {
00099     report(WARNING,"EvtGen") << "Warning in EvtItgAbsIntegrator::evaluate.  Upper bound " << upper << " of integral "
00100                     << " is greater than upper bound " << _myFunction.upperRange() 
00101                     << " of function.  No contribution from this range will be counted." << endl;  
00102     upper = _myFunction.upperRange();
00103   }
00104 
00105 }

double EvtItgAbsIntegrator::evaluate double  lower,
double  upper
const
 

00052                                                              {
00053 
00054   double newLower(lower), newUpper(upper);
00055 
00056   boundsCheck(newLower, newUpper);
00057 
00058   return evaluateIt(newLower, newUpper);
00059 }

virtual double EvtItgAbsIntegrator::evaluateIt double  lower,
double  higher
const [protected, pure virtual]
 

Implemented in EvtItgSimpsonIntegrator.

double EvtItgAbsIntegrator::myFunction double  x  )  const [inline, protected]
 

00049 {return _myFunction(x);}

double EvtItgAbsIntegrator::normalisation  )  const
 

00047                                          {
00048   return evaluateIt(_myFunction.lowerRange(), _myFunction.upperRange());
00049 }

EvtItgAbsIntegrator& EvtItgAbsIntegrator::operator= const EvtItgAbsIntegrator  )  [private]
 

double EvtItgAbsIntegrator::trapezoid double  lower,
double  higher,
int  n,
double &  result
const [protected]
 

00062                                                                                        {
00063 
00064   if (n==1) return 0.5*(higher-lower)*(_myFunction(lower) + _myFunction(higher));
00065   
00066   int it, j;
00067   
00068   for (it=1, j=1;j<n-1;j++) it <<=1;
00069   
00070   double itDouble(it);
00071   
00072   double sum(0.0);
00073 
00074   double deltaX((higher - lower)/itDouble);
00075   
00076   double x(lower + 0.5* deltaX);
00077     
00078   for (j=1;j<=it;j++){
00079     sum+=_myFunction(x);
00080     x+=deltaX;
00081   }
00082   
00083   result = 0.5*(result+(higher - lower)*sum/itDouble);
00084 
00085   return result;
00086 }


Member Data Documentation

const EvtItgAbsFunction& EvtItgAbsIntegrator::_myFunction [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:06:16 2011 for BOSS6.5.5 by  doxygen 1.3.9.1