Skip to content

[v640] Backport recent RooFit fixes to the release branch#22091

Merged
guitargeek merged 5 commits into
root-project:v6-40-00-patchesfrom
guitargeek:bp_1
Apr 29, 2026
Merged

[v640] Backport recent RooFit fixes to the release branch#22091
guitargeek merged 5 commits into
root-project:v6-40-00-patchesfrom
guitargeek:bp_1

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

No description provided.

Both classes are public now, so it's quite useful to access the
underlying `RooFit::Evaluator` from the `RooEvaluatorWrapper`, which is
the class that represents likelihoods returned by
`RooAbsPdf::createNLL()`. This is helpful for debugging.

This also means we don't have to hack into the verbose printing
(`Print("v")`) to make the Evaluator debugging printouts available.

(cherry picked from commit 311ec24)
RooProjectedPdf::compileForNormSet built the projection as a single
RooRealIntegral with a function-normalization set. That integral's
integrand evaluates the *normalized* inner pdf, hiding the normalization
integral inside `RooAbsPdf::_normMgr`. With the recent move to ADirty
for non-fundamental compute-graph nodes during minimization, the hidden
integral is forced into ADirty too (it shares fundamental variable with
the graph) and recomputes from scratch on every call by the outer
integrator. For models with deep projections like the RooStats
Feldman-Cousins tutorial, this caused a large performance regression.

This commit suggests to rewrite the projection as an explicit ratio of
two unnormalized integrals, so both integrals become sibling nodes in
the compute graph and the `RooFit::Evaluator` caches their values.

The factorization is not always safe: when the inner pdf forces
analytical integration for any of the integration observables, the pdf
is usually exploiting analytical-integration hooks for special integral
semantics (e.g. a RooProdPdf with Conditional terms) and the simple
numerator/denominator identity does not hold. Fall back to the original
code path in that case.

(cherry picked from commit 54af3a2)
These tutorials are very sensitive to problems with caching in the
computation graph because of the double integrals they contain, and it
has already happened twice that their runtime regressed to several
hours without us noticing only later in the documentation build.

Even if these tests take a minute, it's worth to keep them to make sure
these kind of regressions can't happen in the future.

Also, enable silent variable clipping, as clipping happens in these
tutorials and we don't want them to finish with an exception.

(cherry picked from commit 5770a3d)
As promised in the documentation and release notes.

(cherry picked from commit 3c112cb)
This is to be more consistent with the existing RooFit names, like
RooParamHistFunc, RooHistFunc, RooPolyFunc, RooRealSumFunc, et cetera.

(cherry picked from commit 22a7139)
@github-actions
Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 11h 28m 16s ⏱️
 3 852 tests  3 850 ✅ 0 💤 2 ❌
76 064 runs  76 062 ✅ 0 💤 2 ❌

For more details on these failures, see this check.

Results for commit 2e20467.

@guitargeek guitargeek merged commit cd805a4 into root-project:v6-40-00-patches Apr 29, 2026
28 of 33 checks passed
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