Histogram axes limits discrepancy warning/error

Hi ROOTers,

I am facing (also my colleague) a problem with HIstogram manipulation.

First one

float xbins_eta[] = {0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.7, 2.37} } ;
const int xbinnum_eta = sizeof(xbins_eta)/sizeof(Float_t) - 1 ;

TH1F *hist_eta =definevar1dHistogram("", xbinnum_eta, xbins_eta, “Particle-level |#eta(#gamma)|”, kBlue);

and the other one using python config this way

Region: ph_eta
Binning: 0,0.2,0.4,0.6,0.8,1.0,1.2,1.7,2.37
Type: Validation
Variable: fabs(ph_eta),8,0,2.37
VariableTitle: “#{#eta(#gamma)}”
Ymax: 1000

but when I add them or divide, I get this error (warning), “Dividing histograms with different axis limits”

but in plotting I see same starting and ending limit on the x-axis for both plots

Please note when I use integer binning, I do not see this warning. Is it something related to some root release ? I have check both lxplus6 and 7 for this. Nothing helping.

Can anyone please provide any lead ?

Cheers,
Binish


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


@moneta can you please take a look?

Oksana.

Thank you for helping in getting the solution. But I did not see any reply from him. Shall I remind again ?

Hi,

I suspect the binning of the two histograms is not exactly the same and there is maybe a small difference due to numerical error.
I would not use a float array to define the bins but a double one to have better precision.

double xbins_eta[] = {0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.7, 2.37}; 

If you still having the issue after using consistently double precision, can you try using a recent ROOT version (e.g. ROOT 6.20 or 6.22) and then maybe post the two histogram in a ROOT file so I can investigate it further

Cheers

Lorenzo

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