3 from PhysicsTools.HeppyCore.framework.analyzer
import Analyzer
4 from PhysicsTools.HeppyCore.statistics.counter
import Counter, Counters
5 from PhysicsTools.Heppy.analyzers.AutoHandle
import AutoHandle
7 from PhysicsTools.Heppy.physicsobjects.RochesterCorrections
import rochcor
8 from PhysicsTools.Heppy.physicsobjects.Particle
import Particle
9 from PhysicsTools.Heppy.physicsobjects.Muon
import Muon
11 from ROOT
import gSystem
12 gSystem.Load(
"libDataFormatsRecoCandidate.so")
16 """ Simple DiMuon object 18 using the LeafCandidate (~simple particle ) dataformat from CMSSW as a base. 19 this class is made in such a way that it behaves almost exactly 20 as physicsobjects.DiObjects.DiMuon. 24 '''l1 and l2 are the legs, possibly recalibrated. 25 diLepton is the original diLepton, used only in the met function''' 30 super(DiMuon, self).
__init__(0, l1.p4()+l2.p4())
33 return 'DiMuon: mass={mass:5.2f}, sumpt={sumpt:5.2f}, pt={pt:5.2f}'.
format(
40 '''this is going to be needed to compute VBF related quantities. 41 just giving the met associated to the original di-lepton 43 return self.diLepton.met()
56 def correctDiLepton( diLepton ):
57 '''Corrects a di-lepton. 59 This function is defined within the process function to have 60 access to the variables available there, namely event.run. 61 The goal of this function is to be able to call it with map, 62 to get very compact code. 64 p4_1 = rochcor.corrected_p4( diLepton.leg1(), event.run )
65 p4_2 = rochcor.corrected_p4( diLepton.leg2(), event.run )
72 diLeptonCor =
DiMuon( l1, l2, diLepton)
75 event.diLeptonRaw = copy.copy(event.diLepton)
76 event.diLepton = correctDiLepton( event.diLeptonRaw )
def process(self, iEvent, event)
virtual double pt() const =0
transverse momentum
virtual double mass() const =0
mass
def __init__(self, l1, l2, diLepton)