Skip to content

Conversation

@guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Dec 21, 2025

Don't normalize pdfs over non-dependents in RooFormulaVar::compileForNormSet().

This fixes use cases where pdfs that don't depend on any observables are used for their unnormalized RooAbsPdf::evaluate() shape as functions.

Even thought technically not allowed because evaluating pdfs without a normalization set is undefined, this pattern is used a lot in the wild, so we need to support it also in the new vectorizing evaluation backend.

A unit test that covers the original user-reported problem is also added.

The `depList` list is filled already with the subset of normalization
variables that the pdf depends on (see `getObservables(nset, depList)` a
few lines before. Therefore, the check `dependsOn(depList)` is
redundant and causes unnecessary performance overheads, as the whole
compute graph of the pdf has to be traversed.

We might as well check if `depList` is empty for the same logic.
This is done to fix clang-format failures in the CI.
@guitargeek guitargeek changed the title [RF] Don't normalize over non-dependents when compiling for norm. set [RF] Don't normalize over non-dependents when compiling RooFormulaVar Dec 21, 2025
Don't normalize pdfs over non-dependents in
`RooFormulaVar::compileForNormSet()`.

This fixes use cases where pdfs that don't depend on any observables are
used for their unnormalized `RooAbsPdf::evaluate()` shape as functions.

Even thought technically not allowed because evaluating pdfs without a
normalization set is undefined, this pattern is used a lot in the wild,
so we need to support it also in the new vectorizing evaluation backend.

A unit test that covers the original user-reported problem is also
added.
@github-actions
Copy link

github-actions bot commented Dec 22, 2025

Test Results

    22 files      22 suites   4d 1h 46m 48s ⏱️
 3 794 tests  3 783 ✅ 0 💤 11 ❌
80 325 runs  80 293 ✅ 0 💤 32 ❌

For more details on these failures, see this check.

Results for commit 8836cc5.

♻️ This comment has been updated with latest results.

@dpiparo dpiparo self-requested a review December 24, 2025 09:24
@guitargeek guitargeek merged commit 25f8bbd into root-project:master Dec 24, 2025
30 of 53 checks passed
@guitargeek guitargeek deleted the issue-yuho branch December 24, 2025 12:46
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