Integrator problem

Warning in <TF1::IntegralOneDim>: Error found in integrating function voigtian in [1.431000,1.700000] using AdaptiveSingular. Result = 3.434634 +/- 0.000000 - status = 18 Info in <TF1::IntegralOneDim>:
this warning showing when trying to get integral from fit function.
it goes away when i set any one perimeter of fit function too small,… How i get rid off from these warning without changing perimeters

@moneta Do you have a suggestion?

Hello,
There is an issue integrating the function. It is normal that changing some of the function parameter, the warning can go away.
The problem, looking at the error code (numerical error) it is due to a failure to reach the desired tolerance. What you can try is to increase the default tolerances used by the integrator( the default values are 1.E-9). You can do this by doing for example:

ROOT::Math::IntegratorOneDimOptions::SetDefaultAbsTolerance(1.E-6);
ROOT::Math::IntegratorOneDimOptions::SetDefaultRelTolerance(1.E-6);

Lorenzo

thanks for replay;
where to put these two lines of code?
as i copied it into my macros , but it doesnot work, the warning are still there .

Can you post a small macro reproducing the problem ?

HI,
You can put the lines anywhere before calling TF1::Integral. One more think you can try is changing the integration algorithm, for example you can try to use a simple Gaussian integrator, doing:

ROOT::Math::IntegratorOneDimOptions::SetDefaultIntegrator("Gauss");

Lorenzo

1 Like
Double_t voignpoly2(Double_t *x ,Double_t *par)
{
  Double_t voig_poly2 =(par[0]*TMath::Voigt(x[0]-par[1],par[2],par[3],4))+(par[4]+par[5]*x[0]+par[6]*x[0]*x[0]);
  return voig_poly2;
}

this is my fit function. Are you see any problem in this?

Thanks sir, warning goes away , I want to know that by default what is the Integrator option?
and what is the concept behind chossing these options?
any suggestion/documentation have please share.

Be warned that the fact that some ROOT “integrator” does not display a warning does not mean that the value that it returned is correct.
You could try different ROOT “integrators” and compare the results which they return.
Or you could use another external tool to validate the results.

1 Like

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