# Normalising a histogram directly

**URL:** <https://root-forum.cern.ch/t/normalising-a-histogram-directly/37614>\
**Category:** Newbie\
**Created:** [January 17, 2020, 1:31pm UTC](https://root-forum.cern.ch/t/normalising-a-histogram-directly/37614 "2020-01-17T13:31:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akash116](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/akash116/32/20420_2.png) [@Akash116](https://root-forum.cern.ch/u/Akash116)\
**Post date:** [January 17, 2020, 1:31pm UTC](https://root-forum.cern.ch/t/normalising-a-histogram-directly/37614/1 "2020-01-17T13:31:19Z")

</div>

Hi  
I’ve been searching for a ways to normalize a histogram, however none of them are direct to normalize the data. However there exists a function DrawNormalized which plots normalized data. Shouldn’t we be able to extract normalized data from here directly? If yes, how can I do it?\_\_\_  
_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_

_ROOT Version:_ 6.18  
_Platform:_ Windows  
_Compiler:_ Not Provided

* * *

---

<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, 2020, 1:59pm UTC](https://root-forum.cern.ch/t/normalising-a-histogram-directly/37614/2 "2020-01-17T13:59:55Z")

</div>

> [@Different ways of normalizing histograms](https://root-forum.cern.ch/t/different-ways-of-normalizing-histograms/15582):
>
> Hi everyone, I’m a new user of both ROOT and RootTalk so please pardon my ignorance. I’ve been trying to normalize several histograms, and when I search in RootTalk, a multitude of ways comes up. How do I know which one is “right”? What is the difference between the following methods? Here are the 4 methods I tried: Method 1: Double\_t num = h-\>GetBinContent(i); Double\_t den = h-\>GetBinWidth(i); Double\_t value = 0; if (den!=0) { value = num/den; h-\>SetBinContent(i,value); } Met…
