3 from PhysicsTools.Heppy.physicsobjects.PhysicsObjects
import Muon, Tau, Electron
5 from PhysicsTools.Heppy.physicsobjects.HTauTauElectron
import HTauTauElectron
6 from CMGTools.RootTools.utils.DeltaR
import deltaR2
9 '''Generic di-object class, to handle di-objects from the EDM file
13 '''diobject is the di-object read from the edm file'''
19 super(DiObject, self).
__init__(diobject)
22 '''pt_leg1 + pt_leg2, e.g. used for finding the best DiTau.'''
23 return self.leg1().
pt() + self.leg2().
pt()
26 header =
'{cls}: mvis={mvis}, mT={mt}, sumpT={sumpt}'.
format(
27 cls = self.__class__.__name__,
28 mvis = self.diobject.mass(),
29 mt = self.diobject.mTLeg2(),
30 sumpt = self.
sumPt() )
31 return '\n'.
join( [header,
32 '\t'+str(self.leg1()),
33 '\t'+str(self.leg2())] )
40 super(DiMuon, self).
__init__(diobject)
51 return 'DiMuon: mass={mass:5.2f}, sumpt={sumpt:5.2f}, pt={pt:5.2f}'.
format(
61 super(DiElectron, self).
__init__(diobject)
72 header =
'DiElectron: mvis=%3.2f, sumpT=%3.2f' \
73 % (self.diobject.mass(),
75 return '\n'.
join( [header] )
80 super(DiTau, self).
__init__(diobject)
87 ZorPhotonorHiggs = [22, 23, 25, 35, 36, 37]
88 for gen
in genParticles:
90 if abs(gen.pdgId())==15
and gen.mother().
pdgId()
in ZorPhotonorHiggs:
98 dR2leg1Min, self.
leg1Gen = ( float(
'inf'),
None)
99 dR2leg2Min, self.
leg2Gen = ( float(
'inf'),
None)
100 for genTau
in genTaus:
102 genTau.eta(), genTau.phi() )
104 genTau.eta(), genTau.phi() )
105 if dR2leg1 < dR2leg1Min:
106 dR2leg1Min, self.
leg1Gen = (dR2leg1, genTau)
107 if dR2leg2 < dR2leg2Min:
108 dR2leg2Min, self.
leg2Gen = (dR2leg2, genTau)
118 '''Holds a CMG TauMuon, and the 2 legs as a python Tau and Muon'''
120 super(TauMuon, self).
__init__(diobject)
134 super(TauElectron, self).
__init__(diobject)
147 super(MuonElectron, self).
__init__(diobject)
160 super(TauTau, self).
__init__(diobject)
Abs< T >::type abs(const T &t)
double deltaR2(const T1 &t1, const T2 &t2)
static std::string join(char **cmd)