Repository navigation
[hist] Fix automatic axis limits in TProfile3D - #23828
Open
Elvand-Lie wants to merge 2 commits into
Open
Elvand-Lie wants to merge 2 commits into
Elvand-Lie wants to merge 2 commits into
Conversation
BufferEmpty skipped the limits search when only Z had automatic bins. Include Z in the outer condition so buffered entries get usable bins. Test the limits, flow-bin entries and Z mean with fixed X and Y axes. Assisted-by: codex:gpt-6.1-sol Assisted-by: claude-code:claude-opus-5-5
Use TH3's per-axis limit search to avoid rebinning fixed companion axes. Retain their bin counts and limits while optimizing automatic axes. Cover automatic Z and automatic X with fixed companion axes. Assisted-by: codex:gpt-6.1-sol Assisted-by: claude-code:claude-opus-5-5
Elvand-Lie
marked this pull request as ready for review
October 31, 2026 14:05
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:
TProfile3D::BufferEmptymishandles automatic axis limits.With fixed X and Y axes and automatic Z, every entry ends up in the Z overflow:
With automatic X, the fixed Y and Z axes are rebinned as well, so they no longer have the limits the user gave.
The outer condition only looked for automatic X or Y limits. Once inside, the block took the limits of all three axes from the buffer and let
FindGoodLimitsXYZchoose new limits for every axis, fixed ones included.The fix ports the per-axis logic of
TH3::BufferEmpty:FindGoodLimitsXYZ.The buffer layout of
TProfile3D, five values per entry, is kept.Two tests in
hist/hist/test/test_TProfile.cxx:TProfile3D.BufferEmptyFindsAutomaticZLimits: automatic Z with fixed X and Y. The Z axis contains the filled values, no entry is in a Z underflow or overflow bin, the Z mean is (101 + 115 + 139) / 3, and X and Y keep their limits.TProfile3D.BufferEmptyPreservesFixedYAndZLimits: automatic X with fixed Y and Z; Y and Z keep their limits.Both tests fail on master and pass with this change.
ctest -R '^gtest-hist-hist-'passes: 33 tests, 0 failures, on Linux with a minimal build.Also checked against
TH3D: axes, labels, per-bin contents and entries for automatic, fixed, labelled and extendable axis combinations, including repeated and forcedBufferEmptycalls.Not run: the full ROOT test suite, roottest, and platforms other than Linux.
Checklist:
Codex (gpt-6.1-sol) implemented the fix and the tests; Claude Code (Claude Opus 5.5) found the bug and validated it. I reviewed the full diff and the tests.