Skip to content

[hist][math] Allow multiple ranges in HFitInterface::FillData - #22861

Open
guitargeek wants to merge 1 commit into
root-project:masterfrom
guitargeek:multiple_ranges
Open

guitargeek wants to merge 1 commit into
root-project:masterfrom
guitargeek:multiple_ranges

Conversation

@guitargeek

Copy link
Copy Markdown
Contributor

ROOT::Fit::FillData only honoured the first range interval of each coordinate and warned that "support only one range interval" for any further one. Fitting a single function over several disjoint regions (e.g. a background with the peak region excluded) was therefore not possible.

Collect the bins by looping over every combination of the per-coordinate ranges. A coordinate without any range contributes a single iteration spanning the full axis, so the behaviour without ranges is unchanged.

DataRange::CleanRangeSet() now also merges partially overlapping ranges instead of only dropping fully contained ones, so that AddRange() keeps the range set a collection of disjoint intervals. It takes xmin and xmax by reference to widen them to the merged interval.

Adds unit tests for the overlapping-range handling in DataRange and for the range handling of FillData itself.

Successor PR of #10101

@guitargeek

Copy link
Copy Markdown
Contributor Author

FYI @belmakier.

@github-actions

github-actions Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 17h 21m 7s ⏱️
 3 858 tests  3 858 ✅ 0 💤 0 ❌
78 588 runs  78 588 ✅ 0 💤 0 ❌

Results for commit 05928fd.

♻️ This comment has been updated with latest results.

ROOT::Fit::FillData only honoured the first range interval of each
coordinate and warned that "support only one range interval" for any
further one. Fitting a single function over several disjoint regions
(e.g. a background with the peak region excluded) was therefore not
possible.

Collect the bins by looping over every combination of the per-coordinate
ranges. A coordinate without any range contributes a single iteration
spanning the full axis, so the behaviour without ranges is unchanged.

DataRange::CleanRangeSet() now also merges partially overlapping ranges
instead of only dropping fully contained ones, so that AddRange() keeps
the range set a collection of disjoint intervals. It takes xmin and xmax
by reference to widen them to the merged interval.

Adds unit tests for the overlapping-range handling in DataRange and for
the range handling of FillData itself.

This branch has not been deployed

No deployments
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.

2 participants