109 event.met = self.handles[
'met'].product()[0]
110 event.metNoPU = self.handles[
'nopumet'].product()[0]
114 for i
in range(event.met.METUncertaintySize):
115 m = ROOT.pat.MET(event.met)
118 m.setP4(ROOT.reco.Particle.LorentzVector(px,py, 0, math.hypot(px,py)))
119 setattr(event,
"met_shifted_{0}".
format(i), m)
120 event.met_sig = event.met.significance()
121 event.met_sumet = event.met.sumEt()
125 event.metraw = event.met.shiftedPt(12, 0)
126 event.metType1chs = event.met.shiftedPt(12, 1)
128 if self.cfg_ana.recalibrate
and hasattr(event,
'deltaMetFromJetSmearing'):
129 px,py = event.met.px()+event.deltaMetFromJetSmearing[0], event.met.py()+event.deltaMetFromJetSmearing[1]
130 event.met.setP4(ROOT.reco.Particle.LorentzVector(px,py, 0, math.hypot(px,py)))
131 px,py = event.metNoPU.px()+event.deltaMetFromJetSmearing[0], event.metNoPU.py()+event.deltaMetFromJetSmearing[1]
132 event.metNoPU.setP4(ROOT.reco.Particle.LorentzVector(px,py, 0, math.hypot(px,py)))
133 if self.cfg_ana.recalibrate
and hasattr(event,
'deltaMetFromJEC')
and event.deltaMetFromJEC[0] != 0
and event.deltaMetFromJEC[1] != 0:
134 px,py = event.met.px()+event.deltaMetFromJEC[0], event.met.py()+event.deltaMetFromJEC[1]
135 event.met.setP4(ROOT.reco.Particle.LorentzVector(px,py, 0, math.hypot(px,py)))
136 px,py = event.metNoPU.px()+event.deltaMetFromJEC[0], event.metNoPU.py()+event.deltaMetFromJEC[1]
137 event.metNoPU.setP4(ROOT.reco.Particle.LorentzVector(px,py, 0, math.hypot(px,py)))
139 if self.cfg_ana.doMetNoMu
and hasattr(event,
'selectedMuons'):
140 self.makeMETNoMu(event)
142 if self.cfg_ana.doMetNoPhoton
and hasattr(event,
'selectedPhotons'):
143 self.makeMETNoPhoton(event)