Skip to content

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

Merged
guitargeek merged 2 commits into
root-project:masterfrom
guitargeek:issue-8307
Jun 8, 2021
Merged

[RF] Handle nullptr or empty norm set ambiguity in RooAbsReal::getVal #8364
guitargeek merged 2 commits into
root-project:masterfrom
guitargeek:issue-8307

Conversation

@guitargeek

@guitargeek guitargeek commented Jun 7, 2021

Copy link
Copy Markdown
Contributor

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.

The backport PR to 6.24 is #8372, which first go included in 6.24.02

@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 7, 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.

@lmoneta lmoneta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fixes Jonas.
I just do not understand where was handle before the empty normalisation set ?
I don't see it in RooAbsPdf::getValV.

I think we should probably remove RooAddPdf::getValV (in the master), but this should be a separate PR

@guitargeek
guitargeek merged commit 2029dec into root-project:master Jun 8, 2021
@guitargeek
guitargeek deleted the issue-8307 branch June 8, 2021 15:16
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 ?

3 participants