Issue reading bin contents from one TProfile2D but not the other

Hello,

I have a reproducible issue regarding getting the bin contents from a TProfile2D. I have nearly Identical code which successfully gets and couts the bin contents from an identically constructed TProfile2D, except for its binned values. In short the software says the histogram is empty but this cannot be the case as a TBrowser can show it is not empty and drawing it in the Browser does not yield an empty histogram.

I have included the shortest possible working code to reproduce this problem, the only thing you must do is change the root file paths, please. I’d like help figuring out what I’m doing wrong as I should be able to read the values from the histogram using the same code that works on an identically constructed histogram.

Example of problem.zip (176.7 KB)

Thank you for your help and I assure you the problem will become apparent after looking at the pngs/root files and then running the code as it is set up with debugging code already.

For clarification, while reading the code, the Y_even does not output values when accessed.


ROOT Version: 6.12/07
Platform: linux
Compiler: Not Provided


Do NOT (re)create “Even_Y” nor “Odd_X” histograms in your “test.C” macro (i.e. no “new TProfile2D”).
Simply define the pointers only:
TProfile2D *Even_Y, *Odd_X;

Awesome! This fixed my issue. Thank you Wile_E_Coyote!

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