# GLSMC Integrator

**URL:** <https://root-forum.cern.ch/t/glsmc-integrator/58007>\
**Category:** Newbie\
**Created:** [January 30, 2024, 5:55pm UTC](https://root-forum.cern.ch/t/glsmc-integrator/58007 "2024-01-30T17:55:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfagundes](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dfagundes/32/35587_2.png) [@dfagundes](https://root-forum.cern.ch/u/dfagundes)\
**Post date:** [January 30, 2024, 5:55pm UTC](https://root-forum.cern.ch/t/glsmc-integrator/58007/1 "2024-01-30T17:55:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mdessole](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mdessole/32/34021_2.png) [@mdessole](https://root-forum.cern.ch/u/mdessole)\
**Post date:** [January 31, 2024, 9:10am UTC](https://root-forum.cern.ch/t/glsmc-integrator/58007/2 "2024-01-31T09:10:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dfagundes](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dfagundes/32/35587_2.png) [@dfagundes](https://root-forum.cern.ch/u/dfagundes)\
**Post date:** [January 31, 2024, 5:02pm UTC](https://root-forum.cern.ch/t/glsmc-integrator/58007/3 "2024-01-31T17:02:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dfagundes](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dfagundes/32/35587_2.png) [@dfagundes](https://root-forum.cern.ch/u/dfagundes)\
**Post date:** [January 31, 2024, 6:29pm UTC](https://root-forum.cern.ch/t/glsmc-integrator/58007/4 "2024-01-31T18:29:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dfagundes](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dfagundes/32/35587_2.png) [@dfagundes](https://root-forum.cern.ch/u/dfagundes)\
**Post date:** [January 31, 2024, 8:06pm UTC](https://root-forum.cern.ch/t/glsmc-integrator/58007/5 "2024-01-31T20:06:53Z")

</div>

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

> [@Unofficial ROOT 6.26.10 package for Ubuntu 22.04](https://root-forum.cern.ch/t/unofficial-root-6-26-10-package-for-ubuntu-22-04/52773):
>
> I built a ROOT 6.26.10 debian package for Ubuntu 22.04. It can be downloaded from here: [https://cern.ch/amadio/root/root\_6.26.10\_ubuntu22\_amd64.deb](https://cern.ch/amadio/root/root_6.26.10_ubuntu22_amd64.deb). Please note that this is an unofficial package, but should be ok for most people to use. If you are having trouble compiling ROOT, give it a try. After you download it, you can install it with $ sudo apt install ./root\_6.26\_10\_ubuntu22\_amd64.deb Please let me know in the comments if I should do this also for future releases. Happy hacking with ROO…
