# Bin width in TH1::GetCumulative

**URL:** <https://root-forum.cern.ch/t/bin-width-in-th1-getcumulative/43136>\
**Category:** Evolution Proposals, Apps & Ideas\
**Created:** [January 17, 2021, 10:56pm UTC](https://root-forum.cern.ch/t/bin-width-in-th1-getcumulative/43136 "2021-01-17T22:56:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![claesse](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/claesse/32/24600_2.png) [@claesse](https://root-forum.cern.ch/u/claesse)\
**Post date:** [January 17, 2021, 10:56pm UTC](https://root-forum.cern.ch/t/bin-width-in-th1-getcumulative/43136/1 "2021-01-17T22:56:27Z")

</div>

Hello everyone,  
it seems to me there is no way to make [TH1::GetCumulative](https://root.cern.ch/doc/v620/TH1_8cxx_source.html#l02547) account for bin width, in a way similar to what [TH1::Integral](https://root.cern.ch/doc/master/TH1_8cxx_source.html#l07830) can do when the option “width” is specified. Maybe an equivalent option would be helpful.  
Accounting for bin width would make the cumulative equal to the mathematical integral of the function represented in the original histogram, this is useful when dealing with normalized quantities, like probability density functions.

---

<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:** [January 17, 2021, 11:07pm UTC](https://root-forum.cern.ch/t/bin-width-in-th1-getcumulative/43136/2 "2021-01-17T23:07:22Z")

</div>

For the time being, you could try:

```cpp
TH1 *h_tmp = ((TH1*)(h_original->Clone()));
h_tmp->Scale(1., "width");
TH1 *h_cumulative = h_tmp->GetCumulative(...);
delete h_tmp; // no longer needed

```
