TH1 and strange BinWidth


I am facing a strange issue… After having created 2 histograms
I saved them in a root file (attached)

Then when I load them and I try this :

cout << h->GetXaxis()->GetBinWidth(1) << " " << h0->GetXaxis()->GetBinWidth(1) << endl;
h->GetXaxis()->GetBinWidth(1) == h0->GetXaxis()->GetBinWidth(1)

I am getting this output :

0.04 0.04

I do not understand what it going on with those histograms and what I did wrong… Some help ?

Thank you very much !
output.root (79.4 KB)

Please use :slight_smile:


root [1] test->GetXaxis()->GetBinWidth(1) - test2->GetXaxis()->GetBinWidth(1)
(const double)1.38777878078144568e-17

See also:

1 Like

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