[RF] Support asymmetry plots over the RooSimultaneous index category - #22982
Open
guitargeek wants to merge 2 commits into
Open
[RF] Support asymmetry plots over the RooSimultaneous index category#22982guitargeek wants to merge 2 commits into
guitargeek wants to merge 2 commits into
Conversation
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.
1 task
Test Results 23 files 23 suites 3d 16h 6m 16s ⏱️ For more details on these failures, see this check. Results for commit 7fa7dcd. |
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.
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.