Skip to content

Conversation

guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Dec 2, 2024

When using the Extended() keyword argument in createHistogram() the
docs say it has the following effect:

Plot event yield instead of probability density (for extended pdfs only)

However, to get yields out of the probability densities, one has to not
only multiply with the total number of expected events, but also with
the bin volumes. I don't understand why the bin volume multiplication is
disable in exactly this case. This commit suggests to not do that
anymore, in order to be able to correctly produce predicted yields
histograms.

Thanks to the following forum post for noticing this:
https://root-forum.cern.ch/t/bin-content-of-pdf-and-generated-data/62370

This change of behavior is also mentioned in the release notes.

A unit test to validate that the yield histogram can now be correctly
created is also added.

Copy link

github-actions bot commented Dec 3, 2024

Test Results

    18 files      18 suites   4d 14h 5m 35s ⏱️
 2 715 tests  2 714 ✅ 0 💤 1 ❌
47 172 runs  47 171 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit b9f8fed.

♻️ This comment has been updated with latest results.

When using the `Extended()` keyword argument in `createHistogram()` the
docs say it has the following effect:

> Plot event yield instead of probability density (for extended pdfs only)

However, to get yields out of the probability densities, one has to not
only multiply with the total number of expected events, but also with
the bin volumes. I don't understand why the bin volume multiplication is
disable in *exactly* this case. This commit suggests to not do that
anymore, in order to be able to correctly produce predicted yields
histograms.

Thanks to the following forum post for noticing this:
https://root-forum.cern.ch/t/bin-content-of-pdf-and-generated-data/62370

This change of behavior is also mentioned in the release notes.

A unit test to validate that the yield histogram can now be correctly
created is also added.
@guitargeek guitargeek requested a review from bellenot as a code owner February 11, 2025 14:52
@guitargeek guitargeek changed the title [RF] Don't disable bin volume scaling when creating yields histogram [RF] Fix creating yield histograms from extended pdfs Feb 11, 2025
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.

LGTM!
Thank you Jonas for fixing this!

@guitargeek guitargeek merged commit 16b33f6 into root-project:master Feb 17, 2025
18 of 21 checks passed
@guitargeek guitargeek deleted the createH branch February 17, 2025 15:07
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.

2 participants