# TH1F : overflow in bin content?

**URL:** <https://root-forum.cern.ch/t/th1f-overflow-in-bin-content/33252>\
**Category:** Newbie\
**Created:** [March 20, 2019, 5:17pm UTC](https://root-forum.cern.ch/t/th1f-overflow-in-bin-content/33252 "2019-03-20T17:17:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![marini](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/f17d59/32.png) [@marini](https://root-forum.cern.ch/u/marini)\
**Post date:** [March 20, 2019, 5:17pm UTC](https://root-forum.cern.ch/t/th1f-overflow-in-bin-content/33252/1 "2019-03-20T17:17:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [March 20, 2019, 5:21pm UTC](https://root-forum.cern.ch/t/th1f-overflow-in-bin-content/33252/2 "2019-03-20T17:21:17Z")

</div>

Use [TH1D](https://root.cern.ch/doc/master/classTH1D.html).

---

<div class="post-metadata">

**Author:** ![marini](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/f17d59/32.png) [@marini](https://root-forum.cern.ch/u/marini)\
**Post date:** [March 20, 2019, 5:22pm UTC](https://root-forum.cern.ch/t/th1f-overflow-in-bin-content/33252/3 "2019-03-20T17:22:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [March 20, 2019, 5:24pm UTC](https://root-forum.cern.ch/t/th1f-overflow-in-bin-content/33252/4 "2019-03-20T17:24:33Z")

</div>

[TH1](https://root.cern.ch/doc/master/classTH1.html)

---

<div class="post-metadata">

**Author:** ![marini](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/f17d59/32.png) [@marini](https://root-forum.cern.ch/u/marini)\
**Post date:** [March 20, 2019, 5:27pm UTC](https://root-forum.cern.ch/t/th1f-overflow-in-bin-content/33252/5 "2019-03-20T17:27:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [March 20, 2019, 5:31pm UTC](https://root-forum.cern.ch/t/th1f-overflow-in-bin-content/33252/6 "2019-03-20T17:31:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![marini](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/f17d59/32.png) [@marini](https://root-forum.cern.ch/u/marini)\
**Post date:** [March 20, 2019, 5:32pm UTC](https://root-forum.cern.ch/t/th1f-overflow-in-bin-content/33252/7 "2019-03-20T17:32:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![behrenhoff](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/behrenhoff/32/12285_2.png) [@behrenhoff](https://root-forum.cern.ch/u/behrenhoff)\
**Post date:** [March 21, 2019, 8:36am UTC](https://root-forum.cern.ch/t/th1f-overflow-in-bin-content/33252/8 "2019-03-21T08:36:32Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![marini](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/f17d59/32.png) [@marini](https://root-forum.cern.ch/u/marini)\
**Post date:** [March 21, 2019, 8:48am UTC](https://root-forum.cern.ch/t/th1f-overflow-in-bin-content/33252/9 "2019-03-21T08:48:33Z")

</div>

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