Skip to content

[RF] Use analytic integral in RooBinSamplingPdf when available - #22924

Open
guitargeek wants to merge 1 commit into
root-project:masterfrom
guitargeek:binsamplingpdf_integral
Open

[RF] Use analytic integral in RooBinSamplingPdf when available#22924
guitargeek wants to merge 1 commit into
root-project:masterfrom
guitargeek:binsamplingpdf_integral

Conversation

@guitargeek

Copy link
Copy Markdown
Contributor

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.

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.
@github-actions

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 20h 10m 33s ⏱️
 3 877 tests  3 876 ✅ 0 💤 1 ❌
79 862 runs  79 861 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit a243be6.

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