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.'''
21 '''For a transparent treatment of electrons, muons and taus. Returns -99'''
25 '''Returns standard dxy for an arbitrary passed vertex'''
27 vertex = self.associatedVertex
28 vtx = self.leadChargedHadrCand().vertex()
30 return ( - (vtx.x()-vertex.position().
x()) * p4.y()
31 + (vtx.y()-vertex.position().
y()) * p4.x() ) / p4.pt()
33 def dxy(self, vertex=None):
34 '''More precise dxy calculation as pre-calculated in the tau object
35 for the primary vertex it was constructed with.
36 Returns standard dxy calculation if the passed vertex differs from the
37 one in the tau object.
40 vertex = self.associatedVertex
43 if abs(vertex.z() == self.vertex().
z()) < 0.0001:
44 return self.physObj.dxy()
48 def dz(self, vertex=None):
50 vertex = self.associatedVertex
51 vtx = self.leadChargedHadrCand().vertex()
53 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()
56 '''z impact at ECAL surface'''
58 vertex = self.associatedVertex
59 return vertex.z() + 130./math.tan(self.theta())
62 lep = super(Tau, self).
__str__()
63 spec =
'\t\tTau: decay = {decMode:<15}'.
format(
64 decMode = tauDecayModes.intToName(self.decayMode())
66 return '\n'.
join([lep, spec])
70 '''Duck-typing a tau'''
73 leg.leadPFChargedHadrCandsignedSipt()
74 except AttributeError:
Abs< T >::type abs(const T &t)
static std::string join(char **cmd)
bool isTau(const Candidate &part)