#include #include "Math/IFunction.h" #include "Math/AdaptiveIntegratorMultiDim.h" class TestFun : public ROOT::Math::IBaseFunctionMultiDim { virtual ROOT::Math::IBaseFunctionMultiDim * Clone() const { return new TestFun(); } virtual unsigned int NDim() const { return 2; } virtual double DoEval(const double *x) const { return x[0] + x[1]; } }; void DoTest() { const double ptMin[] = {0.0, 0.0}; const double ptMax[] = {1.0, 1.0}; TestFun fun; // this works { std::cout << "Starting working test..." << std::endl; ROOT::Math::AdaptiveIntegratorMultiDim ig(fun); std::cout << ig.Integral(ptMin, ptMax) << std::endl; } // this does not work { std::cout << "Starting NOT working test..." << std::endl; ROOT::Math::AdaptiveIntegratorMultiDim ig; std::cout << ig.Integral(fun, ptMin, ptMax) << std::endl; } }