Skip to content

[RF] Generalize boundary finding for RooHistPdf and RooHistFunc#21969

Draft
guitargeek wants to merge 1 commit intoroot-project:masterfrom
guitargeek:issue-13030
Draft

[RF] Generalize boundary finding for RooHistPdf and RooHistFunc#21969
guitargeek wants to merge 1 commit intoroot-project:masterfrom
guitargeek:issue-13030

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

@guitargeek guitargeek commented Apr 20, 2026

The interface to return bin boundaries and sampling hints for plotting in RooHistPdf and RooHistFunc doesn't consider that the histogram variable might be a transformation of the variable for which the bin boundaries or plot hints are requested.

This commit improves the situation by implementing an algorithm that assumes that plot variable and histogram variable are linearly related, and numerically figures out the inverse transformation for transforming histogram bins to plot bins if needed.

If the transformation is not linear, the RooHistFunc or RooHistPdf won't be correctly plotted either, but linear transformations are very common, even explicitly via the RooLinearVar, and supporting those is already a good improvement in user experience.

Closes #13030.

The plot from the reproducer in the original issue does now look like this:

plot

The interface to return bin boundaries and sampling hints for plotting
in RooHistPdf and RooHistFunc doesn't consider that the histogram
variable might be a transformation of the variable for which the bin
boundaries or plot hints are requested.

This commit improves the situation by implementing an algorithm that
assumes that plot variable and histogram variable are linearly related,
and numerically figures out the inverse transformation for transforming
histogram bins to plot bins if needed.

If the transformation is not linear, the RooHistFunc or RooHistPdf won't
be correctly plotted either, but linear transformations are very common,
even explicitly via the `RooLinearVar`, and supporting those is already
a good improvement in user experience.

Closes root-project#13030.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

Test Results

    22 files      22 suites   3d 6h 38m 29s ⏱️
 3 833 tests  3 832 ✅  1 💤 0 ❌
75 650 runs  75 632 ✅ 18 💤 0 ❌

Results for commit 13bbfe7.

♻️ This comment has been updated with latest results.

@dpiparo dpiparo added this to the 6.40.00 milestone Apr 22, 2026
@guitargeek guitargeek marked this pull request as draft April 24, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RF] Plotting shifted RooHistPdfs doesn't go well

2 participants