# \`diffsig\` option in TRatioPlot class

**URL:** <https://root-forum.cern.ch/t/diffsig-option-in-tratioplot-class/35264>\
**Category:** Newbie\
**Created:** [July 19, 2019, 8:41am UTC](https://root-forum.cern.ch/t/diffsig-option-in-tratioplot-class/35264 "2019-07-19T08:41:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tk231](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/7ea924/32.png) [@tk231](https://root-forum.cern.ch/u/tk231)\
**Post date:** [July 19, 2019, 8:41am UTC](https://root-forum.cern.ch/t/diffsig-option-in-tratioplot-class/35264/1 "2019-07-19T08:41:27Z")

</div>

Hi,

I don’t think I understand the `diffsig` option in the TRatioPlot class, and I was hoping for some clarification:

Say that I’m using the constructor `new TRatioPlot(hist1, hist2, "diffsig")`. If I understand it correctly (tried it out too), it would mean that the function would substract the bins in hist1 from hist2 (i.e.: hist2[i]-hist1[i]). However, I don’t understand how the uncertainties are calculated, and how the bins are divided by the uncertainties. And as I have histograms, does that mean that my uncertainties are simply the square root of the number of counts in the bin?

Thanks in advance for any help in explaining this!

---

<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:** [July 22, 2019, 7:48am UTC](https://root-forum.cern.ch/t/diffsig-option-in-tratioplot-class/35264/2 "2019-07-22T07:48:43Z")

</div>

All available information about this option is given in the [reference guide](https://root.cern/doc/master/TRatioPlot_8cxx_source.html).  
I guess that’s what you looked at.  
The code implementing this option is at line 933 in the [source](https://root.cern/doc/master/TRatioPlot_8cxx_source.html) code.

---

<div class="post-metadata">

**Author:** ![tk231](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/7ea924/32.png) [@tk231](https://root-forum.cern.ch/u/tk231)\
**Post date:** [July 22, 2019, 1:55pm UTC](https://root-forum.cern.ch/t/diffsig-option-in-tratioplot-class/35264/3 "2019-07-22T13:55:53Z")

</div>

Thanks @couet , I had a better look into the source code and I think I now better understand it.

---

<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:** [July 22, 2019, 2:00pm UTC](https://root-forum.cern.ch/t/diffsig-option-in-tratioplot-class/35264/4 "2019-07-22T14:00:00Z")

</div>

> [@tk231](#):
>
> I had a better look into the source code and I think I now better understand it.

If you think the documentation needs some clarification please let us know.
