# Integrate function for histograms

**URL:** <https://root-forum.cern.ch/t/integrate-function-for-histograms/31785>\
**Category:** Newbie\
**Created:** [November 27, 2018, 2:52pm UTC](https://root-forum.cern.ch/t/integrate-function-for-histograms/31785 "2018-11-27T14:52:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoekMeijers](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ad7895/32.png) [@LoekMeijers](https://root-forum.cern.ch/u/LoekMeijers)\
**Post date:** [November 27, 2018, 2:52pm UTC](https://root-forum.cern.ch/t/integrate-function-for-histograms/31785/1 "2018-11-27T14:52:19Z")

</div>

Hi all,

A quick question: say I have defined and filled a histogram called h1. What happens if I use  
h1-\>Integrate(0,10). Do I get the integral of the contents of bin 1 to bin 10, or do I get the integral from histogram range 0 to 10?

Best regards,

Loek

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [November 27, 2018, 3:33pm UTC](https://root-forum.cern.ch/t/integrate-function-for-histograms/31785/2 "2018-11-27T15:33:36Z")

</div>

I guess you mean “Integral” … not “integrate”. [Looking at the reference guide](https://root.cern/doc/master/classTH1.html#aaf053a4b487c46b9e20c0bf534b34012) you will see that it takes bins’ numbers as parameters.

---

<div class="post-metadata">

**Author:** ![LoekMeijers](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ad7895/32.png) [@LoekMeijers](https://root-forum.cern.ch/u/LoekMeijers)\
**Post date:** [December 4, 2018, 12:39pm UTC](https://root-forum.cern.ch/t/integrate-function-for-histograms/31785/3 "2018-12-04T12:39:29Z")

</div>

Thanks a lot. For some reason I wasn’t able to find this.
