Skip to content

Implement variable rebinning 2-D histogram classes (ROOT-5224) #5280

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pamputt
Copy link
Contributor

@pamputt pamputt commented Apr 2, 2020

Implement variable rebinning 2-D histogram classes (ROOT-5224)
Implemented for TProfile2D as well

  • Missing TH3 support

@pamputt pamputt requested a review from lmoneta as a code owner April 2, 2020 12:55
Copy link
Member

@hageboeck hageboeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the work! I left some small formatting comments.

I also had a rough look at the code, and didn't see obvious mistakes, but I cannot test / am not an expert.

I would either

@couet couet removed their assignment Apr 3, 2020
Copy link
Member

@lmoneta lmoneta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding this useful extension to the rebinning of the 2D histograms.

The important missing piece is a test. The best and simplest way is to add new functions in test/stressHistogram.cxx
There are two tests for 1d, testArrayRebin() and testArrayRebinProfile(), it would be needed to add similar functions for the 2D case.
See https://github.com/root-project/root/blob/master/test/stressHistogram.cxx#L8082

It would be also great if you have time to add this for the 3D case. But this could be eventually a different PR

Thank you

Lorenzo

@root-project root-project deleted a comment from phsft-bot Nov 7, 2023
@guitargeek
Copy link
Contributor

@phsft-bot build

Let's see if we can revive this PR.

@phsft-bot
Copy link

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default
How to customize builds

@phsft-bot
Copy link

Build failed on ROOT-ubuntu2204/nortcxxmod.
Running on root-ubuntu-2204-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

Copy link

github-actions bot commented Nov 7, 2023

Test Results

    17 files      17 suites   4d 7h 15m 24s ⏱️
 2 737 tests  2 736 ✅ 0 💤 1 ❌
44 947 runs  44 946 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 42f2b3f.

♻️ This comment has been updated with latest results.

@pamputt
Copy link
Contributor Author

pamputt commented Nov 8, 2023

Let's see if we can revive this PR.

Thank you for taking up this work again. I'd forgotten about it and I don't think I'll finish it myself. As far as I remember, I stopped when I was writing the test that was required. In the few cases that I tested by hand, it seemed to work but it's not at all impossible for the code to be buggy, hence the need to check it thoroughly with tests.

@guitargeek
Copy link
Contributor

No worries @pamputt, I didn't expect you to do any work here! I will take a look at this PR, and if it appears good to merge for me I will finish and merge this development myself.

@guitargeek guitargeek changed the title Patch for ROOT-5224 Implement variable rebinning 2-D histogram classes (ROOT-5224) Nov 13, 2023
@ferdymercury ferdymercury self-requested a review April 1, 2025 07:11
@@ -107,7 +107,7 @@ class TH2 : public TH1 {
TH2 *RebinX(Int_t ngroup=2, const char *newname="") override; // *MENU*
virtual TH2 *RebinY(Int_t ngroup=2, const char *newname=""); // *MENU*
TH2 *Rebin(Int_t ngroup=2, const char*newname="", const Double_t *xbins = nullptr) override; // re-implementation of the TH1 function using RebinX
virtual TH2 *Rebin2D(Int_t nxgroup=2, Int_t nygroup=2, const char *newname=""); // *MENU*
virtual TH2 *Rebin2D(Int_t nxgroup=2, Int_t nygroup=2, const char *newname="", const Double_t *xbins=nullptr, const Double_t *ybins=nullptr); // *MENU*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this signature change could potentially break derived user-classes on preexisting code that use override keyword. Maybe a separate function with no default arguments is better?

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

Successfully merging this pull request may close these issues.

7 participants