ROOT Version: 6.22/02
Platform: Ubuntu 20.04.1 LTS
Compiler: g++
What am I doing wrong actually? Is it something related to namespace or what? I have
just taken the code from the available user guide for ROOT and using a function and then
compiling it with g++ -o File test.cc `root-config --cflags --libs`
. Here is the code :
#define EPS 1e-5
#include <iostream>
#include <cmath>
#include "Math/Integrator.h"
using namespace std;
const double R = 6.38;
const double a = 0.535;
const double w = 0.;
double Fermi(double* r){
double rho = (1. + w*pow(r[0]/R, 2))/(1. + exp((r[0] - R)/a));
return rho;
}
int test(){
ROOT::Math::IntegratorOneDimOptions::SetDefaultAbsTolerance(EPS);
ROOT::Math::IntegratorOneDimOptions::SetDefaultRelTolerance(EPS);
ROOT::Math::Functor1D F(&Fermi);
ROOT::Math::Integrator I(ROOT::Math::IntegrationOneDim::kADAPTIVESINGULAR);
I.SetFunction(F);
double t = I.Integral(0., 3*R);
cout << t << endl;
return 0;
}
Here is the error :
test.cc: In function ‘int test()’:
test.cc:20:15: error: ‘Functor1D’ is not a member of ‘ROOT::Math’
20 | ROOT::Math::Functor1D F(&Fermi);
| ^~~~~~~~~