CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
Electron.Electron Class Reference
Inheritance diagram for Electron.Electron:

Public Member Functions

def __init__
 
def absEffAreaIso
 
def chargedAllIso
 
def chargedAllIsoR
 
def chargedHadronIsoR
 
def cutBasedId
 
def dxy
 
def dz
 
def edxy
 
def edz
 
def electronID
 
def lostInner
 
def mvaId
 
def mvaIDLoose
 
def mvaIDRun2
 
def mvaIDTight
 
def mvaIDZZ
 
def mvaNonTrigV0
 
def mvaRun2
 
def mvaTrigNoIPV0
 
def mvaTrigV0
 
def neutralHadronIsoR
 
def p4
 
def photonIsoR
 
def puChargedHadronIsoR
 
def tightId
 

Public Attributes

 associatedVertex
 
 rho
 
 tightIdResult
 

Private Member Functions

def _physObjInit
 

Private Attributes

 _mvaNonTrigV0
 
 _mvaRun2
 
 _mvaTrigNoIPV0
 
 _mvaTrigV0
 

Detailed Description

Definition at line 5 of file Electron.py.

Constructor & Destructor Documentation

def Electron.Electron.__init__ (   self,
  args,
  kwargs 
)
Initializing tightIdResult to None. The user is responsible
for setting this attribute externally if he wants to use the tightId
function.

Definition at line 7 of file Electron.py.

References Electron.Electron._physObjInit().

7 
8  def __init__(self, *args, **kwargs):
9  '''Initializing tightIdResult to None. The user is responsible
10  for setting this attribute externally if he wants to use the tightId
11  function.'''
12  super(Electron, self).__init__(*args, **kwargs)
13  self._physObjInit()

Member Function Documentation

def Electron.Electron._physObjInit (   self)
private

Definition at line 14 of file Electron.py.

Referenced by Electron.Electron.__init__(), and Jet.Jet.__init__().

14 
15  def _physObjInit(self):
16  self.tightIdResult = None
17  self.associatedVertex = None
18  self.rho = None
19  self._mvaNonTrigV0 = {True:None, False:None}
20  self._mvaTrigV0 = {True:None, False:None}
21  self._mvaTrigNoIPV0 = {True:None, False:None}
22  self._mvaRun2 = {}
def Electron.Electron.absEffAreaIso (   self,
  rho,
  effectiveAreas 
)
MIKE, missing doc.
Should have the same name as the function in the mother class.
Can call the mother class function with super.

Definition at line 125 of file Electron.py.

References Lepton.Lepton.absIsoFromEA(), eta(), reco::Electron.superCluster(), reco::PreshowerClusterShape.superCluster(), reco::RecoEcalCandidate.superCluster(), reco::GsfElectronCore.superCluster(), reco::RecoCandidate.superCluster(), reco::Photon.superCluster(), reco::PhotonCore.superCluster(), pat::Photon.superCluster(), reco::SiStripElectron.superCluster(), pat::Electron.superCluster(), pat::GenericParticle.superCluster(), and reco::GsfElectron.superCluster().

Referenced by Lepton.Lepton.relEffAreaIso().

126  def absEffAreaIso(self,rho,effectiveAreas):
127  '''MIKE, missing doc.
128  Should have the same name as the function in the mother class.
129  Can call the mother class function with super.
130  '''
131  return self.absIsoFromEA(rho,self.superCluster().eta(),effectiveAreas.eGamma)
T eta() const
def Electron.Electron.chargedAllIso (   self)

Definition at line 230 of file Electron.py.

Referenced by Lepton.Lepton.absIso().

231  def chargedAllIso(self):
232  raise RuntimeError, "Electron chargedAllIso missing"
def Electron.Electron.chargedAllIsoR (   self,
  R = 0.4 
)

Definition at line 226 of file Electron.py.

Referenced by Muon.Muon.chargedAllIso().

227  def chargedAllIsoR(self,R=0.4):
228  if R == 0.3: return self.physObj.pfIsolationVariables().sumChargedParticlePt
229  raise RuntimeError, "Electron chargedAllIso missing for R=%s" % R
def Electron.Electron.chargedHadronIsoR (   self,
  R = 0.4 
)

Definition at line 211 of file Electron.py.

212  def chargedHadronIsoR(self,R=0.4):
213  if R == 0.3: return self.physObj.pfIsolationVariables().sumChargedHadronPt
214  elif R == 0.4: return self.physObj.chargedHadronIso()
215  raise RuntimeError, "Electron chargedHadronIso missing for R=%s" % R
def Electron.Electron.cutBasedId (   self,
  wp,
  showerShapes = "auto" 
)

Definition at line 41 of file Electron.py.

