12#ifndef EFLOWCELLINTEGRATION_H_
13#define EFLOWCELLINTEGRATION_H_
33template <
class IntegrandType>
48 double Imean = (I5 + I6) / 2.0;
49 if (fabs(I5 - I6) / Imean <=
m_error) {
66 int j = nOrder * (nOrder - 1) / 2;
70 double rangeCenter = range.getCenter();
71 double rangeHalfWidth = range.getWidth()/2;
76 for (
int i = 0; i < nOrder; i++) {
77 x = rangeCenter + roots[i] * rangeHalfWidth;
82 std::cerr <<
"eflowCellIntergrator::DoGaussLegendreIntegration ERROR : Invalid pointer to IntegrandType and cannot perform integration" << std::endl;
84 if (
I < 0. || rangeHalfWidth < 0.) std::cerr <<
"eflowCellIntergrator::DoGaussLegendreIntegration WARNING: I = " <<
I <<
"\trange = " << range.print() << std::endl;
86 return I * rangeHalfWidth;
92 double subRangeWidth = range.getWidth() / nSubRanges;
93 eflowRange subRange(range.getMin(), range.getMin() + subRangeWidth);
97 for (
int i = 0; i < nSubRanges; i++) {
99 subRange.
shift(subRangeWidth);
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
constexpr double legendreRoots[21]
Stores roots of 5th and 6th order Legendre polynomials.
constexpr double legendreWeights[21]
Stores weights of 5th and 6th order Legendre polynomials.
Class to represent the 2D Gaussian integrand.
void setEtaSq(double xSq)
double evaluateLookupExp(double rSq) const
eflowCellIntegrand(double sigma)
const eflowLookupExp * m_lookupExp
double evaluateStdExp(double rSq) const
double m_oneOverTwoSigmaSq
double evaluate(double y)
The evaluate method for the integration.
double integrate(const eflowRange &etaRange, const eflowRange &phiRange)
Main method, which starts the integration.
eflowRecursiveGaussLegendreIntegrator< eflowCellIntegrand<(Exp_t) expType > > m_innerIntegrator
double evaluate(double eta)
Evaluate method for the outer (i.e.
eflowCellIntegrator & operator=(const eflowCellIntegrator &original)
eflowCellIntegrator(double stdDev, double error)
eflowCellIntegrator(const eflowCellIntegrator &original)
std::unique_ptr< eflowCellIntegrand<(Exp_t) expType > > m_integrand2D
eflowRecursiveGaussLegendreIntegrator< eflowCellIntegrator< expType > > m_outerIntegrator
Lookup-table based exponential function to save CPU time, which is used by eflowCellIntegrator.
Class to perform a generic recursive Gauss-Legendre Integration, see http://en.wikipedia....
IntegrandType * m_integrand
double DoGaussLegendreIntegration(const eflowRange &range, int nOrder)
virtual double integrate(const eflowRange &range)
virtual ~eflowRecursiveGaussLegendreIntegrator()
double RecurseIntegration(const eflowRange &range, int nSubRanges)
eflowRecursiveGaussLegendreIntegrator(IntegrandType *integrand, double error)
Exp_t
Enum used as template argument to switch between std::exp and the lookup-table based version.
eflowRangeBase< double > eflowRange
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)