Hi
I found some difficulties in the behaviour of FindFixBin()
It seems that if you ask in which bin falls the abscissa that is exacly on the bin edge it returns the previous bin
but it looks inconsistent with the implementation
root.cern.ch/root/htmldoc/src/TA … tml#GhiOLB
at line 256
but in other cased it doesn’t
I wrote this small macro to explain my problem:
{
TH1F* h1 = new TH1F("h1","h1",49,0.,4.9);
int bin = h1->GetXaxis()->FindFixBin(1.9);
cout << bin << " " << endl;
TH1F* h2 = new TH1F("h2","h2",49,0.,49.);
int bin2 = h2->GetXaxis()->FindFixBin(19);
cout << bin2 << " " << endl;
}
there are 2 histograms with 49 bins; the first between 0 and 4.9 and the second between 0 and 49.
I expect that the value 1.9 in the first histogram and the value 19
in the second fall in the same bin, but to output of my macro is
19
20
for h1 the value 1.9 is in the previuos bin
and for h2 19 is in following bin
what am I missing?
delo