From ef813a45ec64ffb58216ae00fba69cd516c43510 Mon Sep 17 00:00:00 2001
From: Markus Seidel <markus.seidel@cern.ch>
Date: Sat, 25 Mar 2017 13:59:20 +0100
Subject: [PATCH] Fix lepton selection efficiencies

---
 TopAnalysis/src/LeptonEfficiencyWrapper.cc | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/TopAnalysis/src/LeptonEfficiencyWrapper.cc b/TopAnalysis/src/LeptonEfficiencyWrapper.cc
index 9ea6517f..84be0b04 100644
--- a/TopAnalysis/src/LeptonEfficiencyWrapper.cc
+++ b/TopAnalysis/src/LeptonEfficiencyWrapper.cc
@@ -102,14 +102,14 @@ void LeptonEfficiencyWrapper::init(TString era)
         gSystem->ExpandPathName(lepEffUrl);
         fIn=TFile::Open(lepEffUrl);      
         TH2 *idH=(TH2 *)fIn->Get("EGamma_SF2D");
-        for(Int_t xbin=1; xbin<=(lepEffH_["m_sel"+period])->GetNbinsX(); xbin++)
-          for(Int_t ybin=1; ybin<=(lepEffH_["m_sel"+period])->GetNbinsY(); ybin++)
+        for(Int_t xbin=1; xbin<=(lepEffH_["e_sel"+period])->GetNbinsX(); xbin++)
+          for(Int_t ybin=1; ybin<=(lepEffH_["e_sel"+period])->GetNbinsY(); ybin++)
             {
-              float sfreco(lepEffH_["m_sel"+period]->GetBinContent(xbin,ybin)), sfid(idH->GetBinContent(xbin,ybin));
-              float sfrecoUnc(lepEffH_["m_sel"+period]->GetBinError(xbin,ybin)), sfidUnc(idH->GetBinError(xbin,ybin));
+              float sfreco(lepEffH_["e_sel"+period]->GetBinContent(xbin,ybin)), sfid(idH->GetBinContent(xbin,ybin));
+              float sfrecoUnc(lepEffH_["e_sel"+period]->GetBinError(xbin,ybin)), sfidUnc(idH->GetBinError(xbin,ybin));
               float sf(sfreco*sfid), sfUnc(sqrt(pow(sfreco*sfrecoUnc,2)+pow(sfidUnc*sfid,2)));
-              lepEffH_["m_sel"+period]->SetBinContent(xbin,ybin,sf);
-              lepEffH_["m_sel"+period]->SetBinError(xbin,ybin,sfUnc);
+              lepEffH_["e_sel"+period]->SetBinContent(xbin,ybin,sf);
+              lepEffH_["e_sel"+period]->SetBinError(xbin,ybin,sfUnc);
             }
         fIn->Close();
       }
-- 
GitLab