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  '''
16  Calculate Isolation using the effective area approach. If fsrPhotons is set
17  the list of photons is subtracted from the isolation cone. It works with one or
18  two effective Areas in case one needs to do photon and neutral hadron separately
19  '''
20  photonIso = self.photonIso()
21  if hasattr(self,'fsrPhotons'):
22  for gamma in self.fsrPhotons:
23  photonIso=max(photonIso-gamma.pt(),0.0)
24 
25  offset = self.rho*getattr(self,"EffectiveArea"+area)
26  return self.chargedHadronIso()+max(0.,photonIso+self.neutralHadronIso()-offset)
27 
28 
29  def absIso(self, dBetaFactor=0, allCharged=0):
30  if dBetaFactor>0 and self.puChargedHadronIso()<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.neutralHadronIso()+self.photonIso()
33  #Recover FSR
34  if hasattr(self,'fsrPhotons'):
35  for gamma in self.fsrPhotons:
36  neutralIso=neutralIso-gamma.pt()
37  corNeutralIso = neutralIso - dBetaFactor * self.puChargedHadronIso()
38  charged = self.chargedHadronIso()
39  if allCharged:
40  charged = self.chargedAllIso()
41  return charged + max(corNeutralIso,0)
42 
43  def relIso(self,dBetaFactor=0, allCharged=0):
44  rel = self.absIso(dBetaFactor, allCharged)/self.pt()
45  return rel
46 
47  def relEffAreaIso(self,rho):
48  '''MIKE, missing doc'''
49  return self.absEffAreaIso(rho)/self.pt()
50 
51  def lostInner(self):
52  if hasattr(self.innerTrack(),"trackerExpectedHitsInner") :
53  return self.innerTrack().trackerExpectedHitsInner().numberOfLostHits()
54  else :
55  return self.innerTrack().hitPattern().numberOfHits(ROOT.reco.HitPattern.MISSING_INNER_HITS)
56 
def relIso
Definition: Lepton.py:43
def lostInner
Definition: Lepton.py:51
def relEffAreaIso
Definition: Lepton.py:47
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def absIso
Definition: Lepton.py:29
def sip3D
Definition: Lepton.py:10
def ip3D
Definition: Lepton.py:5
def absIsoFromEA
Definition: Lepton.py:14