Skip to content

[hist] Scale profile value statistics - #23862

Draft
Elvand-Lie wants to merge 1 commit into
root-project:masterfrom
Elvand-Lie:fix/tprofile-scale-stats
Draft

Elvand-Lie wants to merge 1 commit into
root-project:masterfrom
Elvand-Lie:fix/tprofile-scale-stats

Conversation

@Elvand-Lie

Copy link
Copy Markdown
Contributor

This Pull request:

Changes or fixes:

TProfile::Scale, TProfile2D::Scale, and TProfile3D::Scale leave the cached statistics of the profiled value unchanged. They also leave buffered fills unscaled.

TProfile p("p", "", 10, 0, 10);
p.Fill(1, 2); p.Fill(2, 4);
p.Scale(3);
// Before: bin content 12, mean 3, standard deviation 1
// After:  bin content 12, mean 9, standard deviation 3

Flush pending fills before scaling and scale the corresponding first and second moments by the factor and its square. Regression tests cover all three profile dimensions and buffered fills.

The four regression tests fail on the base and pass with the fix. The full test_TProfile executable passes (8 tests) on Linux. The full ROOT test suite and other platforms were not run.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

Codex (gpt-6.1-terra) implemented the fix and the test; Claude Code (claude-opus-5-5) found the bug.

Flush buffered fills before scaling and scale the cached value moments along with the bin contents.

Assisted-by: codex:gpt-6.1-terra
Assisted-by: claude-code:claude-opus-5-5

This branch has not been deployed

No deployments
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