Skip to content

[RF] Consider depsAreCond parameter for conditional fits in BatchMode #11343

Merged
guitargeek merged 3 commits intoroot-project:masterfrom
guitargeek:issue-11332
Sep 20, 2022
Merged

[RF] Consider depsAreCond parameter for conditional fits in BatchMode #11343
guitargeek merged 3 commits intoroot-project:masterfrom
guitargeek:issue-11332

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

If a RooProdPdf is created with the Conditional command argument to do
a conditional fit, there is a flag depsAreCond to the command argument
that specifies if the passed variable set corresponds to the
normalization set of the conditional PDF (default), or the conditional
observables. In the new BatchMode, this flag was not considered, which
is fixed by this PR.

A new unit test that checks that the depsAreCond parameter is
correctly considered in both the BatchMode and the old RooFit is also
implemented, based on the issue reproducer code that was kindly provided
by @elusian in #11332.

This PR also merges the testRooProductPdf and testRooProdPdf
files, because they are both testing the RooProdPdf.

Closes #11332.

A secondary commit with some code improvements to the RooProdPdf class is also included in this PR.

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac1015/cxx17, mac11/cxx14, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-performance-centos8-multicore/cxx17.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-ubuntu2004/python3.
Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on mac11/cxx14.
Running on macphsft20.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@elusian
Copy link
Copy Markdown
Contributor

elusian commented Sep 10, 2022

Hello, thank you for the PR!
Just a comment, I think the comments in the test in testRooProdPdf.cxx are leftover from the original reproducer macro, as they do not match what is happening in the test

@guitargeek
Copy link
Copy Markdown
Contributor Author

Yes you're right. Thanks!

If a RooProdPdf is created with the `Conditional` command argument to do
a conditional fit, there is a flag `depsAreCond` to the command argument
that specifies if the passed variable set corresponds to the
normalization set of the conditional PDF (default), or the conditional
observables. In the new BatchMode, this flag was not considered, which
is fixed by this PR.

A new unit test that checks that the `depsAreCond` parameter is
correctly considered in both the BatchMode and the old RooFit is also
implemented, based on the issue reproducer code that was kindly provided
by @elusian in root-project#11332.

This commit also merges the `testRooProductPdf` and `testRooProdPdf`
files, because they are both testing the RooProdPdf.

Closes root-project#11332.
Improving the memory management of the RooProdPdf by using more smart
pointers.

In particular, a memory leak of the return values of the private
functions `RooProdPdf::makeCondPdfRatioCorr` is fixed.
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac1015/cxx17, mac11/cxx14, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-performance-centos8-multicore/cxx17.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on mac11/cxx14.
Running on macphsft20.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on mac1015/cxx17.
Running on macitois21.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

Copy link
Copy Markdown
Member

@lmoneta lmoneta left a comment

Choose a reason for hiding this comment

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

LGTM !
Thank you for fixing this Jonas.

I have just one comment, is this flag really needed ? I think it could cause some confusion, one should just pass the correct observable to normalise in the constructor of the RooProdPdf via the Conditional common, what is the reason to interpret them in some case in the opposite way, i.e. the depSet as conditional observable rather than normalising observables ?

@guitargeek
Copy link
Copy Markdown
Contributor Author

I don't know. Why this option exists. I agree, it is confusing. I think what we can do is to merge this PR, do the backport as a bugfix, and then only in ROOT master do a follow-up where the depsAreCond parameter is removed.

@guitargeek guitargeek merged commit 84171a5 into root-project:master Sep 20, 2022
@guitargeek guitargeek deleted the issue-11332 branch September 20, 2022 07:58
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] Batchmode ignores depsAreCond in Conditional when creating a RooProdPdf

4 participants