-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[hist] TH1::GetCumulative: fix error setting #11948
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
Conversation
|
Can one of the admins verify this patch? |
lmoneta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this fix. I agree this was a bug, great you have found it.
Just a small comment for avoid using virtual functions (TArray::SetAt) for better efficiency
hist/hist/src/TH1.cxx
Outdated
| if (fSumw2.fN) { | ||
| esum += GetBinErrorSqUnchecked(bin); | ||
| fSumw2.fArray[bin] = esum; | ||
| hintegrated->GetSumw2()->SetAt(esum, bin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is maybe shorter and more efficient to write:
hintegrated->fSumw2.fArray[bin] = esum;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! But why are these protective attributes of a non-self TH1 instance accessible here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is maybe shorter and more efficient to write:
hintegrated->fSumw2.fArray[bin] = esum;
Updated and tested.
Assign the cumulative error to the newly generated histogram instead of the original one.
f2e7c81 to
24eceeb
Compare
|
@phsft-bot build! |
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/cxx17. Errors:
Warnings:
And 130 more Failing tests:
And 7 more |
|
Build failed on ROOT-ubuntu18.04/nortcxxmod. Warnings:
And 60 more Failing tests:
|
|
Build failed on ROOT-ubuntu2004/python3. Warnings:
And 54 more Failing tests:
|
|
Build failed on mac11/cxx14. Errors:
Warnings:
And 54 more Failing tests:
And 7 more |
|
Build failed on mac12/noimt. Warnings:
And 53 more Failing tests:
|
|
Is there something I need to fix? |
lmoneta
left a comment
There was a problem hiding this 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 this fix!
This Pull request:
Changes or fixes:
This PR fixes the
TH1::GetCumulative()method by assigning the cumulative error to the newly generated histogram instead of the original one.Checklist:
This PR fixes #11947