Repository navigation
[hist] Honour a Z axis range in TProfile3D::GetStats - #23829
Draft
Elvand-Lie wants to merge 2 commits into
Draft
Elvand-Lie wants to merge 2 commits into
Elvand-Lie wants to merge 2 commits into
Conversation
GetStats recomputed statistics for an X or Y range but ignored a range set only on the Z axis; TH3::GetStats checks all three axes. Include the Z axis in the condition and test the selected bin's means. Assisted-by: antigravity:claude-opus-5-5 Assisted-by: codex:gpt-6.1-sol Assisted-by: claude-code:claude-opus-5-5
Include enabled overflow statistics on axes without an explicit range. Use TProfile2D's per-axis bounds so selecting Z keeps X flow entries. Test the selected sum of weights and X mean with per-histogram stat overflows. Assisted-by: codex:gpt-6.1-sol Assisted-by: claude-code:claude-opus-5-5
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull request:
Changes or fixes:
A range set only on the Z axis of a
TProfile3Dis ignored byGetMeanandGetStdDev:TProfile3D::GetStatsrecomputes the statistics from the bins in range only when the X or Y axis has a range:TH3::GetStatsalso checks the Z axis, so this change addsfZaxis.TestBit(TAxis::kAxisRange)to the condition.Taking that path for a Z range exposed a second problem. The recomputation loop never includes underflow and overflow bins, even when overflow statistics are enabled (
SetStatOverflows(TH1::kConsider)orTH1::StatOverflows(true)). With a Z range, an entry in the X underflow was then dropped. The loop now uses the per-axis bounds ofTProfile2D::GetStats: on an axis without a range, the underflow and overflow bins are included when overflow statistics are enabled.Two tests in
hist/hist/test/test_TProfile.cxx:TProfile3D.GetStatsHonoursZRange: the example above; the means are the centers of the one bin in range.TProfile3D.GetStatsHonoursStatOverflowsWithZRange: withSetStatOverflows(TH1::kConsider)and a Z range, an entry in the X underflow is still counted (sum of weights 2, X mean 0, as withTH3D).Both tests fail without the corresponding change and pass with it.
ctest -R '^gtest-hist-hist-'passes: 33 tests, 0 failures, on Linux with a minimal build.Also checked against
TH3D: every combination of X, Y and Z ranges with each overflow-statistics setting, all means and standard deviations.Not run: the full ROOT test suite, roottest, and platforms other than Linux.
Checklist:
Antigravity (Claude Opus 5.5) and Codex (gpt-6.1-sol) implemented the fix and the tests; Claude Code (Claude Opus 5.5) found the bug and validated it.