You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[RF] Fix RooBinIntegrator for ranges cutting through integrand bins
RooBinIntegrator builds its integration grid from the integrand's
binBoundaries(xlo, xhi), which only returns the boundaries lying strictly
inside the integration range. As a result, the integrator summed only the
bins fully contained in the range and silently dropped the partial bins at
the edges, because the integration limits were never added as the outermost
bin boundaries.
For example, integrating a 5-bin RooHistPdf (edges 0,2,4,6,8,10) over the
sub-range [3,7] returned 2 instead of the correct 5.5.
Fix this by prepending xmin and appending xmax as the outermost boundaries
when they are not already present. The guard avoids zero-width bins when a
range boundary coincides with a bin edge. Each resulting sub-bin then lies
entirely within one original bin, so the midpoint rule stays exact for a
piecewise-constant histogram.
Add unit tests comparing the numeric RooBinIntegrator result against the
analytic RooHistPdf integral for several range types, in both one and two
dimensions.
Closes#22858.
🤖 Done with the help of AI.
0 commit comments