References funct.abs(), tauImpactParameter::TrackParticle.dxy, reco::PFTauTransverseImpactParameter.dxy(), PrimaryVertexMonitor.dxy, reco::Conversion.dxy(), pat::PackedGenParticle.dxy(), reco::TrackBase.dxy(), pat::PackedCandidate.dxy(), Electron.Electron.dxy(), pat::Tau.dxy(), tauImpactParameter::TrackParticle.dz, egammaisolation::EgammaTrackSelector.dz, DDHCalXtalAlgo.dz, RigidBodyAlignmentParameters.dz, BowedSurfaceAlignmentDerivatives.dz, DDHCalTestBeamAlgo.dz, BowedSurfaceAlignmentParameters.dz, TrackMultiSelector::Block.dz, DTMuonSLToSL.dz, IdealZDCTrapezoid.dz(), IdealZPrism.dz(), PreshowerStrip.dz(), IdealObliquePrism.dz(), IdealCastorTrapezoid.dz(), PrimaryVertexMonitor.dz, pat::VertexAssociation.dz(), TrackerValidationVariables::AVTrackStruct.dz, DTMuonMillepede.dz, DTSegmentResult.dz, DTHitResult.dz, EcalTrapezoidParameters.dz(), MuonGeometryArrange::MGACollection.dz, reco::Conversion.dz(), pat::PackedGenParticle.dz(), reco::TrackBase.dz(), pat::PackedCandidate.dz(), and Electron.Electron.dz().

Referenced by Electron.Electron.electronID().

