[RF] Use analytic integral in RooBinSamplingPdf when available - #22924
Open
guitargeek wants to merge 1 commit into
Open
[RF] Use analytic integral in RooBinSamplingPdf when available#22924guitargeek wants to merge 1 commit into
guitargeek wants to merge 1 commit into
Conversation
RooBinSamplingPdf integrates a continuous pdf over each bin to avoid the bias of evaluating it at the bin centre. So far this was always done with the numeric adaptive integrator, even when the wrapped pdf provides an analytic integral over the observable. Now integrate() detects, lazily and once, whether the wrapped pdf can integrate the observable analytically (getAnalyticalIntegralWN). If so, it uses the exact integral per bin via a private named range, which is both faster and more accurate; otherwise it falls back to the numeric integrator as before. The analytic branch is only taken for RooRealVar observables, since selecting the bin boundaries requires setRange(). The analytic result is normalized over the same normSet via analyticalIntegralWN() to match the numeric path, which integrates the value returned by operator() (i.e. the pdf value normalized over normSet). Addresses one item of root-project#6557. 🤖 Done with the help of AI.
Test Results 23 files 23 suites 3d 20h 10m 33s ⏱️ For more details on these failures, see this check. Results for commit a243be6. |
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.
RooBinSamplingPdf integrates a continuous pdf over each bin to avoid the bias of evaluating it at the bin centre. So far this was always done with the numeric adaptive integrator, even when the wrapped pdf provides an analytic integral over the observable.
Now integrate() detects, lazily and once, whether the wrapped pdf can integrate the observable analytically (getAnalyticalIntegralWN). If so, it uses the exact integral per bin via a private named range, which is both faster and more accurate; otherwise it falls back to the numeric integrator as before. The analytic branch is only taken for RooRealVar observables, since selecting the bin boundaries requires setRange().
The analytic result is normalized over the same normSet via analyticalIntegralWN() to match the numeric path, which integrates the value returned by operator() (i.e. the pdf value normalized over normSet).
Addresses one item of #6557.
🤖 Done with the help of AI.