TH1F : overflow in bin content?

Hi rooter,
I fill a TH1F by the Fill(x) function. I know how many counts I should have in a given bin, but when drawing the histogram (and doing h->GetBinContent(i)) the number of counts in that bin are 1.677e7, while they should be ~6e7. Is 1.677e7 the maximum content of a bin in TH1F?
I’m using ROOT 6.15
Thank you for your help
Cheers
Paola

Use TH1D.

1 Like

Thank you.
But is there an overflow also in the bin content of a TH1D? Where can I find this information?
Thank you very much
Paola

TH1

I’m sorry, but it says that the content of each bin is a float, and the max for a float type, if I’m not wrong, is 3.4e38, while the maximum that I get is 1.67e7. There is something that I’m missing
Thank you very much
Paola

It also says “Maximum precision 7 digits” (when you reach it, “value + 1 == value”, so your bin is not “incremented” any more).

Oh I got it!!! Thank you very much and sorry for the silly question
Cheers
Paola

If you a dealing a lot with such a large number of events, you can put

Hist.Precision.1D: double
Hist.Precision.2D: double
Hist.Precision.3D: double

in your .rootrc file. Then a double click in a TBrowser window and the tree->Draw("variable") command will create TH1D/TH2D by default.

1 Like

Thank you very much! This is a very good hint and I didn’t know it!