Skip to content

[RF] Make RooMultiPdf::generate() error out when the index is requested - #22990

Open
guitargeek wants to merge 1 commit into
root-project:masterfrom
guitargeek:roomultipdf-generate-index-error
Open

[RF] Make RooMultiPdf::generate() error out when the index is requested#22990
guitargeek wants to merge 1 commit into
root-project:masterfrom
guitargeek:roomultipdf-generate-index-error

Conversation

@guitargeek

Copy link
Copy Markdown
Contributor

The index category of a RooMultiPdf selects between alternative hypotheses for the observables (as used in the discrete profiling method), unlike the index category of a RooSimultaneous, which is a genuine observable that partitions the data. Component yields express "expected count if hypothesis k were true", not partition sizes, so there is no well-defined prior probability over the index that could be used to sample it, and the previous fallback to the generic accept-reject generator produced an arbitrary, unintended ~uniform split over hypotheses.

Add a RooMultiPdf::genContext() override that throws if the index category is among the requested generation variables, and points users at fixing the index (e.g. via RooCategory::setIndex()) and generating from the resulting single-component pdf instead, which is also how the discrete profiling method is actually used in practice.

Closes #22916.

The index category of a RooMultiPdf selects between alternative
hypotheses for the observables (as used in the discrete profiling
method), unlike the index category of a RooSimultaneous, which is a
genuine observable that partitions the data. Component yields express
"expected count if hypothesis k were true", not partition sizes, so
there is no well-defined prior probability over the index that could
be used to sample it, and the previous fallback to the generic
accept-reject generator produced an arbitrary, unintended ~uniform
split over hypotheses.

Add a RooMultiPdf::genContext() override that throws if the index
category is among the requested generation variables, and points
users at fixing the index (e.g. via RooCategory::setIndex()) and
generating from the resulting single-component pdf instead, which is
also how the discrete profiling method is actually used in practice.

Closes root-project#22916.
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 13h 58m 9s ⏱️
 3 856 tests  3 855 ✅ 0 💤 1 ❌
78 544 runs  78 542 ✅ 1 💤 1 ❌

For more details on these failures, see this check.

Results for commit 970f0ff.

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] RooMultiPdf does not respect extended PDF yields for category sampling

1 participant