Skip to content

Conversation

@guitargeek
Copy link
Contributor

Backport of #20772

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.

(cherry picked from commit c1608ac)
This is done to fix clang-format failures in the CI.

(cherry picked from commit 202843a)
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.

(cherry picked from commit 25f8bbd)
@github-actions
Copy link

Test Results

    21 files      21 suites   3d 17h 25m 29s ⏱️
 3 713 tests  3 713 ✅ 0 💤 0 ❌
76 100 runs  76 100 ✅ 0 💤 0 ❌

Results for commit 52e837a.

@guitargeek guitargeek merged commit 5ca24d1 into root-project:v6-38-00-patches Dec 24, 2025
29 of 31 checks passed
@guitargeek guitargeek deleted the bp_1 branch December 24, 2025 15:55
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.

1 participant