CMS 3D CMS Logo

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__ (self, cfg_ana, cfg_comp, looperName)
 
def adduParaPerp (self, met, boson, postfix)
 
def applyDeltaMet (self, met, deltaMet)
 
def beginLoop (self, setup)
 
def declareHandles (self)
 
def makeTkMETs (self, event)
 

Public Attributes

 applyJetSmearing
 
 jetAnalyzerPostFix
 
 old74XMiniAODs
 
 recalibrateMET
 
 type1METCorrector
 

Detailed Description

Definition at line 15 of file METAnalyzer.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 16 of file METAnalyzer.py.

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

Member Function Documentation

◆ adduParaPerp()

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

Definition at line 48 of file METAnalyzer.py.

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

◆ applyDeltaMet()

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

◆ beginLoop()

def objects.METAnalyzer.METAnalyzer.beginLoop (   self,
  setup 
)

Definition at line 38 of file METAnalyzer.py.

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

References CSCSPEvent.counters(), cms::cuda::AtomicPairCounter::Atomic2.counters, NMaxPerLumi.counters, analyzer.Analyzer.counters, HistogramManager.counters, counter.Counters.counters, and cscdqm::ChamberCounterKeyType.counters.

◆ declareHandles()

def objects.METAnalyzer.METAnalyzer.declareHandles (   self)

Definition at line 28 of file METAnalyzer.py.

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

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

◆ makeTkMETs()

def objects.METAnalyzer.METAnalyzer.makeTkMETs (   self,
  event 
)

Definition at line 60 of file METAnalyzer.py.

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

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

Member Data Documentation

◆ applyJetSmearing

objects.METAnalyzer.METAnalyzer.applyJetSmearing

Definition at line 19 of file METAnalyzer.py.

◆ jetAnalyzerPostFix

objects.METAnalyzer.METAnalyzer.jetAnalyzerPostFix

Definition at line 21 of file METAnalyzer.py.

◆ old74XMiniAODs

objects.METAnalyzer.METAnalyzer.old74XMiniAODs

Definition at line 20 of file METAnalyzer.py.

◆ recalibrateMET

objects.METAnalyzer.METAnalyzer.recalibrateMET

Definition at line 18 of file METAnalyzer.py.

◆ type1METCorrector

objects.METAnalyzer.METAnalyzer.type1METCorrector

Definition at line 24 of file METAnalyzer.py.

counter
Definition: counter.py:1
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10