1 #ifndef PhysicsTools_Utilities_NumericalIntegration_h 2 #define PhysicsTools_Utilities_NumericalIntegration_h 10 #include "Math/Functor.h" 11 #include "Math/Integrator.h" 12 #include "Math/AllIntegrationTypes.h" 24 sum +=
f(min + (
i + 0.5) * delta);
58 std::vector<double>
x,
w;
60 mutable unsigned int i;
80 for(
i = 0;
i < 4; ++
i) {
89 for(
i = 4;
i < 12; ++
i) {
100 if(bb != b)
goto CASE1;
103 if(1. + aconst*
std::abs(c2) != 1)
goto CASE2;
110 double error()
const {
return error_; }
114 static const double x[12],
w[12];
117 mutable double h, aconst, bb, aa,
c1, c2, u, s8, s16,
f1,
f2,
xx;
118 mutable unsigned int i;
123 double absTol = 1
e-9,
double relTol = 1
e-6,
unsigned int size = 1000,
unsigned int rule = 3) :
124 type_(
type), absTol_(absTol), relTol_(relTol), size_(
size), rule_(rule),
125 integrator_(new
ROOT::Math::Integrator(
type, absTol, relTol,
size, rule)) { }
130 integrator_.reset(
new ROOT::Math::Integrator(type_, absTol_, relTol_, size_, rule_));
136 integrator_.reset(
new ROOT::Math::Integrator(type_, absTol_, relTol_, size_, rule_));
142 integrator_->SetFunction(wrapper);
143 return integrator_->Integral(a, b);
RootIntegrator & operator=(const RootIntegrator &o)
RootIntegrator(const RootIntegrator &o)
double operator()(const F &f, double min, double max) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
GaussIntegrator(double epsilon)
TrapezoidIntegrator(unsigned int samples)
double operator()(const F &f, double a, double b) const
T x() const
Cartesian x coordinate.
Abs< T >::type abs(const T &t)
ROOT::Math::IntegrationOneDim::Type type_
RootIntegrator(ROOT::Math::IntegrationOneDim::Type type=ROOT::Math::IntegrationOneDim::kADAPTIVE, double absTol=1e-9, double relTol=1e-6, unsigned int size=1000, unsigned int rule=3)
GaussLegendreIntegrator()
double operator()(const F &f, double a, double b) const
double operator()(const F &f, double min, double max) const
double trapezoid_integral(const F &f, double min, double max, unsigned int samples)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
std::auto_ptr< ROOT::Math::Integrator > integrator_
static HepMC::HEPEVT_Wrapper wrapper