6 '''3D impact parameter value.'''
7 return abs(self.dB(self.PV3D))
10 '''3D impact parameter significance.'''
11 db, edb = self.dB(self.PV3D), self.edB(self.PV3D)
12 return abs(db/edb)
if edb > 0
else 999.
15 '''Calculate Isolation using the effective area approach.'''
16 photonIso = self.photonIso()
17 offset = self.rho*getattr(self,
"EffectiveArea"+area)
18 return self.chargedHadronIso()+
max(0.,photonIso+self.neutralHadronIso()-offset)
23 def relIso(self, dBetaFactor=0, allCharged=0):
24 '''Relative isolation with default cone size of 0.4.'''
25 rel = self.
absIsoR(dBetaFactor=dBetaFactor, allCharged=allCharged)/self.pt()
28 def absIsoR(self, R=0.4, dBetaFactor=0, allCharged=False):
29 '''Isolation in given cone with optional delta-beta subtraction.'''
30 if dBetaFactor>0
and self.puChargedHadronIsoR(R)<0:
31 raise ValueError(
'If you want to use dbeta corrections, you must make sure that the pu charged hadron iso is available. This should never happen')
32 neutralIso = self.neutralHadronIsoR(R) + self.photonIsoR(R)
33 corNeutralIso = neutralIso - dBetaFactor * self.puChargedHadronIsoR(R)
34 charged = self.chargedHadronIsoR(R)
36 charged = self.chargedAllIsoR(R)
37 return charged +
max(corNeutralIso, 0.)
39 def relIsoR(self, R=0.4, dBetaFactor=0, allCharged=False):
40 return self.
absIsoR(R, dBetaFactor, allCharged)/self.pt()
43 if hasattr(self.innerTrack(),
"trackerExpectedHitsInner") :
46 return self.innerTrack().hitPattern().
numberOfLostHits(ROOT.reco.HitPattern.MISSING_INNER_HITS)
50 for p
in getattr(self,
'ownFsrPhotons', getattr(self,
'fsrPhotons', [])):
55 ptc = super(Lepton, self).
__str__()
56 return '{ptc}, iso={iso:5.2f}'.
format(ptc=ptc, iso=self.
relIso())