Hi Rene,
I am experiencing a problem with TF1::IntegralMultiple(Int_t n, const Double_t* a, const Double_t* b, Int_t minpts, Int_t maxpts, Double_t epsilon, Double_t& relerr, Int_t& nfnevl, Int_t& ifail)
(The quoted example below is similar to what I think I am experiencing.)
I actually have a 3-dim integral, so am using TF3. Root version 4.04/02d
on a linux machine with gcc version 3.4.3.
My integrand is very complex – it has at least one sharp peak and the bounds are very wide. Unfortunately, I cannot easily provide you with an example. I’ve been setting the minpts to 10000, maxpts to 500000 and epsilon to 0.001.
This integral is evaluated at every point in a likelihood curve. For some events, there are no problems – the relerr is below epsilon and ifail is 0.
These events have very nice, smooth curves.
However, in many events the integration does not seem to work properly.
For some of the likelihood points, the relerr never reaches epsilon (even if I increase the maxcalls significantly). When this happens, ifail is set to 1, which is the expected behavior. Also, in some points, relerr does not reach epsilon, but the maxcalls are not reached and ifail is set to 0. Integration stops after only calling the integrand a few 100 times, generally far below minpts.
Why does the integration bail out before reaching epsilon or maxpoints – even without calling minpts?
In the events where I have problems, I’ve histogrammed where in the integrand space the integration looks, and I can tell it is not finding the peak. As I mentioned, I have a sharp peak with very wide bounds. Is it possible to somehow reduce the stepsize so that the integration can find the peak?
Thanks,
Brian
[quote=“brun”]
//Create TF1.
NormFunc = new TF1(“normFunc”, normGaus, 4.6, 6.0 , 3);
NormFunc->SetParameters(46.8974, 5.28516, 0.0082587);
Double_t norm = NormFunc->Integral(4.6, 6.0);
cout<<“Norm:”<<norm<<endl;
// Output:
// Norm:9.53183e-07
// If I change it to
// Double_t norm = NormFunc->Integral(5.0, 6.0);
// I get the correct output:
// Norm:46.8974
// NormFunc->SetNpx(1000) does not help.
// Seels like integrator misses the spike.
// How do I change number of integration points?
// Great thanks.
Rene[/quote]