Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug where ProjectionX includes an extra bin #1

Open
wants to merge 1 commit into
base: ParticleNet_TopW_SFs_NanoV9
Choose a base branch
from

Conversation

vicha-w
Copy link

@vicha-w vicha-w commented Mar 16, 2024

Hi,

I noticed a bug where ParticleNetSF may produce one-dimensional histograms from different pT ranges that can overlap and cause double-counting.

According to this documentation, the method TH2::ProjectionX projects TH2 histograms from the first bin to the last bin, inclusive. This means if the end pT range is at the boundary of a bin, h2d->GetYaxis()->FindBin(ymax) will return the next bin and introduces extra bins to the projection.

For example, if the X axis on the 2D template is separated into 50 bins from 200 - 1200 GeV, the bins will be 20 GeV wide. Based on the original code, if we set the pT range for 1D histogram to be 300 - 400, ProjectionX will include bins 6 (300-320) to 10 (380-400) and bin 11 (400-420), which is undesired.

In this fix, I reduced the bin number so that the excess bin would not be included by the projection by accident. Should you have any questions about this PR please let me know.

Thanks!
Vichayanun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant