# Draw ratio between 2 TEfficiency object

**URL:** <https://root-forum.cern.ch/t/draw-ratio-between-2-tefficiency-object/47514>\
**Category:** Newbie\
**Created:** [November 3, 2021, 1:54pm UTC](https://root-forum.cern.ch/t/draw-ratio-between-2-tefficiency-object/47514 "2021-11-03T13:54:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam12](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@Sam12](https://root-forum.cern.ch/u/Sam12)\
**Post date:** [November 3, 2021, 1:54pm UTC](https://root-forum.cern.ch/t/draw-ratio-between-2-tefficiency-object/47514/1 "2021-11-03T13:54:36Z")

</div>

Hi everyone,

I have 2 TEfficiency plots and i want to take the ratio between them.  
Since i have TEfficiency object i can’t use the Divide method. What is the solution to these problem?

TPad\* pad1 = (TPad\*)c-\>cd();  
pad1-\>Draw();  
pad1-\>cd();

TEfficiency \* efficiency1;  
TEfficiency \* efficiency2;  
TFile \* file1 = TFile::Open(“myNtuple1.root”);  
file1-\>cd(“tree/Tracks/”);

TCanvas \*c = new TCanvas(“c”, “canvas”, 800, 800);

efficiency1 = (TEfficiency\*)gROOT-\>FindObject(“trackeff”);

TFile \* file2 = TFile::Open(“myNtuple2.root”);  
file2-\>cd(“tree/Tracks”);

efficiency2 = (TEfficiency\*)gROOT-\>FindObject(“trackeff\_vs\_eta”);

TH1F \*h1 = pad1-\>DrawFrame(-3,0.8,3,1);

efficiency1-\>Draw(“same”);  
efficiency2-\>Draw(“same”);

---

<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:** [November 3, 2021, 5:33pm UTC](https://root-forum.cern.ch/t/draw-ratio-between-2-tefficiency-object/47514/2 "2021-11-03T17:33:06Z")

</div>

> [@Sam12](#):
>
> Since i have TEfficiency object i can’t use the Divide method

I guess @moneta will know.

---

<div class="post-metadata">

**Author:** ![Sam12](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@Sam12](https://root-forum.cern.ch/u/Sam12)\
**Post date:** [November 7, 2021, 12:29am UTC](https://root-forum.cern.ch/t/draw-ratio-between-2-tefficiency-object/47514/3 "2021-11-07T00:29:33Z")

</div>

@awisecar do you have an idea would you please help!

---

<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:** [November 9, 2021, 8:59pm UTC](https://root-forum.cern.ch/t/draw-ratio-between-2-tefficiency-object/47514/4 "2021-11-09T20:59:29Z")

</div>

Hi,

Apologies for the late reply. We don’t support in ROOT the division of two TEfficieny objects.  
If the numbers are uncorrelated, you can use the normal error approximation and use error propagation for the division. This can be done using for example `TH1::Divide`

Lorenzo
