# How to integrate TH2 correctly?

**URL:** <https://root-forum.cern.ch/t/how-to-integrate-th2-correctly/9582>\
**Category:** ROOT\
**Created:** [February 2, 2010, 2:00pm UTC](https://root-forum.cern.ch/t/how-to-integrate-th2-correctly/9582 "2010-02-02T14:00:02Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![thart](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/f1d935/32.png) [@thart](https://root-forum.cern.ch/u/thart)\
**Post date:** [February 2, 2010, 2:00pm UTC](https://root-forum.cern.ch/t/how-to-integrate-th2-correctly/9582/1 "2010-02-02T14:00:02Z")

</div>

Hi,

I want to integrate bins in a subrange of a TH2D histogram but I fail with the syntax of Integral()

For example, how would I integrate a a rectangular subrange in (x\_min,y\_min) & (x\_max,y\_max)?  
Following the Integral() definitions

```auto

```

I thought that it would work with

```auto

```

But ROOT computes the integral value for my test histogram as 0 although the histogram is definitely not empty…

Maybe somebody could help me with the correct syntax?

Cheers & Thanks,  
Thomas

---

_[View the full topic](https://root-forum.cern.ch/t/how-to-integrate-th2-correctly/9582)._
