//----------------------------------------------------------------------------------------------- //DIVIDE VARIOUS HISTOGRAMS FOR EFFICIENCY PLOTS //----------------------------------------------------------------------------------------------- #include void xft_effCalc (TH1F* numHist, TH1F* denomHist, TH1F* effHist) { // Loop over the Pt Fnd and Gen plots to determine efficiency for(Int_t i=0; i<=(denomHist->GetNbinsX()+1); i++) { float effFnd=0.0; float efferr=0.0; float gennum = denomHist->GetBinContent(i); float numobs = numHist->GetBinContent(i); if(gennum>0.5) { effFnd = numobs/gennum; efferr = sqrt(effFnd*(1.0-effFnd)/gennum); } effHist->SetBinContent(i,effFnd); effHist->SetBinError(i,efferr); } return; }