1 from PhysicsTools.Heppy.physicsobjects.Lepton
import Lepton
2 from PhysicsTools.Heppy.physicsutils.TauDecayModes
import tauDecayModes
5 cutsElectronMVA3Medium = [0.933,0.921,0.944,0.945,0.918,0.941,0.981,0.943,0.956,0.947,0.951,0.95,0.897,0.958,0.955,0.942]
16 if self.
eOverP is not None:
19 + self.tau.leadChargedHadrHcalEnergy()
26 '''Just making the tau behave as a lepton.'''
30 '''For a transparent treatment of electrons, muons and taus. Returns -99'''
33 def dxy(self, vertex=None):
35 vertex = self.associatedVertex
38 return ( - (vtx.x()-vertex.position().
x()) * p4.y()
39 + (vtx.y()-vertex.position().
y()) * p4.x() ) / p4.pt()
41 def dz(self, vertex=None):
43 vertex = self.associatedVertex
46 return (vtx.z()-vertex.position().
z()) - ((vtx.x()-vertex.position().
x())*p4.x()+(vtx.y()-vertex.position().
y())*p4.y())/ p4.pt() * p4.z()/ p4.pt()
49 '''z impact at ECAL surface'''
51 vertex = self.associatedVertex
52 return vertex.z() + 130./math.tan(self.theta())
55 lep = super(Tau, self).
__str__()
65 '''Custom electron MVA 3 medium WP used for H->tau tau'''
66 icat = int(round(self.tauID(
'againstElectronMVA3category')))
72 rawMVA = self.tauID(
'againstElectronMVA3raw')
73 return rawMVA > cutsElectronMVA3Medium[icat]
77 '''Duck-typing a tau'''
82 except AttributeError:
bool isTau(const Candidate &part)