From f09dd7cdd6035f6a2c260308ad8174c4c488ccb5 Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 13 Feb 2015 18:26:24 +0100 Subject: [PATCH] clean up ID in Z skimmer --- CMGTools/TTHAnalysis/cfg/run_susyMT2_cfg.py | 4 +--- CMGTools/TTHAnalysis/python/analyzers/ttHmllSkimmer.py | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CMGTools/TTHAnalysis/cfg/run_susyMT2_cfg.py b/CMGTools/TTHAnalysis/cfg/run_susyMT2_cfg.py index aaf895bd221..73e448f1c99 100644 --- a/CMGTools/TTHAnalysis/cfg/run_susyMT2_cfg.py +++ b/CMGTools/TTHAnalysis/cfg/run_susyMT2_cfg.py @@ -92,9 +92,8 @@ # Tree Producer ttHZskim = cfg.Analyzer( ttHmllSkimmer, name='ttHmllSkimmer', - lepId=13, + lepId=[13], maxLeps=3, - intPDG=13, massMin=60, massMax=120, doZGen = False, @@ -199,7 +198,6 @@ ## 25 ns ttbar PHYS14 # comp = TTJets # comp.files = comp.files[:1] - # comp=TTJets # comp.files = ['/afs/cern.ch/work/d/dalfonso/public/ttjets_miniaodsim_00C90EFC-3074-E411-A845-002590DB9262.root'] comp=GJets_HT200to400 diff --git a/CMGTools/TTHAnalysis/python/analyzers/ttHmllSkimmer.py b/CMGTools/TTHAnalysis/python/analyzers/ttHmllSkimmer.py index 99dc40e3c6e..31c4a9b23d9 100644 --- a/CMGTools/TTHAnalysis/python/analyzers/ttHmllSkimmer.py +++ b/CMGTools/TTHAnalysis/python/analyzers/ttHmllSkimmer.py @@ -18,14 +18,14 @@ def beginLoop(self,setup): count.register('pass gen Zll skim') count.register('pass reco Zll skim') - def makeZs(self, event, maxLeps, intPDG): + def makeZs(self, event, maxLeps, lepId): event.bestZ = [ 0., -1,-1 ] nlep = len(event.selectedLeptons) for i,l1 in enumerate(event.selectedLeptons): for j in range(i+1,nlep): if j >= maxLeps: break l2 = event.selectedLeptons[j] - if l1.pdgId() == -l2.pdgId() and abs(l1.pdgId())==intPDG: + if l1.pdgId() == -l2.pdgId() and abs(l1.pdgId()) in lepId: zmass = (l1.p4() + l2.p4()).M() if event.bestZ[0] == 0 or abs(zmass - 91.188) < abs(event.bestZ[0] - 91.188): event.bestZ = [ zmass, i, j ] @@ -35,13 +35,13 @@ def process(self, event): self.counters.counter('events').inc('all events') if self.cfg_ana.doZGen and len(event.genleps)==2: - if(event.genleps[0].pdgId() == - event.genleps[1].pdgId()) and abs(event.genleps[0].pdgId())==self.cfg_ana.lepId : + if event.genleps[0].pdgId() == - event.genleps[1].pdgId() and abs(event.genleps[0].pdgId()) in self.cfg_ana.lepId : if (event.genleps[0].sourceId==23 and event.genleps[1].sourceId==23) : self.counters.counter('events').inc('pass gen Zll skim') return True if self.cfg_ana.doZReco: - self.makeZs( event, self.cfg_ana.maxLeps, self.cfg_ana.intPDG) + self.makeZs( event, self.cfg_ana.maxLeps, self.cfg_ana.lepId) if event.bestZ[0] > self.cfg_ana.massMin and event.bestZ[0] < self.cfg_ana.massMax: self.counters.counter('events').inc('pass reco Zll skim') return True