1 from PhysicsTools.Heppy.analyzers.core.Analyzer
import Analyzer
2 from PhysicsTools.Heppy.analyzers.core.AutoHandle
import AutoHandle
3 from PhysicsTools.Heppy.physicsobjects.Jet
import Jet, GenJet
7 '''Just a simple jet analyzer, to be used in tutorials.'''
11 self.handles[
'jets'] = AutoHandle(
'slimmedJets',
12 'std::vector<pat::Jet>' )
13 self.mchandles[
'genjets'] = AutoHandle(
'slimmedGenJets',
14 'std::vector<reco::GenJet>')
17 super(SimpleJetAnalyzer, self).readCollections(event.input)
20 event.jets =
map(Jet, self.handles[
'jets'].product())[:2]
21 event.jets = [ jet
for jet
in event.jets
if jet.pt()>self.cfg_ana.ptmin]
23 if self.cfg_comp.isMC:
24 event.genjets =
map(GenJet, self.mchandles[
'genjets'].product())
26 for jet
in event.jets:
27 jet.gen = matches[jet]
def matchObjectCollection