Skip to content

[v624][RF] Handle nullptr or empty norm set ambiguity in RooAbsReal::getVal#8372

Merged
guitargeek merged 2 commits intoroot-project:v6-24-00-patchesfrom
guitargeek:v6-24-00-patches_issue-8307
Jun 8, 2021
Merged

[v624][RF] Handle nullptr or empty norm set ambiguity in RooAbsReal::getVal#8372
guitargeek merged 2 commits intoroot-project:v6-24-00-patchesfrom
guitargeek:v6-24-00-patches_issue-8307

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

Backport of #8364.

The downsteam code, -- like RooAddPdf::getValV for example -- assume
that a nullptr is passed when no normalization is requested. The case of
an empty norm set is not handled correctly in RooAddPdf::getValV,
leading to wrong results.

However, some calling code passes an empty norm set to
RooAbsReal::getVal instead of a nullptr in an attempt to disable
normalization.

This commit suggests to solve this ambiguity at the highest possible
level: right at the beginning of RooAbsReal::getVal. If the
normalization set is empty, the pointer pointing to it will be set to
nullptr.

This fixes issue #8307.

To give some context: the code in RooAddPdf that doesn't handle the ambiguity correctly was introduced in f6d1543, which was also backported to 6.24. Hence, a backport to 6.24 is necessary also for this PR.

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@guitargeek guitargeek linked an issue Jun 8, 2021 that may be closed by this pull request
The downsteam code, -- like RooAddPdf::getValV for example -- assume
that a nullptr is passed when no normalization is requested. The case of
an empty norm set is not handled correctly in RooAddPdf::getValV,
leading to wrong results.

However, some calling code passes an empty norm set to
RooAbsReal::getVal instead of a `nullptr` in an attempt to disable
normalization.

This commit suggests to solve this ambiguity at the highest possible
level: right at the beginning of RooAbsReal::getVal. If the
normalization set is empty, the pointer pointing to it will be set to
`nullptr`.

This fixes issue root-project#8307.
@phsft-bot
Copy link
Copy Markdown

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2021-06-08T18:53:03.097Z] ./etc\dictpch\allHeaders.h:1251:10: fatal error: 'C:/build/workspace/root-pullrequests-build/build/include' file not found

@guitargeek guitargeek merged commit 6fd928f into root-project:v6-24-00-patches Jun 8, 2021
@guitargeek guitargeek deleted the v6-24-00-patches_issue-8307 branch July 12, 2021 17:44
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] Issue with RooSimultaneous in 6.24.00 ?

2 participants