1 from PhysicsTools.Heppy.physicsobjects.Lepton
import Lepton
2 from PhysicsTools.Heppy.physicsutils.TauDecayModes
import tauDecayModes
16 def relIso(self, dBetaFactor=0, allCharged=0):
17 '''Just making the tau behave as a lepton, with dummy parameters.''' 20 def relIsoR(self, R=0.3, dBetaFactor=0, allCharged=0):
21 '''Just making the tau behave as a lepton, with dummy parameters.''' 25 '''For a transparent treatment of electrons, muons and taus. Returns -99''' 29 '''Returns standard dxy for an arbitrary passed vertex''' 31 vertex = self.associatedVertex
32 vtx = self.leadChargedHadrCand().
vertex()
34 return ( - (vtx.x()-vertex.position().x()) * p4.y()
35 + (vtx.y()-vertex.position().y()) * p4.x() ) / p4.pt()
37 def dxy(self, vertex=None):
38 '''More precise dxy calculation as pre-calculated in the tau object 39 for the primary vertex it was constructed with. 40 Returns standard dxy calculation if the passed vertex differs from the 41 one in the tau object. 44 vertex = self.associatedVertex
47 if abs(vertex.z() == self.vertex().z()) < 0.0001:
48 return self.physObj.
dxy()
52 def dz(self, vertex=None):
54 vertex = self.associatedVertex
55 vtx = self.leadChargedHadrCand().
vertex()
57 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()
60 '''z impact at ECAL surface''' 62 vertex = self.associatedVertex
63 return vertex.z() + 130./math.tan(self.theta())
66 lep = super(Tau, self).
__str__()
67 spec =
'\t\tTau: decay = {decMode:<15}'.
format(
68 decMode = tauDecayModes.intToName(self.decayMode())
70 return '\n'.
join([lep, spec])
74 '''Duck-typing a tau''' 77 leg.leadPFChargedHadrCandsignedSipt()
78 except AttributeError:
def zImpact(self, vertex=None)
def relIsoR(self, R=0.3, dBetaFactor=0, allCharged=0)
def dxy(self, vertex=None)
Abs< T >::type abs(const T &t)
def dxy_approx(self, vertex=None)
static std::string join(char **cmd)
def relIso(self, dBetaFactor=0, allCharged=0)
def dz(self, vertex=None)