1 from __future__
import print_function
3 from PhysicsTools.HeppyCore.framework.analyzer
import Analyzer
4 from PhysicsTools.Heppy.analyzers.AutoHandle
import AutoHandle
8 print(
'x = {x:5.4f}, y = {y:5.4f}, z = {z:5.4f}'.
format(x=vc.X(),
13 '''Analyze MET in Z+jet events.
14 Need a to provide a module creating event.diLepton
15 earlier in the sequence.
20 self.handles[
'met'] = AutoHandle(
31 self.readCollections( iEvent )
32 event.met = self.handles[
'met'].product()[0]
36 if not hasattr(event,
'diLepton'):
49 mVect = met.p4().Vect()
51 vVect = diL.p4().Vect()
53 recoilVect = copy.deepcopy(mVect)
57 zAxis = type(vVect)(0,0,1)
58 uvVectPerp = vVect.Cross(zAxis).Unit()
60 u1 = - recoilVect.Dot(uvVect)
61 u2 = recoilVect.Dot(uvVectPerp)
66 if self.cfg_ana.verbose:
67 print(
'met', met.pt())