TF3 Integration

So, for the first time I am trying to do multiple integration using TF3 for 3 variables. Here’s below what I wrote in my code which is showing error when compiled. It is showing that it can’t call Wrapped function. I don’t know how to do triple integration in ROOT and where is my error in this code. Any help in this regard would be highly appreciated. Thank you.

 TF3 *sigma_1 = new TF3("sigma_1", integrand_sigma , 0, 100,0,100,-1,1,2);  				
		Sigma->FixParameter(0, q);
		Sigma->FixParameter(1, T);
		ROOT::Math::WrappedMultiTF1 wf1(Sigma);
		ROOT::Math::AdaptiveIntegratorMultiDim ig;
		
		ig.SetFunction(wf1);
		double xmin[] = {0,0};
		double xmax[] = {100,100};
	
		double sigma_num = ig.Integral(xmin, xmax);

		cout<<sigma_num<<endl;

I guess @moneta can help you.

Hi,

I see from the code you are integrating a 3D function. You should then define xmin and xmax as 3d arrays

Lorenzo

Hi,
So, I did the following way but it still didn’t work out…(P.S. “integrand_sigma” is a function defined above the main function in my code where the value of integrand_sigma is already calculated):

TF3 *Sigma = new TF3(“Sigma”, integrand_sigma , 0, 100,0,100,-1,1,2);
Sigma->FixParameter(0, q);
Sigma->FixParameter(1, T);
ROOT::Math::WrappedMultiTF1 wf1(Sigma);
ROOT::Math::AdaptiveIntegratorMultiDim ig;
ig.SetRelTolerance(0.001);
ig.SetFunction(wf1);
double xmin[] = {0,0,-1};
double xmax[] = {100,100,1};
double sigma_num = ig.Integral(xmin, xmax);

	cout<<sigma_result<<endl;

The error repeatedly being shown is :

Error: Can’t call WrappedMultiTF1::WrappedMultiTF1(Sigma) in current scope pion_eta.C:191:
Possible candidates are…
Error: class,struct,union or type WrappedMultiTF1 not defined pion_eta.C:191:
*** Interpreter error recovered ***

I doubt that it’s because ROOT::Math::WrappedMultiTF1 wf1 function is not supported by ROOT version 5.34/38 , the one I’m using. Is that so ??

Try: ROOT::Math::WrappedMultiTF1 wf1(*Sigma);

I did…It’s showing bus error now!!

It seems to suggest that you have a bug somewhere in your “integrand_sigma”.