Dear all.

I am trying to integrate a 2D conditional PDF built using some RooFit built-in PDFs and some ‘custom’ PDFs in some user specified ranges. I do that in order to scan the full 2D phase space in which I do perform the fit. And I do see a strange behaviour. Here are the details:

a) I’m using RooFit v3.48

b) the PDF is function of 2 observables m,b and the fit pdf is a conditional PDF (pdf_fit(m|b))

c) the integrals I try to compute in the ranges named ‘rnm’ are built using

G = pdf_fit->createIntegral(RooArgSet(*m,*b),NormSet(RooArgSet(*m,*b)),Range(rnm));

Now. what I observe is the following.

If I do the integral in the full m,b range I do get, as expected, 1!

BUT when I try to scan the m phase space ‘binning’ the m_min - m_max range in serveral bins I run into several problems… I have binned the distribution in 18 bins. BUT in the first 6 bins the integral is wrong… The value I get is nonsensical (~10^9) and the ‘error messages’ i see are:

[#0] ERROR:Integration – RooAdaptiveGaussKronrodIntegrator1D::integral() ERROR: maximum number of subdivisions reached

[#1] INFO:NumericIntegration – RooRealIntegral::init(pdf_phys_bkg_beta_Int[#beta|rangeInt50]*Norm[#beta]) using numeric integrator RooAdaptiveGaussKronrodIntegrator1D to calculate Int(#beta)
[#1] INFO:NumericIntegration – RooRealIntegral::init(pdf_phys_bkg_mass_ext_Int[m*{#mu#mu}|rangeInt50]

*Norm[m*{#mu#mu}]) using numeric integrator RooAdaptiveGaussKronrodIntegrator1D to calculate Int(m_{#mu#mu})

[#1] INFO:NumericIntegration – RooRealIntegral::init(bf_bkg_conv_Int[#beta|rangeInt50]_Norm[#beta]) using numeric integrator RooAdaptiveGaussKronrodIntegrator1D to calculate Int(#beta)

What puzzles me is that the integrals that RooRealIntegral refers to are ‘1D’ integrals, instead of being 2D…

While in the remaining 12 bin everything works just fine (the integral has some meaningful values) BUT I still see some DIFFERENT error messages:

[#0] ERROR:InputArguments – RooAddPdf::getAnalyticalIntegral(pdf_fit) WARNING: component PDF cpdf_Bkg advertises inconsistent set of integrals (e.g. (X,Y) but not X or Y individually. Distributed analytical integration disabled. Please fix PDF

[#1] INFO:NumericIntegration – RooRealIntegral::init(pdf_fit_Int[#beta,m_{#mu#mu}|rangeInt60]*Norm[#beta,m*{#mu#mu}]) using numeric integrator RooAdaptiveIntegratorND to calculate Int(#beta,m_{#mu#mu})

This time, however, the RooRalIntegral message speaks about a 2D integral (and this sounds good to me)!

The ranges [from range00 to range 180] are buil EXACTLY in the same way:

sprintf(rnm,“rangeInt%d0”,im);

m->setRange(rnm,m_min,m_max);

b->setRange(rnm,b_min,b_max);

Any hint on how to debug that would be REALLY appreciated… I do not have the slightest clue on what can cause that and how to debug this problem…

Thanks,

alessio