CMS 3D CMS Logo

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

Public Member Functions

def __init__
 
def applyDeltaMet
 
def beginLoop
 
def declareHandles
 
def makeTkMETs
 

Detailed Description

Definition at line 19 of file METAnalyzer.py.

Constructor & Destructor Documentation

def objects.METAnalyzer.METAnalyzer.__init__ (   self,
  cfg_ana,
  cfg_comp,
  looperName 
)

Definition at line 20 of file METAnalyzer.py.

20 
21  def __init__(self, cfg_ana, cfg_comp, looperName ):
22  super(METAnalyzer,self).__init__(cfg_ana,cfg_comp,looperName)

Member Function Documentation

def objects.METAnalyzer.METAnalyzer.applyDeltaMet (   self,
  met,
  deltaMet 
)

Definition at line 37 of file METAnalyzer.py.

37 
38  def applyDeltaMet(self, met, deltaMet):
39  px,py = self.met.px()+deltaMet[0], self.met.py()+deltaMet[1]
40  met.setP4(ROOT.reco.Particle.LorentzVector(px,py, 0, math.hypot(px,py)))
def objects.METAnalyzer.METAnalyzer.beginLoop (   self,
  setup 
)

Definition at line 31 of file METAnalyzer.py.

31 
32  def beginLoop(self, setup):
33  super(METAnalyzer,self).beginLoop(setup)
34  self.counters.addCounter('events')
35  count = self.counters.counter('events')
36  count.register('all events')
def objects.METAnalyzer.METAnalyzer.declareHandles (   self)

Definition at line 23 of file METAnalyzer.py.

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

23 
24  def declareHandles(self):
25  super(METAnalyzer, self).declareHandles()
26  self.handles['met'] = AutoHandle( self.cfg_ana.metCollection, 'std::vector<pat::MET>' )
27  self.handles['nopumet'] = AutoHandle( self.cfg_ana.noPUMetCollection, 'std::vector<pat::MET>' )
28  self.handles['cmgCand'] = AutoHandle( self.cfg_ana.candidates, self.cfg_ana.candidatesTypes )
29  self.handles['vertices'] = AutoHandle( "offlineSlimmedPrimaryVertices", 'std::vector<reco::Vertex>', fallbackLabel="offlinePrimaryVertices" )
30  self.mchandles['packedGen'] = AutoHandle( 'packedGenParticles', 'std::vector<pat::PackedGenParticle>' )
def objects.METAnalyzer.METAnalyzer.makeTkMETs (   self,
  event 
)

Definition at line 41 of file METAnalyzer.py.

References funct.abs(), core.AutoHandle.AutoHandle.handles, core.Analyzer.Analyzer.handles, and HTTP.RequestManager.handles.

41 
42  def makeTkMETs(self, event):
43 
44  charged = []
45  chargedchs = []
46  chargedPVLoose = []
47  chargedPVTight = []
48 
49  pfcands = self.handles['cmgCand'].product()
50 
51  for i in xrange(pfcands.size()):