Analytical integration of RooHistPdf in subrange

Dear experts,
I am using roofit to plot the -log likelihood scan after a template fit using two RooHistPdf’s for signal and background. The coefficients of the total fit pdf are interpreted over a subrange of the full fit range. As a consequence when doing the likelihood scan, the integral of the pdf is computed in the subrange and the current implementation of RooHistPdf calls the numerical integration routine

[#1] INFO:NumericIntegration – RooRealIntegral::init(sighistpdf_Int[isolation|sigrange]_Norm[isolation]) using numeric integrator RooIntegrator1D to calculate Int(isolation)
[#1] INFO:NumericIntegration – RooRealIntegral::init(bkghistpdf_Int[isolation|sigrange]_Norm[isolation]) using numeric integrator RooIntegrator1D to calculate Int(isolation)

This translates into a very long time for making such a plot (while it’s almost zero seconds with pdfs that have analytical integrals).
Wouldn’t it be possible to implement analytical integrals for subranges of roohistpdfs summing up the bin contents scaled by the fraction of the volume of the bin that is inside the range?

Thanks

Giovanni

Hi Giovanni,

That’s possible, but the most general case is not trivial: when a requested integration range concides with a bin boundary in all dimensions this is easy, when this is not the case, it’s a bit more work to define the proper calculation. So its a bit of a longer term project. I filed this as a feature request in Savannah as #74320.

Wouter