GLSMC Integrator

Hi guys.

I’m struggling to compute integrals with the class ROOT::Math::GSLMCIntegrator lately. Here’s a piece of my code where the class is invoked:


double Integrator3DRE(double * p){
const int ndim=3;
const int npar_ker=2;

//integration limits
const double xmin[ndim] ={xGenMin,xGenMin,xGenMin};
const double xmax[ndim]={xGenMax,xGenMax,xGenMax};

 ROOT::Math::WrappedParamFunction<> wf(&KerAmpRe,ndim,npar_ker);
 wf.SetParameters(p);
 ROOT::Math::GSLMCIntegrator ig(ROOT::Math::IntegrationMultiDim::kVEGAS,1,1,1e4);

// ig.SetRelTolerance(1.e-3);
ig.SetFunction(wf);

 return ig.Integral(xmin,xmax);  

}


which returns the following errors:


error: no member named ‘GSLMCIntegrator’ in namespace ‘ROOT::Math’
ROOT::Math::GSLMCIntegrator ig(ROOT::Math::IntegrationMultiDim::kVEGAS,1,1,1e4);
~~~~~~~~~~~~^

error: use of undeclared identifier ‘ig’
ig.SetFunction(wf);
^
error: use of undeclared identifier ‘ig’
return ig.Integral(xmin,xmax); //in GeV^{-2}


The system seems not to recognize the class…it doesn’t matter wheter i include the library Math/GSLMCIntegrator.h or not the outcome is the same.

Can anyone help me to fix this?
Thanks,
Dan.

_ROOT Version:6.30.02
_Platform: Ubuntu 22.04

Hi @dfagundes,
thank you for posting on the ROOT forum!
The functions you’re looking for are part of the MathMore package, which should be enabled by default in ROOT. However, your error makes me think that in your installation you don’t have it. Can you tell how you’ve installed ROOT?

The option for MathMore depends on you having GSL installed on your system or using the builtin version of GSL. If you are not using the CMake build system, it’s recommended that you install GSL with homebrew or similar prior to installing ROOT.

Cheers,
Monica

1 Like

Dear Monica,

thanks for the spot-on answer. Now I see the problem…I installed ROOT from Snap, trying to avoid the long installation using CMake. But I shall step back and to see what get after your advices. What looks very strange to me is that this very same code used to work perfectly 6 months back in the same machine. Maybe I messed it up with some update…

Thanks once again.
Cheers,
Dan.

Dear Monica,

i installed Root 6.30.04 from scratch using CMake, still I get the some errors. Following other posts here i red that Mathmore is installed by default in the Cmake installation.

Any clues on what maybe be happening?

Cheers,
Daniel.

I’m now able to use GSLMCIntegrator class by installing a .deb package by amadio posted in the link below