[RF] Don't normalize over non-dependents when compiling RooFormulaVar#20772
Merged
guitargeek merged 3 commits intoroot-project:masterfrom Dec 24, 2025
Merged
[RF] Don't normalize over non-dependents when compiling RooFormulaVar#20772guitargeek merged 3 commits intoroot-project:masterfrom
guitargeek merged 3 commits intoroot-project:masterfrom
Conversation
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.
7f16ca9 to
f2932cb
Compare
This is done to fix clang-format failures in the CI.
f2932cb to
17c59ef
Compare
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.
17c59ef to
8836cc5
Compare
Test Results 22 files 22 suites 4d 1h 46m 48s ⏱️ For more details on these failures, see this check. Results for commit 8836cc5. ♻️ This comment has been updated with latest results. |
dpiparo
approved these changes
Dec 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.