# Multiplying histogram by TEfficiency

**URL:** <https://root-forum.cern.ch/t/multiplying-histogram-by-tefficiency/49968>\
**Category:** Newbie\
**Created:** [May 13, 2022, 9:48am UTC](https://root-forum.cern.ch/t/multiplying-histogram-by-tefficiency/49968 "2022-05-13T09:48:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![renyhp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/e68b1a/32.png) [@renyhp](https://root-forum.cern.ch/u/renyhp)\
**Post date:** [May 13, 2022, 9:48am UTC](https://root-forum.cern.ch/t/multiplying-histogram-by-tefficiency/49968/1 "2022-05-13T09:48:30Z")

</div>

Hi,

I have computed a binned efficiency via TEfficiency, and I have a histogram of a _different_ sample from the ones in the TEfficiency, with the same binnings. I want to multiply the two, in order to know what is the expected number of events in each bin that pass the selection in TEfficiency.

Is there a more straightforward way than making a new histogram and setting the bin content manually?

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [May 13, 2022, 10:52am UTC](https://root-forum.cern.ch/t/multiplying-histogram-by-tefficiency/49968/2 "2022-05-13T10:52:18Z")

</div>

Hi @renyhp; I am sure @couet can help you with this.

Cheers,  
J.

---

<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:** [May 13, 2022, 10:59am UTC](https://root-forum.cern.ch/t/multiplying-histogram-by-tefficiency/49968/3 "2022-05-13T10:59:14Z")

</div>

> [@renyhp](#):
>
> Is there a more straightforward way than making a new histogram and setting the bin content manually?

I am sure @moneta will know.

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [May 17, 2022, 7:39am UTC](https://root-forum.cern.ch/t/multiplying-histogram-by-tefficiency/49968/4 "2022-05-17T07:39:08Z")

</div>

Hi,  
We don’t support in TEfficiency this kind of multiplications. If you don’t care about the correct error of the bin contents, you can use `TH1::Divide` with option `B` and then use `TH1::Multiply`, otherwise you would need to perform yourself the multiplication of the `TGraphAsymErrors` representing TEfficiency with the histogram.  
It could be a new feature that we could add to the class.

Lorenzo
