# Make TH1::GetCumulative account for underflows and overflows

**URL:** <https://root-forum.cern.ch/t/make-th1-getcumulative-account-for-underflows-and-overflows/39836>\
**Category:** Evolution Proposals, Apps & Ideas\
**Tags:** hist\
**Created:** [June 8, 2020, 5:33pm UTC](https://root-forum.cern.ch/t/make-th1-getcumulative-account-for-underflows-and-overflows/39836 "2020-06-08T17:33:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yus](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/9fc348/32.png) [@yus](https://root-forum.cern.ch/u/yus)\
**Post date:** [June 8, 2020, 5:33pm UTC](https://root-forum.cern.ch/t/make-th1-getcumulative-account-for-underflows-and-overflows/39836/1 "2020-06-08T17:33:21Z")

</div>

Hi,

I couldn’t help but notice that [TH1::GetCumulative](https://root.cern.ch/doc/v620/TH1_8cxx_source.html#l02547) does not account for either underflows or overflows. Wouldn’t it be wiser to do so? Or, even better, to let a user decide if he/she wants to have the underflow/overflow bins to be accounted for?

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [June 8, 2020, 5:46pm UTC](https://root-forum.cern.ch/t/make-th1-getcumulative-account-for-underflows-and-overflows/39836/2 "2020-06-08T17:46:21Z")

</div>

Maybe @moneta can comment on this

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [June 8, 2020, 9:35pm UTC](https://root-forum.cern.ch/t/make-th1-getcumulative-account-for-underflows-and-overflows/39836/3 "2020-06-08T21:35:13Z")

</div>

Hi,  
It should probably use the axis range as many similar functions do. Can you please open a JIRA item for this ? Thank you

Lorenzo

---

<div class="post-metadata">

**Author:** ![yus](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/9fc348/32.png) [@yus](https://root-forum.cern.ch/u/yus)\
**Post date:** [June 9, 2020, 10:29am UTC](https://root-forum.cern.ch/t/make-th1-getcumulative-account-for-underflows-and-overflows/39836/4 "2020-06-09T10:29:56Z")

</div>

Hi Lorenzo,

done: [https://sft.its.cern.ch/jira/browse/ROOT-10832](https://sft.its.cern.ch/jira/browse/ROOT-10832)

Thanks!

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [June 9, 2020, 12:07pm UTC](https://root-forum.cern.ch/t/make-th1-getcumulative-account-for-underflows-and-overflows/39836/5 "2020-06-09T12:07:35Z")

</div>

Thank you !

---

<div class="post-metadata">

**Author:** ![Goyette](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/g/c4cdca/32.png) [@Goyette](https://root-forum.cern.ch/u/Goyette)\
**Post date:** [September 21, 2021, 8:09am UTC](https://root-forum.cern.ch/t/make-th1-getcumulative-account-for-underflows-and-overflows/39836/6 "2021-09-21T08:09:43Z")

</div>

Did you have a fix on this issue? I am facing the same issue last time. But no response from anyone and couldn’t find the topic troubleshooting in google.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [September 21, 2021, 8:14am UTC](https://root-forum.cern.ch/t/make-th1-getcumulative-account-for-underflows-and-overflows/39836/7 "2021-09-21T08:14:45Z")

</div>

See [this commit](https://github.com/root-project/root/commit/4ad3fe70fda3fa68d86c76dc0c8ca993a36e9d2f)
