I’m making efficiency scale factors (SF), where the SF is the ratio of the data efficiency to the simulated efficiency, and I need to calculate the overall stat uncertainty on these SFs. The workflow (in pseudocode) right now is

My understanding, though, is that just using this Divide() function doesn’t properly do binomial error, and that I should either use Divide(hist1, hist2, 1, 1, “B”) or create TEfficiency objects and use those (though I am unfamiliar with TEfficiency and am not sure how to access the bin error once the objects are created). It’s unclear to me from looking at previous forums which is the recommended approach. Any suggestions?

Hi,
For proper error estimation on the efficiency you should use the TEfficiency class passing the total and pass histograms. The class will compute correctly the errors in the efficiency providing different statistical methods for doing it. It includes also the case of TH1::Divide(.."B") .
See the reference documentation of TEfficiency. There should be there enough information to learn on how to use the class.
Apologies for the late reply.

Thank you for the reply @moneta! I think I understand what I should do now, but I just wanted to confirm that the default options are sufficient:

First, if I do
dataHist = TEfficiency(dataMatchHists,dataProbeHist).GetCopyTotalHisto(),
and likewise for MC, I get TH2’s with properly-calculated binominal errors.

Then, for the SF, which is Data eff / MC eff, I believe that since they are uncorrelated errors I can simply take the hists from above and do
SFHist = dataHist.Divide(MCHist),
which will propagate the data and MC hist errors in quadrature.

Is this the correct way to go about things, to your understanding?

To get the properly calculated binomial errors, you need to use directly the TEfficiency class…
You can draw it or get their bin content and errors calling TEfficiency::GetEfficiency(bin) and TEfficiency::GetEfficiencyErrorLow(bin), TEfficiency::GetEfficiencyErrorUp(bin).
After having drawn it (calling TEfficiency::Draw()) , you can get the corresponding Graph (for the 1D case), by calling TEfficiency::GetPaintedGraph() and TEfficiency::GetPaintedHistogram() for the 2-d case as yours.

For uncorrelated histograms you can call TH1::Divide, but if you want proper Poisson errors ratio error, you can use (for 1D case only), TGraphAsymmErrors::Divide(h1,h2, "pois"), see ROOT: TGraphAsymmErrors Class Reference