# Area under histogram subtracting the background?

**URL:** <https://root-forum.cern.ch/t/area-under-histogram-subtracting-the-background/57294>\
**Category:** Newbie\
**Created:** [November 28, 2023, 1:40pm UTC](https://root-forum.cern.ch/t/area-under-histogram-subtracting-the-background/57294 "2023-11-28T13:40:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [November 28, 2023, 1:40pm UTC](https://root-forum.cern.ch/t/area-under-histogram-subtracting-the-background/57294/1 "2023-11-28T13:40:35Z")

</div>

Hello ROOT experts,

I am trying to get the area under the peak; really, a TH1F histogram from bin Xmin to bin Xmax and not count the area under the background.  
Can someone please suggest how to achieve this, or if there is some functionality to achieve this already?

Many thanks for your help!

---

<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:** [November 28, 2023, 1:47pm UTC](https://root-forum.cern.ch/t/area-under-histogram-subtracting-the-background/57294/2 "2023-11-28T13:47:47Z")

</div>

You could try searching the forum [Search results for 'area peak' - ROOT Forum](https://root-forum.cern.ch/search?q=area%20peak) and if you don’t find a proper solution maybe @moneta can give some hints

---

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [November 28, 2023, 1:55pm UTC](https://root-forum.cern.ch/t/area-under-histogram-subtracting-the-background/57294/3 "2023-11-28T13:55:20Z")

</div>

Thank You for the help.
