TEfficiency GetBinContent

How to GetBinContent from TEfficiency histogram? I meant, the bin content of the TEfficiency, not the individual histograms used in it.

Hello @Alkegit21,

TEfficiency internally stores two TH1 histograms, i.e. ‘total’ and ‘passed’ histograms (see the documentation here). Given that, and depending on your intent, you can invoke GetBinContent() on the source TH1s or on the resulting TH2 created by TEfficiency.

Depending on the case, you can use the GetTotalHistogram(), GetPassedHistogram(), or GetPaintedHistogram() member functions, e.g.

TEfficiency *pEff = /* ... */;
// ...
TH2 *hist = pEff->GetPaintedHistogram();
auto content = hist->GetBinContent(/* ... */);

Cheers,
J.

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