# THStack normalization

**URL:** <https://root-forum.cern.ch/t/thstack-normalization/39928>\
**Category:** ROOT\
**Tags:** hist\
**Created:** [June 16, 2020, 1:50am UTC](https://root-forum.cern.ch/t/thstack-normalization/39928 "2020-06-16T01:50:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yassine](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/yassine/32/34003_2.png) [@yassine](https://root-forum.cern.ch/u/yassine)\
**Post date:** [June 16, 2020, 1:50am UTC](https://root-forum.cern.ch/t/thstack-normalization/39928/1 "2020-06-16T01:50:33Z")

</div>

Dear ROOTERS,

I would like to know if there’s a different way to normalize histograms after I added them in THStack ?

PS: I already Knew normalizing each one separately and then add a copy of them using this method h-\>Scale(1/h-\>Integral(),“width”).

another question: Is there any method like SetLineWidth() for THStack ? I do not want to Draw my histogram like discontinued point after normalizing them.

Thanks and best,

---

<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:** [June 16, 2020, 8:10am UTC](https://root-forum.cern.ch/t/thstack-normalization/39928/2 "2020-06-16T08:10:17Z")

</div>

`hstack->Draw("HIST"); // "HIST" or "NOSTACK HIST"`

---

<div class="post-metadata">

**Author:** ![yassine](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/yassine/32/34003_2.png) [@yassine](https://root-forum.cern.ch/u/yassine)\
**Post date:** [June 16, 2020, 8:21am UTC](https://root-forum.cern.ch/t/thstack-normalization/39928/3 "2020-06-16T08:21:48Z")

</div>

thanks that was useful, what about the first question I just wanna check  
that I did everything right

---

<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:** [June 16, 2020, 8:27am UTC](https://root-forum.cern.ch/t/thstack-normalization/39928/4 "2020-06-16T08:27:08Z")

</div>

> [@Normalize THSatck](https://root-forum.cern.ch/t/normalize-thsatck/21807):
>
> Dear expert, I want to normalize a THStack such that the integral is equal to 1. For the TH1 I used to do: h-\>Scale(1/h-\>Integral(“width”)); but the the Scale() or even Integral() are not a member of THStack. Is there a smart way to do that? Regards

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [June 30, 2020, 8:27am UTC](https://root-forum.cern.ch/t/thstack-normalization/39928/5 "2020-06-30T08:27:14Z")

</div>

Closed on June 30, 2020, 8:27am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
