# ROOT integral idvax0 <1

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?
Silvia

ROOT Version: 6.26/06

How do you use this code ?

I’m doing a combined fit of three graphs. If you want I can paste the entire code.

It would be nice to have a piece of code reproducing the problem.

combinedFit.C (11.9 KB)

If are necessary the files, I’ll upload them.

Yes the `.txt` files are missing.

2023-03-02_scan_50.txt (4.8 KB)
2023-03-02_scan_52.txt (4.7 KB)
2023-03-02_scan_55.txt (4.8 KB)

With your files I can re[produce the error and I see in the code where it comes from but that does not explain with this index ( idvax0) is invalid. I guess @moneta can help. Also try to to look at othere similar posts:

https://root-forum.cern.ch/search?q=idvax0

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.