Draw ratio between 2 TEfficiency object

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”);

I guess @moneta will know.

1 Like

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

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