41 
42  def cutBasedId(self, wp, showerShapes="auto"):
43  if "_full5x5" in wp:
44  showerShapes = "full5x5"
45  wp = wp.replace("_full5x5","")
46  elif showerShapes == "auto":
47  if "POG_CSA14_25ns_v1" in wp or "POG_CSA14_50ns_v1" in wp or "POG_PHYS14_25ns_v1" in wp or "POG_PHYS14_25ns_v1_ConvVeto" in wp or "POG_PHYS14_25ns_v1_ConvVetoDxyDz" in wp:
48  showerShapes = "full5x5"
49  vars = {
50  'dEtaIn' : abs(self.physObj.deltaEtaSuperClusterTrackAtVtx()),
51  'dPhiIn' : abs(self.physObj.deltaPhiSuperClusterTrackAtVtx()),
52  'sigmaIEtaIEta' : self.physObj.full5x5_sigmaIetaIeta() if showerShapes == "full5x5" else self.physObj.sigmaIetaIeta(),
53  'H/E' : self.physObj.hadronicOverEm(),
54  #'1/E-1/p' : abs(1.0/self.physObj.ecalEnergy() - self.physObj.eSuperClusterOverP()/self.physObj.ecalEnergy()),
55  '1/E-1/p' : abs(1.0/self.physObj.ecalEnergy() - self.physObj.eSuperClusterOverP()/self.physObj.ecalEnergy()) if self.physObj.ecalEnergy()>0. else 9e9,
56  'conversionVeto' : self.physObj.passConversionVeto(),
57  'missingHits' : self.physObj.gsfTrack().hitPattern().numberOfHits(ROOT.reco.HitPattern.MISSING_INNER_HITS), # http://cmslxr.fnal.gov/source/DataFormats/TrackReco/interface/HitPattern.h?v=CMSSW_7_2_3#0153
58  'dxy' : abs(self.dxy()),
59  'dz' : abs(self.dz()),
60  }
61  WP = {
62  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/EgammaCutBasedIdentification?rev=31
63  'POG_2012_Veto' : [('dEtaIn', [0.007, 0.01]), ('dPhiIn', [0.8, 0.7 ]), ('sigmaIEtaIEta', [0.01, 0.03]), ('H/E', [0.15, 9e9]), ('1/E-1/p', [9e9, 9e9])],
64  'POG_2012_Loose' : [('dEtaIn', [0.007, 0.009]), ('dPhiIn', [0.15, 0.1 ]), ('sigmaIEtaIEta', [0.01, 0.03]), ('H/E', [0.12, 0.1]), ('1/E-1/p', [0.05, 0.05])],
65  'POG_2012_Medium' : [('dEtaIn', [0.004, 0.007]), ('dPhiIn', [0.06, 0.03]), ('sigmaIEtaIEta', [0.01, 0.03]), ('H/E', [0.12, 0.1]), ('1/E-1/p', [0.05, 0.05])],
66  'POG_2012_Tight' : [('dEtaIn', [0.004, 0.005]), ('dPhiIn', [0.03, 0.02]), ('sigmaIEtaIEta', [0.01, 0.03]), ('H/E', [0.12, 0.1]), ('1/E-1/p', [0.05, 0.05])],
67  # RIC: in the EG POG WPs, isolation is included too. Here only the pure ID part.
68  # dz and d0 cuts are excluded here as well.
69  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_CSA14_samples?rev=13
70  'POG_CSA14_25ns_v1_Veto' : [('dEtaIn', [0.017938, 0.014569]), ('dPhiIn', [0.182958, 0.230914]), ('sigmaIEtaIEta', [0.012708, 0.036384]), ('H/E', [0.335015, 0.200792]), ('1/E-1/p', [0.198287, 0.146856])],
71  'POG_CSA14_25ns_v1_Loose' : [('dEtaIn', [0.014928, 0.013045]), ('dPhiIn', [0.141050, 0.149017]), ('sigmaIEtaIEta', [0.011304, 0.035536]), ('H/E', [0.127690, 0.107898]), ('1/E-1/p', [0.097806, 0.102261])],
72  'POG_CSA14_25ns_v1_Medium' : [('dEtaIn', [0.013071, 0.010006]), ('dPhiIn', [0.132113, 0.052321]), ('sigmaIEtaIEta', [0.010726, 0.032882]), ('H/E', [0.109761, 0.101755]), ('1/E-1/p', [0.032639, 0.041427])],
73  'POG_CSA14_25ns_v1_Tight' : [('dEtaIn', [0.012671, 0.008823]), ('dPhiIn', [0.025218, 0.027286]), ('sigmaIEtaIEta', [0.010061, 0.030222]), ('H/E', [0.065085, 0.090710]), ('1/E-1/p', [0.027873, 0.019404])],
74  'POG_CSA14_50ns_v1_Veto' : [('dEtaIn', [0.021, 0.028]), ('dPhiIn', [0.25 , 0.23 ]), ('sigmaIEtaIEta', [0.012, 0.035]), ('H/E', [0.24 , 0.19 ]), ('1/E-1/p', [0.32 , 0.13 ])],
75  'POG_CSA14_50ns_v1_Loose' : [('dEtaIn', [0.016, 0.025]), ('dPhiIn', [0.080, 0.097]), ('sigmaIEtaIEta', [0.012, 0.032]), ('H/E', [0.15 , 0.12 ]), ('1/E-1/p', [0.11 , 0.11 ])],
76  'POG_CSA14_50ns_v1_Medium' : [('dEtaIn', [0.015, 0.023]), ('dPhiIn', [0.051, 0.056]), ('sigmaIEtaIEta', [0.010, 0.030]), ('H/E', [0.10 , 0.099]), ('1/E-1/p', [0.053, 0.11 ])],
77  'POG_CSA14_50ns_v1_Tight' : [('dEtaIn', [0.012, 0.019]), ('dPhiIn', [0.024, 0.043]), ('sigmaIEtaIEta', [0.010, 0.029]), ('H/E', [0.074, 0.080]), ('1/E-1/p', [0.026, 0.076])],
78  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_PHYS14_sample?rev=13
79  'POG_PHYS14_25ns_v1_Veto' : [('dEtaIn', [0.016315, 0.010671]), ('dPhiIn', [0.252044, 0.245263]), ('sigmaIEtaIEta', [0.011100 , 0.033987]), ('H/E', [0.345843, 0.134691]), ('1/E-1/p', [0.248070, 0.157160])],
80  'POG_PHYS14_25ns_v1_Loose' : [('dEtaIn', [0.012442, 0.010654]), ('dPhiIn', [0.072624, 0.145129]), ('sigmaIEtaIEta', [0.010557 , 0.032602]), ('H/E', [0.121476, 0.131862]), ('1/E-1/p', [0.221803, 0.142283])],
81  'POG_PHYS14_25ns_v1_Medium' : [('dEtaIn', [0.007641, 0.009285]), ('dPhiIn', [0.032643, 0.042447]), ('sigmaIEtaIEta', [0.010399 , 0.029524]), ('H/E', [0.060662, 0.104263]), ('1/E-1/p', [0.153897, 0.137468])],
82  'POG_PHYS14_25ns_v1_Tight' : [('dEtaIn', [0.006574, 0.005681]), ('dPhiIn', [0.022868, 0.032046]), ('sigmaIEtaIEta', [0.010181 , 0.028766]), ('H/E', [0.037553, 0.081902]), ('1/E-1/p', [0.131191, 0.106055])],
83  }
84  WP_conversion_veto = {
85  # missing Hits incremented by 1 because we return False if >=, note the '='
86  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_CSA14_samples?rev=13
87  'POG_CSA14_25ns_v1_ConvVeto_Veto' : WP['POG_CSA14_25ns_v1_Veto' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 4])],
88  'POG_CSA14_25ns_v1_ConvVeto_Loose' : WP['POG_CSA14_25ns_v1_Loose' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
89  'POG_CSA14_25ns_v1_ConvVeto_Medium' : WP['POG_CSA14_25ns_v1_Medium']+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
90  'POG_CSA14_25ns_v1_ConvVeto_Tight' : WP['POG_CSA14_25ns_v1_Tight' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
91  'POG_CSA14_50ns_v1_ConvVeto_Veto' : WP['POG_CSA14_50ns_v1_Veto' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 4])],
92  'POG_CSA14_50ns_v1_ConvVeto_Loose' : WP['POG_CSA14_50ns_v1_Loose' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
93  'POG_CSA14_50ns_v1_ConvVeto_Medium' : WP['POG_CSA14_50ns_v1_Medium']+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
94  'POG_CSA14_50ns_v1_ConvVeto_Tight' : WP['POG_CSA14_50ns_v1_Tight' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
95  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_PHYS14_sample?rev=13
96  'POG_PHYS14_25ns_v1_ConvVeto_Veto' : WP['POG_PHYS14_25ns_v1_Veto' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 4])],
97  'POG_PHYS14_25ns_v1_ConvVeto_Loose' : WP['POG_PHYS14_25ns_v1_Loose' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
98  'POG_PHYS14_25ns_v1_ConvVeto_Medium' : WP['POG_PHYS14_25ns_v1_Medium']+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
99  'POG_PHYS14_25ns_v1_ConvVeto_Tight' : WP['POG_PHYS14_25ns_v1_Tight' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
100  }
101 
102  WP.update(WP_conversion_veto)
103 
104  WP_conversion_veto_DxyDz = {
105  # missing Hits incremented by 1 because we return False if >=, note the '='
106  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_PHYS14_sample
107  'POG_PHYS14_25ns_v1_ConvVetoDxyDz_Veto' : WP['POG_PHYS14_25ns_v1_ConvVeto_Veto' ]+[('dxy',[0.060279, 0.273097]), ('dz',[0.800538, 0.885860])],
108  'POG_PHYS14_25ns_v1_ConvVetoDxyDz_Loose' : WP['POG_PHYS14_25ns_v1_ConvVeto_Loose' ]+[('dxy',[0.022664, 0.097358]), ('dz',[0.173670, 0.198444])],
109  'POG_PHYS14_25ns_v1_ConvVetoDxyDz_Medium' : WP['POG_PHYS14_25ns_v1_ConvVeto_Medium']+[('dxy',[0.011811, 0.051682]), ('dz',[0.070775, 0.180720])],
110  'POG_PHYS14_25ns_v1_ConvVetoDxyDz_Tight' : WP['POG_PHYS14_25ns_v1_ConvVeto_Tight' ]+[('dxy',[0.009924, 0.027261]), ('dz',[0.015310, 0.147154])],
111  }
112 
113  WP.update(WP_conversion_veto_DxyDz)
114 
115 
116  if wp not in WP:
117  raise RuntimeError, "Working point '%s' not yet implemented in Electron.py" % wp
118  for (cut_name,(cut_eb,cut_ee)) in WP[wp]:
119  if cut_name == 'conversionVeto':
120  if (cut_eb if self.physObj.isEB() else cut_ee) and not vars[cut_name]:
121  return False
122  elif vars[cut_name] >= (cut_eb if self.physObj.isEB() else cut_ee):
123  return False
124  return True
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def Electron.Electron.dxy (   self,
  vertex = None 
)
Returns dxy.
Computed using vertex (or self.associatedVertex if vertex not specified),
and the gsf track.

Definition at line 238 of file Electron.py.

References Electron.Electron.associatedVertex, reco::Electron.gsfTrack(), reco::GsfElectronCore.gsfTrack(), reco::RecoCandidate.gsfTrack(), pat::Electron.gsfTrack(), pat::GenericParticle.gsfTrack(), and reco::GsfElectron.gsfTrack().

Referenced by Electron.Electron.cutBasedId().

239  def dxy(self, vertex=None):
240  '''Returns dxy.
241  Computed using vertex (or self.associatedVertex if vertex not specified),
242  and the gsf track.
243  '''
244  if vertex is None:
245  vertex = self.associatedVertex
246  return self.gsfTrack().dxy( vertex.position() )
def Electron.Electron.dz (   self,
  vertex = None 
)
Returns dz.
Computed using vertex (or self.associatedVertex if vertex not specified),
and the gsf track.

Definition at line 257 of file Electron.py.

References Electron.Electron.associatedVertex, reco::Electron.gsfTrack(), reco::GsfElectronCore.gsfTrack(), reco::RecoCandidate.gsfTrack(), pat::Electron.gsfTrack(), pat::GenericParticle.gsfTrack(), and reco::GsfElectron.gsfTrack().

Referenced by Electron.Electron.cutBasedId().

258  def dz(self, vertex=None):
259  '''Returns dz.
260  Computed using vertex (or self.associatedVertex if vertex not specified),
261  and the gsf track.
262  '''
263  if vertex is None:
264  vertex = self.associatedVertex
265  return self.gsfTrack().dz( vertex.position() )
def Electron.Electron.edxy (   self)
returns the uncertainty on dxy (from gsf track)

Definition at line 247 of file Electron.py.

References reco::Electron.gsfTrack(), reco::GsfElectronCore.gsfTrack(), reco::RecoCandidate.gsfTrack(), pat::Electron.gsfTrack(), pat::GenericParticle.gsfTrack(), and reco::GsfElectron.gsfTrack().

248  def edxy(self):
249  '''returns the uncertainty on dxy (from gsf track)'''
250  return self.gsfTrack().dxyError()
def Electron.Electron.edz (   self)
returns the uncertainty on dxz (from gsf track)

Definition at line 266 of file Electron.py.

References reco::Electron.gsfTrack(), reco::GsfElectronCore.gsfTrack(), reco::RecoCandidate.gsfTrack(), pat::Electron.gsfTrack(), pat::GenericParticle.gsfTrack(), and reco::GsfElectron.gsfTrack().

267  def edz(self):
268  '''returns the uncertainty on dxz (from gsf track)'''
269  return self.gsfTrack().dzError()
270 
def Electron.Electron.electronID (   self,
  id,
  vertex = None,
  rho = None 
)

Definition at line 23 of file Electron.py.

References Electron.Electron.associatedVertex, Electron.Electron.cutBasedId(), pat::Electron.electronIDs(), Electron.Electron.mvaIDLoose(), Electron.Electron.mvaIDRun2(), Electron.Electron.mvaIDTight(), Electron.Electron.rho, AlignmentMonitorMuonSystemMap1D::MyResidual.rho, and objects.JetAnalyzer.JetAnalyzer.rho.

23 
24  def electronID( self, id, vertex=None, rho=None ):
25  if id is None or id == "": return True
26  if vertex == None and hasattr(self,'associatedVertex') and self.associatedVertex != None: vertex = self.associatedVertex
27  if rho == None and hasattr(self,'rho') and self.rho != None: rho = self.rho
28  if id == "POG_MVA_ID_NonTrig": return self.mvaIDLoose()
29  elif id == "POG_MVA_ID_Trig": return self.mvaIDTight()
30  elif id == "POG_MVA_ID_NonTrig_full5x5": return self.mvaIDLoose(full5x5=True)
31  elif id == "POG_MVA_ID_Trig_full5x5": return self.mvaIDTight(full5x5=True)
32  elif id == "POG_MVA_ID_Run2_NonTrig_VLoose": return self.mvaIDRun2("NonTrigPhys14","VLoose")
33  elif id == "POG_MVA_ID_Run2_NonTrig_Loose": return self.mvaIDRun2("NonTrigPhys14","Loose")
34  elif id == "POG_MVA_ID_Run2_NonTrig_Tight": return self.mvaIDRun2("NonTrigPhys14","Tight")
35  elif id.startswith("POG_Cuts_ID_"):
36  return self.cutBasedId(id.replace("POG_Cuts_ID_","POG_"))
37  for ID in self.electronIDs():
38  if ID.first == id:
39  return ID.second
40  raise RuntimeError, "Electron id '%s' not yet implemented in Electron.py" % id
def Electron.Electron.lostInner (   self)

Definition at line 271 of file Electron.py.

References reco::Electron.gsfTrack(), reco::GsfElectronCore.gsfTrack(), reco::RecoCandidate.gsfTrack(), pat::Electron.gsfTrack(), pat::GenericParticle.gsfTrack(), and reco::GsfElectron.gsfTrack().

272  def lostInner(self) :
273  if hasattr(self.gsfTrack(),"trackerExpectedHitsInner") :
return self.gsfTrack().trackerExpectedHitsInner().numberOfLostHits()
def Electron.Electron.mvaId (   self)

Definition at line 132 of file Electron.py.

References Electron.Electron.mvaNonTrigV0().

133  def mvaId( self ):
134  return self.mvaNonTrigV0()
def Electron.Electron.mvaIDLoose (   self,
  full5x5 = False 
)

Definition at line 178 of file Electron.py.

References funct.abs(), eta(), Electron.Electron.mvaNonTrigV0(), mypt.pt, res::HelperElectron.pt(), res::HelperMuon.pt(), res::HelperJet.pt(), reco::VoronoiBackground.pt(), RecoObj.pt, tauImpactParameter::LorentzVectorParticle.pt, ScoutingParticle.pt(), L1MuCSCPtLut.pt(), Residual1DHit.pt, reco::MuonMETCorrectionData.pt(), PtHatReweightUserHook.pt, PtEtaPhiMass.pt(), MatchStruct.pt, ALILine.pt(), ScoutingCaloJet.pt(), L2TauPixelTrackMatch::TinyTrack.pt, TrackMultiSelector::Block.pt, ScoutingPFJet.pt(), DTMuonLocalAlignment.pt, ElectronMVAEstimator.pt, TtFullHadSignalSel.pt(), PGlobalSimHit::Trk.pt, lhef::JetClustering::Jet.pt(), ZMuMuIsolationAnalyzer.pt, PatTrackAnalyzer::Plots.pt, TrackerValidationVariables::AVTrackStruct.pt, jpt::Map.pt(), SiStripLAProfileBooker.pt, PhysicsObjectsMonitor.pt, reco::CaloMuon.pt(), trigger::TriggerObject.pt(), BSTrkParameters.pt(), ElectronMVAEstimatorRun2Phys14NonTrig::AllVariables.pt, goodseedhelpers::HeavyObjectCache.pt, MuScleFitMuon.pt(), SoftElectronMVAEstimator.pt, PTrajectoryStateOnDet.pt(), ValidationMisalignedTracker.pt, HTrackVariables.pt(), SimpleL1MuGMTCand.pt(), HepLine3D.pt(), L1MuDTTrack.pt(), ElectronMVAEstimatorRun2Spring15NonTrig::AllVariables.pt, TrajectoryStateClosestToPoint.pt(), MuonDTLocalMillepedeAlgorithm.pt, susybsm::HSCParticle.pt(), PhotonPair.pt(), QualityCutsAnalyzer::histogram_element_t.pt, MuonGmtPair.pt(), reco::PreId.pt(), Lepton.pt, reco::Candidate.pt(), egHLT::OffPho.pt(), reco::Particle.pt(), reco::ParticleState.pt(), TrackingParticle.pt(), pat::PackedGenParticle.pt(), contrib::CMSBoostedTauSeedingAlgorithmStructure.pt(), PtHatRapReweightUserHook.pt, pat::PackedCandidate.pt(), MuonResidualsFitter::MuonAlignmentTreeRow.pt, AlignmentMonitorMuonSystemMap1D::MyTrack.pt, reco::LeafCandidate.pt(), CandidateWithRef< Ref >.pt(), reco::PFCluster.pt(), pat::MET::Vector2.pt(), GoodSeedProducer.pt, reco::TrackBase.pt(), PMuonSimHit::Trk.pt, PTrackerSimHit::Trk.pt, reco::Electron.superCluster(), reco::PreshowerClusterShape.superCluster(), reco::RecoEcalCandidate.superCluster(), reco::GsfElectronCore.superCluster(), reco::RecoCandidate.superCluster(), reco::Photon.superCluster(), reco::PhotonCore.superCluster(), pat::Photon.superCluster(), pat::Electron.superCluster(), reco::SiStripElectron.superCluster(), pat::GenericParticle.superCluster(), and reco::GsfElectron.superCluster().

Referenced by Electron.Electron.electronID(), and Electron.Electron.mvaIDZZ().

179  def mvaIDLoose(self, full5x5=False):
180  eta = abs(self.superCluster().eta())
181  if self.pt() < 10:
182  if (eta < 0.8) : return self.mvaNonTrigV0(full5x5) > +0.47;
183  elif (eta < 1.479): return self.mvaNonTrigV0(full5x5) > +0.004;
184  else : return self.mvaNonTrigV0(full5x5) > +0.295;
185  else:
186  if (eta < 0.8) : return self.mvaNonTrigV0(full5x5) > -0.34;
187  elif (eta < 1.479): return self.mvaNonTrigV0(full5x5) > -0.65;
188  else : return self.mvaNonTrigV0(full5x5) > +0.60;
T eta() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def Electron.Electron.mvaIDRun2 (   self,
  name,
  wp 
)

Definition at line 189 of file Electron.py.

References funct.abs(), eta(), Electron.Electron.mvaRun2(), reco::Electron.superCluster(), reco::PreshowerClusterShape.superCluster(), reco::RecoEcalCandidate.superCluster(), reco::GsfElectronCore.superCluster(), reco::RecoCandidate.superCluster(), reco::Photon.superCluster(), reco::PhotonCore.superCluster(), pat::Photon.superCluster(), reco::SiStripElectron.superCluster(), pat::Electron.superCluster(), pat::GenericParticle.superCluster(), and reco::GsfElectron.superCluster().

Referenced by Electron.Electron.electronID().

190  def mvaIDRun2(self, name, wp):
191  eta = abs(self.superCluster().eta())
192  if name == "NonTrigPhys14":
193  if wp=="Loose":
194  if (eta < 0.8) : return self.mvaRun2(name) > +0.35;
195  elif (eta < 1.479): return self.mvaRun2(name) > +0.20;
196  else : return self.mvaRun2(name) > -0.52;
197  elif wp=="VLoose":
198  if (eta < 0.8) : return self.mvaRun2(name) > -0.11;
199  elif (eta < 1.479): return self.mvaRun2(name) > -0.35;
200  else : return self.mvaRun2(name) > -0.55;
201  elif wp=="Tight":
202  if (eta < 0.8) : return self.mvaRun2(name) > 0.73;
203  elif (eta < 1.479): return self.mvaRun2(name) > 0.57;
204  else : return self.mvaRun2(name) > 0.05;
205  else: raise RuntimeError, "Ele MVA ID Working point not found"
206  else: raise RuntimeError, "Ele MVA ID type not found"
207 
T eta() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def Electron.Electron.mvaIDTight (   self,
  full5x5 = False 
)

Definition at line 167 of file Electron.py.

References funct.abs(), eta(), Electron.Electron.mvaTrigV0(), mypt.pt, res::HelperElectron.pt(), res::HelperMuon.pt(), res::HelperJet.pt(), reco::VoronoiBackground.pt(), RecoObj.pt, tauImpactParameter::LorentzVectorParticle.pt, ScoutingParticle.pt(), L1MuCSCPtLut.pt(), Residual1DHit.pt, reco::MuonMETCorrectionData.pt(), PtHatReweightUserHook.pt, PtEtaPhiMass.pt(), MatchStruct.pt, ALILine.pt(), ScoutingCaloJet.pt(), L2TauPixelTrackMatch::TinyTrack.pt, TrackMultiSelector::Block.pt, ScoutingPFJet.pt(), DTMuonLocalAlignment.pt, ElectronMVAEstimator.pt, TtFullHadSignalSel.pt(), PGlobalSimHit::Trk.pt, lhef::JetClustering::Jet.pt(), ZMuMuIsolationAnalyzer.pt, PatTrackAnalyzer::Plots.pt, TrackerValidationVariables::AVTrackStruct.pt, jpt::Map.pt(), SiStripLAProfileBooker.pt, PhysicsObjectsMonitor.pt, reco::CaloMuon.pt(), trigger::TriggerObject.pt(), BSTrkParameters.pt(), ElectronMVAEstimatorRun2Phys14NonTrig::AllVariables.pt, goodseedhelpers::HeavyObjectCache.pt, MuScleFitMuon.pt(), SoftElectronMVAEstimator.pt, PTrajectoryStateOnDet.pt(), ValidationMisalignedTracker.pt, HTrackVariables.pt(), SimpleL1MuGMTCand.pt(), HepLine3D.pt(), L1MuDTTrack.pt(), ElectronMVAEstimatorRun2Spring15NonTrig::AllVariables.pt, TrajectoryStateClosestToPoint.pt(), MuonDTLocalMillepedeAlgorithm.pt, susybsm::HSCParticle.pt(), PhotonPair.pt(), QualityCutsAnalyzer::histogram_element_t.pt, MuonGmtPair.pt(), reco::PreId.pt(), Lepton.pt, reco::Candidate.pt(), egHLT::OffPho.pt(), reco::Particle.pt(), reco::ParticleState.pt(), TrackingParticle.pt(), pat::PackedGenParticle.pt(), contrib::CMSBoostedTauSeedingAlgorithmStructure.pt(), PtHatRapReweightUserHook.pt, pat::PackedCandidate.pt(), MuonResidualsFitter::MuonAlignmentTreeRow.pt, AlignmentMonitorMuonSystemMap1D::MyTrack.pt, reco::LeafCandidate.pt(), CandidateWithRef< Ref >.pt(), reco::PFCluster.pt(), pat::MET::Vector2.pt(), GoodSeedProducer.pt, reco::TrackBase.pt(), PMuonSimHit::Trk.pt, PTrackerSimHit::Trk.pt, reco::Electron.superCluster(), reco::PreshowerClusterShape.superCluster(), reco::RecoEcalCandidate.superCluster(), reco::GsfElectronCore.superCluster(), reco::RecoCandidate.superCluster(), reco::Photon.superCluster(), reco::PhotonCore.superCluster(), pat::Photon.superCluster(), pat::Electron.superCluster(), reco::SiStripElectron.superCluster(), pat::GenericParticle.superCluster(), and reco::GsfElectron.superCluster().

Referenced by Electron.Electron.electronID().

168  def mvaIDTight(self, full5x5=False):
169  eta = abs(self.superCluster().eta())
170  if self.pt() < 20:
171  if (eta < 0.8) : return self.mvaTrigV0(full5x5) > +0.00;
172  elif (eta < 1.479): return self.mvaTrigV0(full5x5) > +0.10;
173  else : return self.mvaTrigV0(full5x5) > +0.62;
174  else:
175  if (eta < 0.8) : return self.mvaTrigV0(full5x5) > +0.94;
176  elif (eta < 1.479): return self.mvaTrigV0(full5x5) > +0.85;
177  else : return self.mvaTrigV0(full5x5) > +0.92;
T eta() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def Electron.Electron.mvaIDZZ (   self)

Definition at line 208 of file Electron.py.

References reco::Electron.gsfTrack(), reco::GsfElectronCore.gsfTrack(), reco::RecoCandidate.gsfTrack(), pat::Electron.gsfTrack(), pat::GenericParticle.gsfTrack(), reco::GsfElectron.gsfTrack(), and Electron.Electron.mvaIDLoose().

209  def mvaIDZZ(self):
210  return self.mvaIDLoose() and (self.gsfTrack().trackerExpectedHitsInner().numberOfLostHits()<=1)
def Electron.Electron.mvaNonTrigV0 (   self,
  full5x5 = False,
  debug = False 
)

Definition at line 138 of file Electron.py.

References Electron.Electron._mvaNonTrigV0, Electron.Electron.associatedVertex, ElectronMVAID.ElectronMVAID_NonTrig, PhysicsObject.PhysicsObject.physObj, Electron.Electron.rho, AlignmentMonitorMuonSystemMap1D::MyResidual.rho, and objects.JetAnalyzer.JetAnalyzer.rho.

Referenced by Electron.Electron.mvaId(), and Electron.Electron.mvaIDLoose().

139  def mvaNonTrigV0( self, full5x5=False, debug = False ):
140  if self._mvaNonTrigV0[full5x5] == None:
141  if self.associatedVertex == None: raise RuntimeError, "You need to set electron.associatedVertex before calling any MVA"
142  if self.rho == None: raise RuntimeError, "You need to set electron.rho before calling any MVA"
143  self._mvaNonTrigV0[full5x5] = ElectronMVAID_NonTrig(self.physObj, self.associatedVertex, self.rho, full5x5, debug)
144  return self._mvaNonTrigV0[full5x5]
tuple ElectronMVAID_NonTrig
def Electron.Electron.mvaRun2 (   self,
  name,
  debug = False 
)

Definition at line 159 of file Electron.py.

References Electron.Electron._mvaRun2, Electron.Electron.associatedVertex, PhysicsObject.PhysicsObject.physObj, Electron.Electron.rho, AlignmentMonitorMuonSystemMap1D::MyResidual.rho, and objects.JetAnalyzer.JetAnalyzer.rho.

Referenced by Electron.Electron.mvaIDRun2().

160  def mvaRun2( self, name, debug = False ):
161  if name not in self._mvaRun2:
162  if name not in ElectronMVAID_ByName: raise RuntimeError, "Unknown electron run2 mva id %s (known ones are: %s)\n" % (name, ElectronMVAID_ByName.keys())
163  if self.associatedVertex == None: raise RuntimeError, "You need to set electron.associatedVertex before calling any MVA"
164  if self.rho == None: raise RuntimeError, "You need to set electron.rho before calling any MVA"
165  self._mvaRun2[name] = ElectronMVAID_ByName[name](self.physObj, self.associatedVertex, self.rho, True, debug)
166  return self._mvaRun2[name]
def Electron.Electron.mvaTrigNoIPV0 (   self,
  full5x5 = False,
  debug = False 
)

Definition at line 152 of file Electron.py.

References Electron.Electron._mvaTrigNoIPV0, Electron.Electron.associatedVertex, ElectronMVAID.ElectronMVAID_TrigNoIP, PhysicsObject.PhysicsObject.physObj, Electron.Electron.rho, AlignmentMonitorMuonSystemMap1D::MyResidual.rho, and objects.JetAnalyzer.JetAnalyzer.rho.

153  def mvaTrigNoIPV0( self, full5x5=False, debug = False ):
154  if self._mvaTrigNoIPV0[full5x5] == None:
155  if self.associatedVertex == None: raise RuntimeError, "You need to set electron.associatedVertex before calling any MVA"
156  if self.rho == None: raise RuntimeError, "You need to set electron.rho before calling any MVA"
157  self._mvaTrigNoIPV0[full5x5] = ElectronMVAID_TrigNoIP(self.physObj, self.associatedVertex, self.rho, full5x5, debug)
158  return self._mvaTrigNoIPV0[full5x5]
tuple ElectronMVAID_TrigNoIP
def Electron.Electron.mvaTrigV0 (   self,
  full5x5 = False,
  debug = False 
)

Definition at line 145 of file Electron.py.

References Electron.Electron._mvaTrigV0, Electron.Electron.associatedVertex, ElectronMVAID.ElectronMVAID_Trig, PhysicsObject.PhysicsObject.physObj, Electron.Electron.rho, AlignmentMonitorMuonSystemMap1D::MyResidual.rho, and objects.JetAnalyzer.JetAnalyzer.rho.

Referenced by Electron.Electron.mvaIDTight().

146  def mvaTrigV0( self, full5x5=False, debug = False ):
147  if self._mvaTrigV0[full5x5] == None:
148  if self.associatedVertex == None: raise RuntimeError, "You need to set electron.associatedVertex before calling any MVA"
149  if self.rho == None: raise RuntimeError, "You need to set electron.rho before calling any MVA"
150  self._mvaTrigV0[full5x5] = ElectronMVAID_Trig(self.physObj, self.associatedVertex, self.rho, full5x5, debug)
151  return self._mvaTrigV0[full5x5]
tuple ElectronMVAID_Trig
def Electron.Electron.neutralHadronIsoR (   self,
  R = 0.4 
)

Definition at line 216 of file Electron.py.

217  def neutralHadronIsoR(self,R=0.4):
218  if R == 0.3: return self.physObj.pfIsolationVariables().sumNeutralHadronEt
219  elif R == 0.4: return self.physObj.neutralHadronIso()
220  raise RuntimeError, "Electron neutralHadronIso missing for R=%s" % R
def Electron.Electron.p4 (   self)

Definition at line 251 of file Electron.py.

References PhysicsObject.PhysicsObject.physObj.

Referenced by Tau.Tau.dxy_approx(), Tau.Tau.dz(), and Jet.Jet.jetID().

252  def p4(self):
253  return ROOT.reco.Candidate.p4(self.physObj)
254 
255 # def p4(self):
256 # return self.physObj.p4(self.physObj.candidateP4Kind()) # if kind == None else kind)
def Electron.Electron.photonIsoR (   self,
  R = 0.4 
)

Definition at line 221 of file Electron.py.

222  def photonIsoR(self,R=0.4):
223  if R == 0.3: return self.physObj.pfIsolationVariables().sumPhotonEt
224  elif R == 0.4: return self.physObj.photonIso()
225  raise RuntimeError, "Electron photonIso missing for R=%s" % R
def Electron.Electron.puChargedHadronIsoR (   self,
  R = 0.4 
)

Definition at line 233 of file Electron.py.

234  def puChargedHadronIsoR(self,R=0.4):
235  if R == 0.3: return self.physObj.pfIsolationVariables().sumPUPt
236  elif R == 0.4: return self.physObj.puChargedHadronIso()
237  raise RuntimeError, "Electron chargedHadronIso missing for R=%s" % R
def puChargedHadronIsoR
Definition: Electron.py:233
def Electron.Electron.tightId (   self)

Definition at line 135 of file Electron.py.

References Electron.Electron.tightIdResult.

136  def tightId( self ):
137  return self.tightIdResult

Member Data Documentation

Electron.Electron._mvaNonTrigV0
private

Definition at line 18 of file Electron.py.

Referenced by Electron.Electron.mvaNonTrigV0().

Electron.Electron._mvaRun2
private

Definition at line 21 of file Electron.py.

Referenced by Electron.Electron.mvaRun2().

Electron.Electron._mvaTrigNoIPV0
private

Definition at line 20 of file Electron.py.

Referenced by Electron.Electron.mvaTrigNoIPV0().

Electron.Electron._mvaTrigV0
private

Definition at line 19 of file Electron.py.

Referenced by Electron.Electron.mvaTrigV0().

Electron.Electron.associatedVertex

Definition at line 16 of file Electron.py.

Referenced by Tau.Tau.dxy(), Muon.Muon.dxy(), Electron.Electron.dxy(), Tau.Tau.dxy_approx(), Tau.Tau.dz(), Muon.Muon.dz(), Electron.Electron.dz(), Electron.Electron.electronID(), Electron.Electron.mvaNonTrigV0(), Electron.Electron.mvaRun2(), Electron.Electron.mvaTrigNoIPV0(), Electron.Electron.mvaTrigV0(), and Tau.Tau.zImpact().

Electron.Electron.rho

Definition at line 17 of file Electron.py.

Referenced by Lepton.Lepton.absIsoFromEA(), Electron.Electron.electronID(), Electron.Electron.mvaNonTrigV0(), Electron.Electron.mvaRun2(), Electron.Electron.mvaTrigNoIPV0(), and Electron.Electron.mvaTrigV0().

Electron.Electron.tightIdResult

Definition at line 15 of file Electron.py.

Referenced by Electron.Electron.tightId().