Skip to content

Conversation

@guitargeek
Copy link
Contributor

The idea of the RooGenProdProj is that we divide two integral objects
each created with this makeIntgral() function to get the normalized
integral of a product. Therefore, we don't need to normalize the
numerater and denominator integrals themselves. Doing the normalization
would be expensive and it would cancel out anyway. However, if we don't
specify an explicit normalization integral in createIntegral(), the
last-used normalization set might be used to normalize the pdf,
resulting in redundant computations.

For this reason, the normalization set of the integrated pdfs is fixed
to an empty set in this case. Note that in RooFit, a nullptr
normalization set and an empty normalization set is not equivalent. The
former implies taking the last-used normalization set, and the latter
means explicitly no normalization.

This fixes the performance regression reported in #11814, and a new unit
test is implemented to make sure no new numeric integrals pop up in the
reproducer code to that issue.

Unfortunately, this change means that there will be again warnings about
missing RooAddPdf normalization sets, but this is not a regression
because these warnings only got fixed in the 6.28 development cycle in
290b478.

This PR also includes some other minor improvements explained in the commit descriptions.

Since the change to Asimov datasets in `testTestStatistics`, there are
warnings that tell you to explicitly set `SumW2Error()` because you are
fitting to weighted data. That's what is done in this commit.

This means the message level threshold can we changed also to not
silence warnings anymore.
In `RooAbsArg::redirectServers()`, we don't need to do anything if there
are no new servers or if the only new server is this RooAbsArg itself.
And by returning early, we avoid potentially annoying side effects of
the redirectServersHook.
The idea of the RooGenProdProj is that we divide two integral objects
each created with this makeIntgral() function to get the normalized
integral of a product. Therefore, we don't need to normalize the
numerater and denominator integrals themselves. Doing the normalization
would be expensive and it would cancel out anyway. However, if we don't
specify an explicit normalization integral in createIntegral(), the
last-used normalization set might be used to normalize the pdf,
resulting in redundant computations.

For this reason, the normalization set of the integrated pdfs is fixed
to an empty set in this case. Note that in RooFit, a nullptr
normalization set and an empty normalization set is not equivalent. The
former implies taking the last-used normalization set, and the latter
means explicitly no normalization.

This fixes the performance regression reported in root-project#11814, and a new unit
test is implemented to make sure no new numeric integrals pop up in the
reproducer code to that issue.

Unfortunately, this change means that there will be again warnings about
missing `RooAddPdf` normalization sets, but this is not a regression
because these warnings only got fixed in the 6.28 development cycle in
290b478.
@guitargeek guitargeek self-assigned this Jan 11, 2023
@phsft-bot
Copy link

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

@guitargeek
Copy link
Contributor Author

@phsft-bot build with flags -DCTEST_TEST_EXCLUDE_NONE=On

@phsft-bot
Copy link

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac12/noimt, mac11/cxx14, windows10/cxx14 with flags -DCTEST_TEST_EXCLUDE_NONE=On
How to customize builds

@phsft-bot
Copy link

Build failed on ROOT-debian10-i386/soversion.
Running on pcepsft10.dyndns.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Copy link
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.

Thank you Jonas for the fix

@guitargeek guitargeek merged commit 145737b into root-project:master Jan 11, 2023
@guitargeek guitargeek deleted the roostats_issue branch January 11, 2023 20:31
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] RooStats tutorial takes forever because of numeric integral

3 participants