CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Lepton.py
Go to the documentation of this file.
2 import ROOT
3 
5  def ip3D(self):
6  '''3D impact parameter value.'''
7  return abs(self.dB(self.PV3D))
8 
9 
10  def sip3D(self):
11  '''3D impact parameter significance.'''
12  return abs(self.dB(self.PV3D) / self.edB(self.PV3D))
13 
14  def absIsoFromEA(self, area='04'):
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)
19 
20  def relIsoFromEA(self, area='04'):
21  return self.absIsoFromEA(area)/self.pt()
22 
23  def relIso(self, dBetaFactor=0, allCharged=0):
24  '''Relative isolation with default cone size of 0.4.'''
25  rel = self.absIsoR(dBetaFactor, allCharged)/self.pt()
26  return rel
27 
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)
35  if allCharged:
36  charged = self.chargedAllIsoR(R)
37  return charged + max(corNeutralIso, 0.)
38 
39  def relIsoR(self, R=0.4, dBetaFactor=0, allCharged=False):
40  return self.absIsoR(R, dBetaFactor, allCharged)/self.pt()
41 
42  def lostInner(self):
43  if hasattr(self.innerTrack(),"trackerExpectedHitsInner") :
44  return self.innerTrack().trackerExpectedHitsInner().numberOfLostHits()
45  else :
46  return self.innerTrack().hitPattern().numberOfHits(ROOT.reco.HitPattern.MISSING_INNER_HITS)
47 
def relIso
Definition: Lepton.py:23
def lostInner
Definition: Lepton.py:42
def relIsoR
Definition: Lepton.py:39
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def sip3D
Definition: Lepton.py:10
def ip3D
Definition: Lepton.py:5
def relIsoFromEA
Definition: Lepton.py:20
def absIsoFromEA
Definition: Lepton.py:14
def absIsoR
Definition: Lepton.py:28