CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
SimpleJetAnalyzer.SimpleJetAnalyzer Class Reference
Inheritance diagram for SimpleJetAnalyzer.SimpleJetAnalyzer:

Public Member Functions

def declareHandles
 
def process
 

Detailed Description

Just a simple jet analyzer, to be used in tutorials.

Definition at line 6 of file SimpleJetAnalyzer.py.

Member Function Documentation

def SimpleJetAnalyzer.SimpleJetAnalyzer.declareHandles (   self)

Definition at line 9 of file SimpleJetAnalyzer.py.

References core.AutoHandle.AutoHandle.handles, core.Analyzer.Analyzer.handles, HTTP.RequestManager.handles, and core.Analyzer.Analyzer.mchandles.

9 
10  def declareHandles(self):
11  super(SimpleJetAnalyzer, self).declareHandles()
12  self.handles['jets'] = AutoHandle( 'slimmedJets',
13  'std::vector<pat::Jet>' )
14  self.mchandles['genjets'] = AutoHandle( 'slimmedGenJets',
15  'std::vector<reco::GenJet>')
def SimpleJetAnalyzer.SimpleJetAnalyzer.process (   self,
  event 
)

Definition at line 16 of file SimpleJetAnalyzer.py.

References core.AutoHandle.AutoHandle.handles, core.Analyzer.Analyzer.handles, HTTP.RequestManager.handles, python.multivaluedict.map(), deltar.matchObjectCollection(), and core.Analyzer.Analyzer.mchandles.

Referenced by ConfigBuilder.ConfigBuilder.__init__(), ConfigBuilder.ConfigBuilder.addExtraStream(), ConfigBuilder.ConfigBuilder.anyOf(), ConfigBuilder.ConfigBuilder.completeInputCommand(), ConfigBuilder.ConfigBuilder.doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules.leave(), ConfigBuilder.ConfigBuilder.prepare(), ConfigBuilder.ConfigBuilder.prepare_ALCA(), ConfigBuilder.ConfigBuilder.prepare_DQM(), ConfigBuilder.ConfigBuilder.prepare_FASTSIM(), ConfigBuilder.ConfigBuilder.prepare_HARVESTING(), ConfigBuilder.ConfigBuilder.prepare_HLT(), ConfigBuilder.ConfigBuilder.prepare_LHE(), ConfigBuilder.ConfigBuilder.prepare_VALIDATION(), ConfigBuilder.ConfigBuilder.renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder.renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

16 
17  def process(self, event):
18  super(SimpleJetAnalyzer, self).readCollections(event.input)
19  # creating Jet python objects wrapping the EDM jets
20  # keeping only the first 2 leading jets
21  event.jets = map(Jet, self.handles['jets'].product())[:2]
22  event.jets = [ jet for jet in event.jets if jet.pt()>self.cfg_ana.ptmin]
23 
24  if self.cfg_comp.isMC:
25  event.genjets = map(GenJet, self.mchandles['genjets'].product())
26  matches = matchObjectCollection(event.jets, event.genjets, 0.2)
27  for jet in event.jets:
28  jet.gen = matches[jet]
29 
def matchObjectCollection
Definition: deltar.py:149