Skip to content

[RF] Support asymmetry plots over the RooSimultaneous index category - #22982

Open
guitargeek wants to merge 2 commits into
root-project:masterfrom
guitargeek:issue-14255
Open

[RF] Support asymmetry plots over the RooSimultaneous index category#22982
guitargeek wants to merge 2 commits into
root-project:masterfrom
guitargeek:issue-14255

Conversation

@guitargeek

@guitargeek guitargeek commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Plotting an asymmetry with respect to the index category of a RooSimultaneous, e.g.

simPdf->plotOn(frame, Asymmetry(sample), ProjWData(sample, data));

did not work: RooSimultaneous::plotOn reroutes the plotting to its component pdfs, which do not depend on the index category, so the asymmetry engine bailed out with "function doesn't depend on asymmetry category".

Naively delegating to the base-class asymmetry engine instead produced a silently wrong, flat-zero curve. That engine pins the asymmetry category with a RooCustomizer, but a RooSimultaneous compiles its per-category observables with a category prefix, which the vectorized evaluation backend (used to average the asymmetry over the projection data) cannot connect. The composite data stores backing simultaneous datasets also crash that backend.

The asymmetry of a RooSimultaneous in its index category is simply built from the two index-state component pdfs: the equal category fractions cancel in (f+ - f-) / (f+ + f-), and plain component pdfs are handled correctly by the evaluation backend. This is now done via a new virtual RooAbsReal::createAsymmetryComponent(), which RooSimultaneous overrides to return the component pdf for the requested index state. The projection dataset is flattened to a plain data store when needed.

Closes #14255.

A second commit in this PR removed some commented-out debug printouts to balance the added number of lines of code in the first commit.

🤖 Done with the help of AI.

Plotting an asymmetry with respect to the index category of a
RooSimultaneous, e.g.

   simPdf->plotOn(frame, Asymmetry(sample), ProjWData(sample, data));

did not work: RooSimultaneous::plotOn reroutes the plotting to its
component pdfs, which do not depend on the index category, so the
asymmetry engine bailed out with "function doesn't depend on asymmetry
category".

Naively delegating to the base-class asymmetry engine instead produced a
silently wrong, flat-zero curve. That engine pins the asymmetry category
with a RooCustomizer, but a RooSimultaneous compiles its per-category
observables with a category prefix, which the vectorized evaluation
backend (used to average the asymmetry over the projection data) cannot
connect. The composite data stores backing simultaneous datasets also
crash that backend.

The asymmetry of a RooSimultaneous in its index category is simply built
from the two index-state component pdfs: the equal category fractions
cancel in (f+ - f-) / (f+ + f-), and plain component pdfs are handled
correctly by the evaluation backend. This is now done via a new virtual
RooAbsReal::createAsymmetryComponent(), which RooSimultaneous overrides
to return the component pdf for the requested index state. The projection
dataset is flattened to a plain data store when needed.

Closes root-project#14255.

🤖 Done with the help of AI.
These commented-out std::cout / Print() debug statements have been dead
for years and only add noise. Removing them (and the blank lines they
left dangling) trims ~145 lines with no functional change.

🤖 Done with the help of AI.
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 16h 6m 16s ⏱️
 3 852 tests  3 851 ✅ 0 💤 1 ❌
78 483 runs  78 474 ✅ 8 💤 1 ❌

For more details on these failures, see this check.

Results for commit 7fa7dcd.

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.

[RF] Asymmetry plots with RooFit

1 participant