Hello, I’m trying to integrate a TF2 function with ROOT method “Integral”.
A piece of my code is:
Double_t Gauss2D(Double_t *x, Double_t *par)
{
Double_t xx =x[0]+6443.5;
Double_t yy = x[1];
//Double_t f = 240/(2*3.1415*par[1]*par[1])*((exp(-0.5*((xx-par[0])/par[1])*((xx-par[0])/par[1])))*exp(-0.5*((yy-par[2])/par[1])*((yy-par[2])/par[1])));
Double_t f = par[3]*((exp(-0.5*((xx-par[0])/par[1])*((xx-par[0])/par[1])))*exp(-0.5*((yy-par[2])/par[1])*((yy-par[2])/par[1])));
return f;
}
TF2 *f_Gauss2D = new TF2("f_Gauss2D",Gauss2D,6420,6460,-15,15,4);
Double_t I_Gauss2D_1(Double_t *x, Double_t *par)
{
f_Gauss2D->SetParameter(0,x[0]); //la variabile dell'integrale e' il parametro 0 della gaussiana
f_Gauss2D->SetParameter(1,par[0]);
f_Gauss2D->SetParameter(2,par[1]);
f_Gauss2D->SetParameter(3,par[2]);
Double_t integral = f_Gauss2D->Integral(-par[3]/2,par[3]/2,-par[3]/2,par[3]/2,1e-2);
return integral;
}
but I have this message error:
Error in ROOT::Math::AdaptiveIntegratorMultiDim::DoIntegral(): Logic error: idvax0 < 1!
How can I solve this problem?
Thank you in advance.
Silvia
ROOT Version: 6.26/06