CMS 3D CMS Logo

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

Public Member Functions

def __init__
 
def adduParaPerp
 
def applyDeltaMet
 
def beginLoop
 
def declareHandles
 
def makeTkMETs
 

Public Attributes

 applyJetSmearing
 
 jetAnalyzerPostFix
 
 old74XMiniAODs
 
 recalibrateMET
 
 type1METCorrector
 

Detailed Description

Definition at line 15 of file METAnalyzer.py.

Constructor & Destructor Documentation

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

Definition at line 16 of file METAnalyzer.py.

16 
17  def __init__(self, cfg_ana, cfg_comp, looperName ):
18  super(METAnalyzer,self).__init__(cfg_ana,cfg_comp,looperName)
19  self.recalibrateMET = cfg_ana.recalibrate
20  self.applyJetSmearing = cfg_comp.isMC and cfg_ana.applyJetSmearing
21  self.old74XMiniAODs = cfg_ana.old74XMiniAODs
22  self.jetAnalyzerPostFix = getattr(cfg_ana, 'jetAnalyzerPostFix', '')
23  if self.recalibrateMET in [ "type1", True ]:
24  if self.recalibrateMET == "type1":
25  self.type1METCorrector = Type1METCorrector(self.old74XMiniAODs)
26  elif self.recalibrateMET != False:
27  raise RuntimeError("Unsupported value %r for option 'recalibrate': allowed are True, False, 'type1'" % self.recalibrateMET)

Member Function Documentation

def objects.METAnalyzer.METAnalyzer.adduParaPerp (   self,
  met,
  boson,
  postfix 
)

Definition at line 48 of file METAnalyzer.py.

48 
49  def adduParaPerp(self, met, boson, postfix):
50 
51  upara = 0
52  uperp = 0
53  uX = - met.px() - boson.px()
54  uY = - met.py() - boson.py()
55  u1 = (uX*boson.px() + uY*boson.py())/boson.pt()
56  u2 = (uX*boson.py() - uY*boson.px())/boson.pt()
57 
58  setattr(met, "upara"+postfix, u1)
59  setattr(met, "uperp"+postfix, u2)
def objects.METAnalyzer.METAnalyzer.applyDeltaMet (   self,
  met,
  deltaMet 
)

Definition at line 44 of file METAnalyzer.py.

44 
45  def applyDeltaMet(self, met, deltaMet):
46  px,py = self.met.px()+deltaMet[0], self.met.py()+deltaMet[1]
47  met.setP4(ROOT.reco.Particle.LorentzVector(px,py, 0, hypot(px,py)))
def objects.METAnalyzer.METAnalyzer.beginLoop (   self,
  setup 
)

Definition at line 38 of file METAnalyzer.py.

38 
39  def beginLoop(self, setup):
40  super(METAnalyzer,self).beginLoop(setup)
41  self.counters.addCounter('events')
42  count = self.counters.counter('events')
43  count.register('all events')
def objects.METAnalyzer.METAnalyzer.declareHandles (   self)

Definition at line 28 of file METAnalyzer.py.

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

28 
29  def declareHandles(self):
30  super(METAnalyzer, self).declareHandles()
31  self.handles['met'] = AutoHandle( self.cfg_ana.metCollection, 'std::vector<pat::MET>' )
32  if self.cfg_ana.doMetNoPU:
33  self.handles['nopumet'] = AutoHandle( self.cfg_ana.noPUMetCollection, 'std::vector<pat::MET>' )
34  if self.cfg_ana.doTkMet:
35  self.handles['cmgCand'] = AutoHandle( self.cfg_ana.candidates, self.cfg_ana.candidatesTypes )
36  #self.handles['vertices'] = AutoHandle( "offlineSlimmedPrimaryVertices", 'std::vector<reco::Vertex>', fallbackLabel="offlinePrimaryVertices" )
37  self.mchandles['packedGen'] = AutoHandle( 'packedGenParticles', 'std::vector<pat::PackedGenParticle>' )
def objects.METAnalyzer.METAnalyzer.makeTkMETs (   self,
  event 
)

Definition at line 60 of file METAnalyzer.py.

References analyzer.Analyzer.cfg_ana, core.AutoHandle.AutoHandle.handles, core.Analyzer.Analyzer.handles, and HTTP.RequestManager.handles.

60 
61  def makeTkMETs(self, event):
62  charged = []
63  chargedchs = []
64  chargedPVLoose = []
65  chargedPVTight = []
66  dochs=getattr(self.cfg_ana,"includeTkMetCHS",True)
67  dotight=getattr(self.cfg_ana,"includeTkMetPVTight",True)
68  doloose=getattr(self.cfg_ana,"includeTkMetPVLoose",True)
69  pfcands = self.handles['cmgCand'].product()
70 
71  for pfcand in pfcands:

Member Data Documentation

objects.METAnalyzer.METAnalyzer.applyJetSmearing

Definition at line 19 of file METAnalyzer.py.

objects.METAnalyzer.METAnalyzer.jetAnalyzerPostFix

Definition at line 21 of file METAnalyzer.py.

objects.METAnalyzer.METAnalyzer.old74XMiniAODs

Definition at line 20 of file METAnalyzer.py.

objects.METAnalyzer.METAnalyzer.recalibrateMET

Definition at line 18 of file METAnalyzer.py.

objects.METAnalyzer.METAnalyzer.type1METCorrector

Definition at line 24 of file METAnalyzer.py.