# Calculating effective sigma

**URL:** <https://root-forum.cern.ch/t/calculating-effective-sigma/32909>\
**Category:** ROOT\
**Created:** [February 25, 2019, 9:07pm UTC](https://root-forum.cern.ch/t/calculating-effective-sigma/32909 "2019-02-25T21:07:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanvi\_Wamorkar](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/53a042/32.png) [@Tanvi\_Wamorkar](https://root-forum.cern.ch/u/Tanvi_Wamorkar)\
**Post date:** [February 25, 2019, 9:07pm UTC](https://root-forum.cern.ch/t/calculating-effective-sigma/32909/1 "2019-02-25T21:07:26Z")

</div>

Dear experts,

Apologies if this is not the correct forum for my question.  
I have a branch in a TTree containing the mass of a diphoton object. Is there a way to find the smallest interval which contains 68% of the events, without performing a fit (i.e not the value of the sigma parameter of the gaussian fit to the distribution)?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![StephanH](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@StephanH](https://root-forum.cern.ch/u/StephanH)\
**Post date:** [February 26, 2019, 1:36pm UTC](https://root-forum.cern.ch/t/calculating-effective-sigma/32909/2 "2019-02-26T13:36:10Z")

</div>

On first thought, nothing comes to mind that would do this for you. A first approach could be to calculate a 68% quantile by calculating the upper and lower 16% quantiles. This is not what you want, but a first step. Now you can start to optimise the lower quantile until you get the desired quantile.

---

<div class="post-metadata">

**Author:** ![Tanvi\_Wamorkar](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/53a042/32.png) [@Tanvi\_Wamorkar](https://root-forum.cern.ch/u/Tanvi_Wamorkar)\
**Post date:** [February 27, 2019, 4:29pm UTC](https://root-forum.cern.ch/t/calculating-effective-sigma/32909/3 "2019-02-27T16:29:11Z")

</div>

Thanks for the tip Stephan. Is there a function in ROOT to calculate the quantile? Could you point me to correct one?

Thanks again!

---

<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:** [February 27, 2019, 4:38pm UTC](https://root-forum.cern.ch/t/calculating-effective-sigma/32909/4 "2019-02-27T16:38:26Z")

</div>

Try:

```auto
grep -r -i quantile `root-config --incdir`
grep -r -i quantile ${ROOTSYS}/t[eu]*

```

If you create a histogram of the “mass of a diphoton object”, then maybe: [TH1::GetQuantiles](https://root.cern.ch/doc/master/classTH1.html#a2be4a5889f7421047d68b0a398675b8d)

> [@Median of histogram](https://root-forum.cern.ch/t/median-of-histogram/7626/5):
>
> The “median” is just the “0.5 quantile”: { // create, fill and draw the histogram TF1 \*f = new TF1("f", "TMath::Gaus(x, 5, 1)", 0, 10); TH1D \*h = new TH1D("h", "h", 100, 0, 10); h-\>FillRandom("f"); h-\>Draw(); // calculate and print the "median" Double\_t x, q; q = 0.5; // 0.5 for "median" h-\>ComputeIntegral(); // just a precaution h-\>GetQuantiles(1, &x, &q); std::cout \<\< "median = " \<\< x \<\< std::endl; }

---

<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:** [March 13, 2019, 4:38pm UTC](https://root-forum.cern.ch/t/calculating-effective-sigma/32909/5 "2019-03-13T16:38:37Z")

</div>

Closed on March 13, 2019, 4:38pm UTC

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