Dear experts,
I am reporting a bug in RooExtendPdf, which can be seen in rf204b_extendedLikelihood_rangedFit.C of the tutorial. In the recent versions, the fit using RooExtendPdf class has wrong best-fit values of N=4494 (and \alpha is biased as well) while the fit using the composite of signal and background PDFs implemented by RooAddPdf correctly fits the distribution with N=9990 .
Looking back into the past versions, this issue appears since version 6.28.
Best regards,
Atsushi
Hi @atsushi , thanks for your report.
The best place to report bugs is actually the GitHub issues tracker: Issues · root-project/root · GitHub
Maybe it’s best if your move your bug report there?
Thanks!
Silia
jonas
August 6, 2026, 6:55am
5
For future reference, this was fixed in the following PR:
master ← guitargeek:issue-22959
opened 09:20AM - 03 Aug 26 UTC
RooExtendPdf is self-normalized, so it delegates both the shape normalization an… d the extended-term fraction to the wrapped pdf. In a fit over a sub-range, the fit machinery sets the normalization range only on the outer RooExtendPdf; it was never propagated to the wrapped pdf. As a result the wrapped pdf stayed normalized over the full range, which collapsed the fitted yield N to the number of events in the fit range (instead of reinterpreting it to the range requested in the constructor) and biased the shape parameters.
This regressed with the multi-range fit rework in https://github.com/root-project/root/commit fa10523706087d2d46214dcafa2bec3ca2eac789 (v6.28), and is visible in the rf204b_extendedLikelihood_rangedFit tutorial, where the RooExtendPdf fit disagreed with the equivalent RooAddPdf fit.
Propagate the normalization range to the wrapped pdf during graph compilation, mirroring what RooAddPdf does for its components. This is gated on likelihood mode: for a binned chi2 the per-bin predictions must stay normalized over the full range so that the chi2 remains additive across sub-ranges.
Closes https://github.com/root-project/root/issues/22959.
🤖 Done with the help of AI.
A second commit fixes up minor issues with the comments in the related tutorial.
Note that this doesn't fix the old `"legacy"` NLL evaluation backend, but this is on its way out anyway.