1 #ifndef PhysicsTools_Utilities_NumericalIntegration_h
2 #define PhysicsTools_Utilities_NumericalIntegration_h
10 #include "Math/AllIntegrationTypes.h"
11 #include "Math/Functor.h"
12 #include "Math/Integrator.h"
21 const double l = max -
min,
delta = l / samples;
23 for (
unsigned int i = 0;
i < samples; ++
i) {
24 sum +=
f(min + (
i + 0.5) * delta);
48 a0 = 0.5 * (max +
min);
49 b0 = 0.5 * (max -
min);
60 std::vector<double>
x,
w;
62 mutable unsigned int i;
83 for (
i = 0;
i < 4; ++
i) {
92 for (
i = 4;
i < 12; ++
i) {
120 static const double x[12],
w[12];
123 mutable double h,
aconst,
bb,
aa,
c1,
c2,
u,
s8,
s16,
f1,
f2,
xx;
124 mutable unsigned int i;
129 double absTol = 1
e-9,
130 double relTol = 1
e-6,
131 unsigned int size = 1000,
132 unsigned int rule = 3)
156 template <
typename F>
RootIntegrator & operator=(const RootIntegrator &o)
RootIntegrator(const RootIntegrator &o)
double operator()(const F &f, double min, double max) const
GaussIntegrator(double epsilon)
TrapezoidIntegrator(unsigned int samples)
double operator()(const F &f, double a, double b) const
std::unique_ptr< ROOT::Math::Integrator > integrator_
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
static const double w[12]
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)
tuple size
Write out results.
static HepMC::HEPEVT_Wrapper wrapper
static const double x[12]