Problem with rebinning TProfile3D


I’m having a problem with using rebinned TProfile3D’s. After rebinning, attempting to draw throws a bad_alloc and GetBinContent returns 0 for every bin. This happens when using the Rebin3D method as well as RebinX, RebinY, and RebinZ methods. What am I missing here?

ROOT Version: 6.08/07

@couet can you help here please?

I’m afraid a “reproducer” is needed (i.e. a macro which shows this behaviour).

Yes as Wile said we need something showing the problem. A small reproducer (macro) we can run. Can you also tell on which kind of platform you are running ?

Hi, sorry for the slow repsonse.

I’ve added links to a root file containing the TProfile3D giving me problems as well as a macro demonstrating that causes the issue.

The platform information is:
Linux 2.6.32-696.28.1.el6.x86_64 #1 SMP Wed May 9 23:09:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

It looks like your data are corrupted:

$ root
  | Welcome to ROOT 6.15/01              |
  |                                      (c) 1995-2018, The ROOT Team |
  | Built for macosx64                                                |
  | From heads/master@v6-13-04-293-g3caef8b56a, Jun 07 2018, 11:46:06 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'        |

root [0]   TFile *fin= new TFile("rebin.root");
root [1] 
root [1]   TProfile3D *prof = (TProfile3D*) fin->Get("p_offOverA_etaVsTnpusVsJetPt");
root [2]   TProfile3D *clone = (TProfile3D*) prof->Clone();
root [3]   clone->RebinY(5);
root [4] clone->Print()
TH1.Print Name  = p_offOverA_etaVsTnpusVsJetPt, Entries= 87335325, Total sum= -inf
root [5] 

see the -inf … that’s not a good sign

We are fixing the -inf bins problem now. The macro that produced this was actually filling those values.

But we didn’t expect that the infinite bin contents would cause a crash like this. I didn’t mention it before, but using RebinY(10) instead of RebinY(5) doesn’t lead to a crash, which makes me think it’s something more subtle than corrupted data.

This standalone macro shows unintuitive behavior of the rebinning method in a TProfile3D. Even the average of the bins in a row changes with rebinning. Am I misunderstanding what the Rebin methods are supposed to do or is this a bug?

rebin.cpp (1.2 KB)

I think @moneta I can ell you with this question.

This looks like a bug to me. The bins in the rebinned histogram don’t match what is expected from the histogram before rebinning. Can someone please comment on the simple standalone macro above, and decide if this is a ROOT bug or an implementation error ? I don’t @moneta or anybody commented on this. Thanks in advance.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.