# Histograms underflow and overflow by code

**URL:** <https://root-forum.cern.ch/t/histograms-underflow-and-overflow-by-code/4557>\
**Category:** ROOT\
**Created:** [March 21, 2007, 9:37am UTC](https://root-forum.cern.ch/t/histograms-underflow-and-overflow-by-code/4557 "2007-03-21T09:37:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucianom](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/bcef8e/32.png) [@lucianom](https://root-forum.cern.ch/u/lucianom)\
**Post date:** [March 21, 2007, 9:37am UTC](https://root-forum.cern.ch/t/histograms-underflow-and-overflow-by-code/4557/1 "2007-03-21T09:37:50Z")

</div>

Hello,

How can I get the underflow, overflow and the total number of events for histograms, by code?

Cheers,  
Luciano

---

<div class="post-metadata">

**Author:** ![fwinkl](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/fwinkl/32/38968_2.png) [@fwinkl](https://root-forum.cern.ch/u/fwinkl)\
**Post date:** [March 21, 2007, 10:08am UTC](https://root-forum.cern.ch/t/histograms-underflow-and-overflow-by-code/4557/2 "2007-03-21T10:08:53Z")

</div>

Hi Luciano,

see [root.cern.ch/root/htmldoc/TH1.html](http://root.cern.ch/root/htmldoc/TH1.html) under “Convention for numbering bins”. You can get over/underflow bin contents just as any other bin. GetEntries() returns the total.

Frank
