test
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 absIsoWithFSR
 
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 mvaNonTrigV0
 
def mvaRun2
 
def mvaTrigNoIPV0
 
def mvaTrigV0
 
def neutralHadronIsoR
 
def p4
 
def photonIsoR
 
def ptErr
 
def puChargedHadronIsoR
 
def tightId
 
def validCandidateP4Kind
 

Public Attributes

 associatedVertex
 
 rho
 
 tightIdResult
 

Private Member Functions

def _physObjInit
 

Private Attributes

 _mvaNonTrigV0
 
 _mvaRun2
 
 _mvaTrigNoIPV0
 
 _mvaTrigV0
 

Detailed Description

Definition at line 6 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 8 of file Electron.py.

References Electron.Electron._physObjInit().

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

Member Function Documentation

def Electron.Electron._physObjInit (   self)
private

Definition at line 15 of file Electron.py.

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

15 
16  def _physObjInit(self):
17  self.tightIdResult = None
18  self.associatedVertex = None
19  self.rho = None
20  self._mvaNonTrigV0 = {True:None, False:None}
21  self._mvaTrigV0 = {True:None, False:None}
22  self._mvaTrigNoIPV0 = {True:None, False:None}
23  self._mvaRun2 = {}
def Electron.Electron.absIsoWithFSR (   self,
  R = 0.4,
  puCorr = "rhoArea",
  dBetaFactor = 0.5 
)
Calculate Isolation, subtract FSR, apply specific PU corrections" 

Definition at line 347 of file Electron.py.

References Electron.Electron.chargedHadronIsoR(), deltaR(), EcalRegressionData.isEB(), CaloGenericDetId.isEB(), SimplePhoton.isEB(), SimpleElectron.isEB(), reco::Photon::FiducialFlags.isEB, reco::Photon.isEB(), reco::GsfElectron::FiducialFlags.isEB, reco::GsfElectron.isEB(), bookConverter.max, Electron.Electron.neutralHadronIsoR(), Electron.Electron.photonIsoR(), Electron.Electron.puChargedHadronIsoR(), python.rootplot.root2matplotlib.replace(), Electron.Electron.rho, correctionValue_class.rho, AlignmentMonitorMuonSystemMap1D::MyResidual.rho, and objects.JetAnalyzer.JetAnalyzer.rho.

348  def absIsoWithFSR(self, R=0.4, puCorr="rhoArea", dBetaFactor=0.5):
349  '''
350  Calculate Isolation, subtract FSR, apply specific PU corrections"
351  '''
352  photonIso = self.photonIsoR(R)
353  if hasattr(self,'fsrPhotons'):
354  for gamma in self.fsrPhotons:
355  dr = deltaR(gamma.eta(), gamma.phi(), self.physObj.eta(), self.physObj.phi())
356  if (self.isEB() or dr > 0.08) and dr < R:
357  photonIso = max(photonIso-gamma.pt(),0.0)
358  if puCorr == "deltaBeta":
359  offset = dBetaFactor * self.puChargedHadronIsoR(R)
360  elif puCorr == "rhoArea":
361  offset = self.rho*getattr(self,"EffectiveArea"+(str(R).replace(".","")))
362  elif puCorr in ["none","None",None]:
363  offset = 0
364  else:
365  raise RuntimeError("Unsupported PU correction scheme %s" % puCorr)
366  return self.chargedHadronIsoR(R)+max(0.,photonIso+self.neutralHadronIsoR(R)-offset)
367 
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
def puChargedHadronIsoR
Definition: Electron.py:341
def Electron.Electron.chargedAllIso (   self)

Definition at line 338 of file Electron.py.

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

Definition at line 334 of file Electron.py.

Referenced by Lepton.Lepton.absIsoR(), and Muon.Muon.chargedAllIso().

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

Definition at line 319 of file Electron.py.

Referenced by Lepton.Lepton.absIsoR(), Muon.Muon.absIsoWithFSR(), and Electron.Electron.absIsoWithFSR().

320  def chargedHadronIsoR(self,R=0.4):
321  if R == 0.3: return self.physObj.pfIsolationVariables().sumChargedHadronPt
322  elif R == 0.4: return self.physObj.chargedHadronIso()
323  raise RuntimeError("Electron chargedHadronIso missing for R=%s" % R)
def Electron.Electron.cutBasedId (   self,
  wp,
  showerShapes = "auto" 
)

Definition at line 48 of file Electron.py.

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

Referenced by Electron.Electron.electronID().

48 
49  def cutBasedId(self, wp, showerShapes="auto"):
50  if "_full5x5" in wp:
51  showerShapes = "full5x5"
52  wp = wp.replace("_full5x5","")
53  elif showerShapes == "auto":
54  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 or "POG_PHYS14_25ns_v2" in wp or "POG_PHYS14_25ns_v2_ConvVeto" in wp or "POG_PHYS14_25ns_v2_ConvVetoDxyDz" in wp or "POG_SPRING15_25ns_v1" in wp or "POG_SPRING15_25ns_v1_ConvVeto" in wp or "POG_SPRING15_25ns_v1_ConvVetoDxyDz" in wp or "POG_SPRING15_50ns_v2" in wp or "POG_SPRING15_50ns_v2_ConvVeto" in wp or "POG_SPRING15_50ns_v2_ConvVetoDxyDz" in wp:
55  showerShapes = "full5x5"
56  vars = {
57  'dEtaIn' : abs(self.physObj.deltaEtaSuperClusterTrackAtVtx()),
58  'dPhiIn' : abs(self.physObj.deltaPhiSuperClusterTrackAtVtx()),
59  'sigmaIEtaIEta' : self.physObj.full5x5_sigmaIetaIeta() if showerShapes == "full5x5" else self.physObj.sigmaIetaIeta(),
60  'H/E' : self.physObj.hadronicOverEm(),
61  #'1/E-1/p' : abs(1.0/self.physObj.ecalEnergy() - self.physObj.eSuperClusterOverP()/self.physObj.ecalEnergy()),
62  '1/E-1/p' : abs(1.0/self.physObj.ecalEnergy() - self.physObj.eSuperClusterOverP()/self.physObj.ecalEnergy()) if self.physObj.ecalEnergy()>0. else 9e9,
63  'conversionVeto' : self.physObj.passConversionVeto(),
64  '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
65  'dxy' : abs(self.dxy()),
66  'dz' : abs(self.dz()),
67  }
68  WP = {
69  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/EgammaCutBasedIdentification?rev=31
70  '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])],
71  '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])],
72  '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])],
73  '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])],
74  # RIC: in the EG POG WPs, isolation is included too. Here only the pure ID part.
75  # dz and d0 cuts are excluded here as well.
76  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_CSA14_samples?rev=13
77  '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])],
78  '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])],
79  '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])],
80  '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])],
81  '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 ])],
82  '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 ])],
83  '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 ])],
84  '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])],
85  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_PHYS14_sample?rev=13
86  '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])],
87  '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])],
88  '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])],
89  '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])],
90  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_PHYS14_sample?rev=17
91  'POG_PHYS14_25ns_v2_Veto' : [('dEtaIn', [0.013625, 0.011932]), ('dPhiIn', [0.230374, 0.255450]), ('sigmaIEtaIEta', [0.011586 , 0.031849]), ('H/E', [0.181130, 0.223870]), ('1/E-1/p', [0.295751, 0.155501])],
92  'POG_PHYS14_25ns_v2_Loose' : [('dEtaIn', [0.009277, 0.009833]), ('dPhiIn', [0.094739, 0.149934]), ('sigmaIEtaIEta', [0.010331 , 0.031838]), ('H/E', [0.093068, 0.115754]), ('1/E-1/p', [0.189968, 0.140662])],
93  'POG_PHYS14_25ns_v2_Medium' : [('dEtaIn', [0.008925, 0.007429]), ('dPhiIn', [0.035973, 0.067879]), ('sigmaIEtaIEta', [0.009996 , 0.030135]), ('H/E', [0.050537, 0.086782]), ('1/E-1/p', [0.091942, 0.100683])],
94  'POG_PHYS14_25ns_v2_Tight' : [('dEtaIn', [0.006046, 0.007057]), ('dPhiIn', [0.028092, 0.030159]), ('sigmaIEtaIEta', [0.009947 , 0.028237]), ('H/E', [0.045772, 0.067778]), ('1/E-1/p', [0.020118, 0.098919])],
95  ## ------- https://twiki.cern.ch/twiki/bin/view/CMS/CutBasedElectronIdentificationRun2?rev=24#Working_points_for_Spring15_MC_s
96  'POG_SPRING15_50ns_v2_Veto' : [('dEtaIn', [0.01260, 0.01090]), ('dPhiIn', [0.1070, 0.2190]), ('sigmaIEtaIEta', [0.0120, 0.0339]), ('H/E', [0.1860, 0.0962]), ('1/E-1/p', [0.2390, 0.141])],
97  'POG_SPRING15_50ns_v2_Loose' : [('dEtaIn', [0.00976, 0.00952]), ('dPhiIn', [0.0929, 0.1810]), ('sigmaIEtaIEta', [0.0105, 0.0318]), ('H/E', [0.0765, 0.0824]), ('1/E-1/p', [0.1840, 0.125])],
98  'POG_SPRING15_50ns_v2_Medium' : [('dEtaIn', [0.00940, 0.00773]), ('dPhiIn', [0.0296, 0.1480]), ('sigmaIEtaIEta', [0.0101, 0.0287]), ('H/E', [0.0372, 0.0546]), ('1/E-1/p', [0.1180, 0.104])],
99  'POG_SPRING15_50ns_v2_Tight' : [('dEtaIn', [0.00864, 0.00762]), ('dPhiIn', [0.0291, 0.0439]), ('sigmaIEtaIEta', [0.0101, 0.0287]), ('H/E', [0.0372, 0.0544]), ('1/E-1/p', [0.0116, 0.010])],
100  'POG_SPRING15_25ns_v1_Veto' : [('dEtaIn', [0.01520, 0.01130]), ('dPhiIn', [0.2160, 0.2370]), ('sigmaIEtaIEta', [0.0114, 0.0352]), ('H/E', [0.1810, 0.1160]), ('1/E-1/p', [0.2070, 0.17400])],
101  'POG_SPRING15_25ns_v1_Loose' : [('dEtaIn', [0.01050, 0.00814]), ('dPhiIn', [0.1150, 0.1820]), ('sigmaIEtaIEta', [0.0103, 0.0301]), ('H/E', [0.1040, 0.0897]), ('1/E-1/p', [0.1020, 0.12600])],
102  'POG_SPRING15_25ns_v1_Medium' : [('dEtaIn', [0.01030, 0.00733]), ('dPhiIn', [0.0336, 0.1140]), ('sigmaIEtaIEta', [0.0101, 0.0283]), ('H/E', [0.0876, 0.0678]), ('1/E-1/p', [0.0174, 0.08980])],
103  'POG_SPRING15_25ns_v1_Tight' : [('dEtaIn', [0.00926, 0.00724]), ('dPhiIn', [0.0336, 0.0918]), ('sigmaIEtaIEta', [0.0101, 0.0279]), ('H/E', [0.0597, 0.0615]), ('1/E-1/p', [0.0120, 0.00999])],
104 
105  }
106  WP_conversion_veto = {
107  # missing Hits incremented by 1 because we return False if >=, note the '='
108  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_CSA14_samples?rev=13
109  'POG_CSA14_25ns_v1_ConvVeto_Veto' : WP['POG_CSA14_25ns_v1_Veto' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 4])],
110  'POG_CSA14_25ns_v1_ConvVeto_Loose' : WP['POG_CSA14_25ns_v1_Loose' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
111  'POG_CSA14_25ns_v1_ConvVeto_Medium' : WP['POG_CSA14_25ns_v1_Medium']+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
112  'POG_CSA14_25ns_v1_ConvVeto_Tight' : WP['POG_CSA14_25ns_v1_Tight' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
113  'POG_CSA14_50ns_v1_ConvVeto_Veto' : WP['POG_CSA14_50ns_v1_Veto' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 4])],
114  'POG_CSA14_50ns_v1_ConvVeto_Loose' : WP['POG_CSA14_50ns_v1_Loose' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
115  'POG_CSA14_50ns_v1_ConvVeto_Medium' : WP['POG_CSA14_50ns_v1_Medium']+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
116  'POG_CSA14_50ns_v1_ConvVeto_Tight' : WP['POG_CSA14_50ns_v1_Tight' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
117  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_PHYS14_sample?rev=13
118  'POG_PHYS14_25ns_v1_ConvVeto_Veto' : WP['POG_PHYS14_25ns_v1_Veto' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 4])],
119  'POG_PHYS14_25ns_v1_ConvVeto_Loose' : WP['POG_PHYS14_25ns_v1_Loose' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
120  'POG_PHYS14_25ns_v1_ConvVeto_Medium' : WP['POG_PHYS14_25ns_v1_Medium']+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
121  'POG_PHYS14_25ns_v1_ConvVeto_Tight' : WP['POG_PHYS14_25ns_v1_Tight' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
122  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_PHYS14_sample?rev=17
123  'POG_PHYS14_25ns_v2_ConvVeto_Veto' : WP['POG_PHYS14_25ns_v2_Veto' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 4])],
124  'POG_PHYS14_25ns_v2_ConvVeto_Loose' : WP['POG_PHYS14_25ns_v2_Loose' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
125  'POG_PHYS14_25ns_v2_ConvVeto_Medium' : WP['POG_PHYS14_25ns_v2_Medium']+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
126  'POG_PHYS14_25ns_v2_ConvVeto_Tight' : WP['POG_PHYS14_25ns_v2_Tight' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
127  ## ------- https://twiki.cern.ch/twiki/bin/view/CMS/CutBasedElectronIdentificationRun2?rev=24#Working_points_for_Spring15_MC_s
128  'POG_SPRING15_50ns_v2_ConvVeto_Veto' : WP['POG_SPRING15_50ns_v2_Veto' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 4])],
129  'POG_SPRING15_50ns_v2_ConvVeto_Loose' : WP['POG_SPRING15_50ns_v2_Loose' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 2])],
130  'POG_SPRING15_50ns_v2_ConvVeto_Medium' : WP['POG_SPRING15_50ns_v2_Medium']+[('conversionVeto', [True, True]), ('missingHits', [3, 2])],
131  'POG_SPRING15_50ns_v2_ConvVeto_Tight' : WP['POG_SPRING15_50ns_v2_Tight' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 2])],
132  'POG_SPRING15_25ns_v1_ConvVeto_Veto' : WP['POG_SPRING15_25ns_v1_Veto' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 4])],
133  'POG_SPRING15_25ns_v1_ConvVeto_Loose' : WP['POG_SPRING15_25ns_v1_Loose' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 2])],
134  'POG_SPRING15_25ns_v1_ConvVeto_Medium' : WP['POG_SPRING15_25ns_v1_Medium']+[('conversionVeto', [True, True]), ('missingHits', [3, 2])],
135  'POG_SPRING15_25ns_v1_ConvVeto_Tight' : WP['POG_SPRING15_25ns_v1_Tight' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 2])],
136  }
137 
138  WP.update(WP_conversion_veto)
139 
140  WP_conversion_veto_DxyDz = {
141  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_PHYS14_sample
142  'POG_PHYS14_25ns_v1_ConvVetoDxyDz_Veto' : WP['POG_PHYS14_25ns_v1_ConvVeto_Veto' ]+[('dxy',[0.060279, 0.273097]), ('dz',[0.800538, 0.885860])],
143  'POG_PHYS14_25ns_v1_ConvVetoDxyDz_Loose' : WP['POG_PHYS14_25ns_v1_ConvVeto_Loose' ]+[('dxy',[0.022664, 0.097358]), ('dz',[0.173670, 0.198444])],
144  'POG_PHYS14_25ns_v1_ConvVetoDxyDz_Medium' : WP['POG_PHYS14_25ns_v1_ConvVeto_Medium']+[('dxy',[0.011811, 0.051682]), ('dz',[0.070775, 0.180720])],
145  'POG_PHYS14_25ns_v1_ConvVetoDxyDz_Tight' : WP['POG_PHYS14_25ns_v1_ConvVeto_Tight' ]+[('dxy',[0.009924, 0.027261]), ('dz',[0.015310, 0.147154])],
146  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_PHYS14_sample?rev=17
147  'POG_PHYS14_25ns_v2_ConvVetoDxyDz_Veto' : WP['POG_PHYS14_25ns_v2_ConvVeto_Veto' ]+[('dxy',[0.094095, 0.342293]), ('dz',[0.713070, 0.953461])],
148  'POG_PHYS14_25ns_v2_ConvVetoDxyDz_Loose' : WP['POG_PHYS14_25ns_v2_ConvVeto_Loose' ]+[('dxy',[0.035904, 0.099266]), ('dz',[0.075496, 0.197897])],
149  'POG_PHYS14_25ns_v2_ConvVetoDxyDz_Medium' : WP['POG_PHYS14_25ns_v2_ConvVeto_Medium']+[('dxy',[0.012235, 0.036719]), ('dz',[0.042020, 0.138142])],
150  'POG_PHYS14_25ns_v2_ConvVetoDxyDz_Tight' : WP['POG_PHYS14_25ns_v2_ConvVeto_Tight' ]+[('dxy',[0.008790, 0.027984]), ('dz',[0.021226, 0.133431])],
151  ## ------- https://twiki.cern.ch/twiki/bin/view/CMS/CutBasedElectronIdentificationRun2?rev=24#Working_points_for_Spring15_MC_s
152  'POG_SPRING15_50ns_v2_ConvVetoDxyDz_Veto' : WP['POG_SPRING15_50ns_v2_ConvVeto_Veto' ]+[('dxy',[0.0621, 0.2790]), ('dz',[0.613, 0.947])],
153  'POG_SPRING15_50ns_v2_ConvVetoDxyDz_Loose' : WP['POG_SPRING15_50ns_v2_ConvVeto_Loose' ]+[('dxy',[0.0227, 0.2420]), ('dz',[0.379, 0.921])],
154  'POG_SPRING15_50ns_v2_ConvVetoDxyDz_Medium' : WP['POG_SPRING15_50ns_v2_ConvVeto_Medium']+[('dxy',[0.0151, 0.0535]), ('dz',[0.238, 0.572])],
155  'POG_SPRING15_50ns_v2_ConvVetoDxyDz_Tight' : WP['POG_SPRING15_50ns_v2_ConvVeto_Tight' ]+[('dxy',[0.0144, 0.0377]), ('dz',[0.170, 0.571])],
156  'POG_SPRING15_25ns_v1_ConvVetoDxyDz_Veto' : WP['POG_SPRING15_25ns_v1_ConvVeto_Veto' ]+[('dxy',[0.0564, 0.2220]), ('dz',[0.472, 0.921])],
157  'POG_SPRING15_25ns_v1_ConvVetoDxyDz_Loose' : WP['POG_SPRING15_25ns_v1_ConvVeto_Loose' ]+[('dxy',[0.0261, 0.1180]), ('dz',[0.410, 0.822])],
158  'POG_SPRING15_25ns_v1_ConvVetoDxyDz_Medium' : WP['POG_SPRING15_25ns_v1_ConvVeto_Medium']+[('dxy',[0.0118, 0.0739]), ('dz',[0.373, 0.602])],
159  'POG_SPRING15_25ns_v1_ConvVetoDxyDz_Tight' : WP['POG_SPRING15_25ns_v1_ConvVeto_Tight' ]+[('dxy',[0.0111, 0.0351]), ('dz',[0.0466,0.417])],
160  }
161 
162  WP.update(WP_conversion_veto_DxyDz)
163 
164 
165  if wp not in WP:
166  raise RuntimeError("Working point '%s' not yet implemented in Electron.py" % wp)
167  for (cut_name,(cut_eb,cut_ee)) in WP[wp]:
168  if cut_name == 'conversionVeto':
169  if (cut_eb if self.physObj.isEB() else cut_ee) and not vars[cut_name]:
170  return False
171  elif vars[cut_name] >= (cut_eb if self.physObj.isEB() else cut_ee):
172  return False
173  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 368 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().

369  def dxy(self, vertex=None):
370  '''Returns dxy.
371  Computed using vertex (or self.associatedVertex if vertex not specified),
372  and the gsf track.
373  '''
374  if vertex is None:
375  vertex = self.associatedVertex
376  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 387 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().

388  def dz(self, vertex=None):
389  '''Returns dz.
390  Computed using vertex (or self.associatedVertex if vertex not specified),
391  and the gsf track.
392  '''
393  if vertex is None:
394  vertex = self.associatedVertex
395  return self.gsfTrack().dz( vertex.position() )
def Electron.Electron.edxy (   self)
returns the uncertainty on dxy (from gsf track)

Definition at line 377 of file Electron.py.

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

378  def edxy(self):
379  '''returns the uncertainty on dxy (from gsf track)'''
380  return self.gsfTrack().dxyError()
def Electron.Electron.edz (   self)
returns the uncertainty on dxz (from gsf track)

Definition at line 396 of file Electron.py.

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

397  def edz(self):
398  '''returns the uncertainty on dxz (from gsf track)'''
399  return self.gsfTrack().dzError()
400 
def Electron.Electron.electronID (   self,
  id,
  vertex = None,
  rho = None 
)

Definition at line 24 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, correctionValue_class.rho, AlignmentMonitorMuonSystemMap1D::MyResidual.rho, and objects.JetAnalyzer.JetAnalyzer.rho.

24 
25  def electronID( self, id, vertex=None, rho=None ):
26  if id is None or id == "": return True
27  if vertex == None and hasattr(self,'associatedVertex') and self.associatedVertex != None: vertex = self.associatedVertex
28  if rho == None and hasattr(self,'rho') and self.rho != None: rho = self.rho
29  if id == "POG_MVA_ID_NonTrig": return self.mvaIDLoose()
30  elif id == "POG_MVA_ID_Trig": return self.mvaIDTight()
31  elif id == "POG_MVA_ID_NonTrig_full5x5": return self.mvaIDLoose(full5x5=True)
32  elif id == "POG_MVA_ID_Trig_full5x5": return self.mvaIDTight(full5x5=True)
33  elif id == "POG_MVA_ID_Phys14_NonTrig_VLoose": return self.mvaIDRun2("NonTrigPhys14","VLoose")
34  elif id == "POG_MVA_ID_Phys14_NonTrig_Loose": return self.mvaIDRun2("NonTrigPhys14","Loose")
35  elif id == "POG_MVA_ID_Phys14_NonTrig_Tight": return self.mvaIDRun2("NonTrigPhys14","Tight")
36  elif id == "POG_MVA_ID_Spring15_NonTrig_VLoose": return self.mvaIDRun2("NonTrigSpring15MiniAOD","VLoose")
37  elif id == "POG_MVA_ID_Spring15_NonTrig_VLooseIdEmu": return self.mvaIDRun2("NonTrigSpring15MiniAOD","VLooseIdEmu")
38  elif id == "POG_MVA_ID_Spring15_NonTrig_VLooseIdIsoEmu": return self.mvaIDRun2("NonTrigSpring15MiniAOD","VLooseIdIsoEmu")
39  elif id == "POG_MVA_ID_Spring15_NonTrig_Tight": return self.mvaIDRun2("NonTrigSpring15MiniAOD","Tight")
40  elif id == "MVA_ID_NonTrig_Phys14Fix_HZZ": return self.mvaIDRun2("NonTrigPhys14Fix","HZZ")
41  elif id == "MVA_ID_NonTrig_Spring15_HZZ": return self.mvaIDRun2("NonTrigSpring15MiniAOD","HZZ")
42  elif id.startswith("POG_Cuts_ID_"):
43  return self.cutBasedId(id.replace("POG_Cuts_ID_","POG_"))
44  for ID in self.electronIDs():
45  if ID.first == id:
46  return ID.second
47  raise RuntimeError("Electron id '%s' not yet implemented in Electron.py" % id)
def Electron.Electron.lostInner (   self)

Definition at line 401 of file Electron.py.

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

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

Definition at line 174 of file Electron.py.

References Electron.Electron.mvaNonTrigV0().

175  def mvaId( self ):
176  return self.mvaNonTrigV0()
def Electron.Electron.mvaIDLoose (   self,
  full5x5 = False 
)

Definition at line 227 of file Electron.py.

References funct.abs(), eta, Electron.Electron.mvaNonTrigV0(), eetest::CandForTest.pt(), mypt.pt, res::HelperMuon.pt(), res::HelperElectron.pt(), res::HelperJet.pt(), reco::VoronoiBackground.pt(), RecoObj.pt, ScoutingParticle.pt(), tauImpactParameter::LorentzVectorParticle.pt, L1MuCSCPtLut.pt(), ScoutingPhoton.pt(), reco::MuonMETCorrectionData.pt(), Residual1DHit.pt, ScoutingElectron.pt(), MatchStruct.pt, PtEtaPhiMass.pt(), PtHatReweightUserHook.pt, MySimTrack.pt, ALILine.pt(), ScoutingMuon.pt(), ScoutingCaloJet.pt(), L2TauPixelTrackMatch::TinyTrack.pt, ResonanceBuilder.Resonance.pt(), TrackMultiSelector::Block.pt, ScoutingPFJet.pt(), DTMuonLocalAlignment.pt, ElectronMVAEstimator.pt, TtFullHadSignalSel.pt(), PGlobalSimHit::Trk.pt, L1Analysis::L1AnalysisRecoTauDataFormat.pt, L1Analysis::L1AnalysisRecoMuon2DataFormat.pt, ZMuMuIsolationAnalyzer.pt, L1Analysis::L1AnalysisRecoElectronDataFormat.pt, PatTrackAnalyzer::Plots.pt, reco::CaloMuon.pt(), jpt::Map.pt(), SiStripLAProfileBooker.pt, PhysicsObjectsMonitor.pt, trigger::TriggerObject.pt(), TrackerValidationVariables::AVTrackStruct.pt, BSTrkParameters.pt(), ElectronMVAEstimatorRun2Phys14NonTrig::AllVariables.pt, goodseedhelpers::HeavyObjectCache.pt, MuScleFitMuon.pt(), SoftElectronMVAEstimator.pt, SimpleL1MuGMTCand.pt(), PTrajectoryStateOnDet.pt(), ValidationMisalignedTracker.pt, HTrackVariables.pt(), HepLine3D.pt(), L1MuDTTrack.pt(), ElectronMVAEstimatorRun2Spring15NonTrig::AllVariables.pt, TrajectoryStateClosestToPoint.pt(), L1MuBMTrack.pt(), ElectronMVAEstimatorRun2Spring15Trig::AllVariables.pt, MuonDTLocalMillepedeAlgorithm.pt, BPhysicsValidation::ParticleMonitor.pt, L1TMuon::InternalTrack.pt, MuonGmtPair.pt(), susybsm::HSCParticle.pt(), PhotonPair.pt(), QualityCutsAnalyzer::histogram_element_t.pt, reco::PreId.pt(), Lepton.pt, reco::Candidate.pt(), egHLT::OffPho.pt(), reco::Particle.pt(), TrackStruct::TrackParameterStruct.pt, reco::ParticleState.pt(), contrib::CMSBoostedTauSeedingAlgorithmStructure.pt(), PtHatRapReweightUserHook.pt, MuonResidualsFitter::MuonAlignmentTreeRow.pt, CandidateWithRef< Ref >.pt(), AlignmentMonitorMuonSystemMap1D::MyTrack.pt, reco::LeafCandidate.pt(), reco::PFCluster.pt(), CosmicRateAnalyzer.pt, JetAnalyzer_HeavyIons_matching::MyJet.pt, l1t::EMTFTrack.pt, L1Analysis::L1AnalysisRecoMuonDataFormat.pt, TrackingParticle.pt(), pat::MET::Vector2.pt(), GoodSeedProducer.pt, pat::PackedGenParticle.pt(), reco::TrackBase.pt(), pat::PackedCandidate.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().

228  def mvaIDLoose(self, full5x5=False):
229  eta = abs(self.superCluster().eta())
230  if self.pt() < 10:
231  if (eta < 0.8) : return self.mvaNonTrigV0(full5x5) > +0.47;
232  elif (eta < 1.479): return self.mvaNonTrigV0(full5x5) > +0.004;
233  else : return self.mvaNonTrigV0(full5x5) > +0.295;
234  else:
235  if (eta < 0.8) : return self.mvaNonTrigV0(full5x5) > -0.34;
236  elif (eta < 1.479): return self.mvaNonTrigV0(full5x5) > -0.65;
237  else : return self.mvaNonTrigV0(full5x5) > +0.60;
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def Electron.Electron.mvaIDRun2 (   self,
  name,
  wp 
)

Definition at line 238 of file Electron.py.

References funct.abs(), eta, Electron.Electron.mvaRun2(), eetest::CandForTest.pt(), mypt.pt, res::HelperElectron.pt(), res::HelperMuon.pt(), res::HelperJet.pt(), reco::VoronoiBackground.pt(), RecoObj.pt, ScoutingParticle.pt(), tauImpactParameter::LorentzVectorParticle.pt, L1MuCSCPtLut.pt(), ScoutingPhoton.pt(), Residual1DHit.pt, reco::MuonMETCorrectionData.pt(), ScoutingElectron.pt(), MatchStruct.pt, PtHatReweightUserHook.pt, PtEtaPhiMass.pt(), MySimTrack.pt, ALILine.pt(), ScoutingMuon.pt(), ScoutingCaloJet.pt(), L2TauPixelTrackMatch::TinyTrack.pt, ResonanceBuilder.Resonance.pt(), TrackMultiSelector::Block.pt, ScoutingPFJet.pt(), DTMuonLocalAlignment.pt, ElectronMVAEstimator.pt, TtFullHadSignalSel.pt(), PGlobalSimHit::Trk.pt, L1Analysis::L1AnalysisRecoTauDataFormat.pt, L1Analysis::L1AnalysisRecoMuon2DataFormat.pt, ZMuMuIsolationAnalyzer.pt, L1Analysis::L1AnalysisRecoElectronDataFormat.pt, PatTrackAnalyzer::Plots.pt, reco::CaloMuon.pt(), jpt::Map.pt(), SiStripLAProfileBooker.pt, PhysicsObjectsMonitor.pt, trigger::TriggerObject.pt(), TrackerValidationVariables::AVTrackStruct.pt, BSTrkParameters.pt(), ElectronMVAEstimatorRun2Phys14NonTrig::AllVariables.pt, goodseedhelpers::HeavyObjectCache.pt, MuScleFitMuon.pt(), SoftElectronMVAEstimator.pt, SimpleL1MuGMTCand.pt(), PTrajectoryStateOnDet.pt(), ValidationMisalignedTracker.pt, HTrackVariables.pt(), HepLine3D.pt(), L1MuDTTrack.pt(), ElectronMVAEstimatorRun2Spring15NonTrig::AllVariables.pt, TrajectoryStateClosestToPoint.pt(), L1MuBMTrack.pt(), ElectronMVAEstimatorRun2Spring15Trig::AllVariables.pt, MuonDTLocalMillepedeAlgorithm.pt, BPhysicsValidation::ParticleMonitor.pt, L1TMuon::InternalTrack.pt, MuonGmtPair.pt(), susybsm::HSCParticle.pt(), PhotonPair.pt(), QualityCutsAnalyzer::histogram_element_t.pt, reco::PreId.pt(), Lepton.pt, reco::Candidate.pt(), egHLT::OffPho.pt(), reco::Particle.pt(), TrackStruct::TrackParameterStruct.pt, reco::ParticleState.pt(), contrib::CMSBoostedTauSeedingAlgorithmStructure.pt(), PtHatRapReweightUserHook.pt, MuonResidualsFitter::MuonAlignmentTreeRow.pt, AlignmentMonitorMuonSystemMap1D::MyTrack.pt, CandidateWithRef< Ref >.pt(), reco::LeafCandidate.pt(), reco::PFCluster.pt(), CosmicRateAnalyzer.pt, JetAnalyzer_HeavyIons_matching::MyJet.pt, l1t::EMTFTrack.pt, L1Analysis::L1AnalysisRecoMuonDataFormat.pt, TrackingParticle.pt(), pat::MET::Vector2.pt(), pat::PackedGenParticle.pt(), GoodSeedProducer.pt, reco::TrackBase.pt(), pat::PackedCandidate.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(), reco::SiStripElectron.superCluster(), pat::Electron.superCluster(), pat::GenericParticle.superCluster(), and reco::GsfElectron.superCluster().

Referenced by Electron.Electron.electronID().

239  def mvaIDRun2(self, name, wp):
240  eta = abs(self.superCluster().eta())
241  if name == "NonTrigPhys14":
242  if wp=="Loose":
243  if (eta < 0.8) : return self.mvaRun2(name) > +0.35;
244  elif (eta < 1.479): return self.mvaRun2(name) > +0.20;
245  else : return self.mvaRun2(name) > -0.52;
246  elif wp=="VLoose":
247  if (eta < 0.8) : return self.mvaRun2(name) > -0.11;
248  elif (eta < 1.479): return self.mvaRun2(name) > -0.35;
249  else : return self.mvaRun2(name) > -0.55;
250  elif wp=="Tight":
251  if (eta < 0.8) : return self.mvaRun2(name) > 0.73;
252  elif (eta < 1.479): return self.mvaRun2(name) > 0.57;
253  else : return self.mvaRun2(name) > 0.05;
254  else: raise RuntimeError, "Ele MVA ID Working point not found"
255  elif name == "NonTrigPhys14Fix":
256  if wp == "HZZ":
257  if self.pt() <= 10:
258  if eta < 0.8 : return self.mvaRun2(name) > -0.586;
259  elif eta < 1.479: return self.mvaRun2(name) > -0.712;
260  else : return self.mvaRun2(name) > -0.662;
261  else:
262  if eta < 0.8 : return self.mvaRun2(name) > -0.652;
263  elif eta < 1.479: return self.mvaRun2(name) > -0.701;
264  else : return self.mvaRun2(name) > -0.350;
265  else: raise RuntimeError, "Ele MVA ID Working point not found"
266  elif name in ("NonTrigSpring15","NonTrigSpring15MiniAOD"):
267  if wp=="VLoose":
268  if self.pt() <= 10:
269  if (eta < 0.8) : return self.mvaRun2(name) > -0.11;
270  elif (eta < 1.479): return self.mvaRun2(name) > -0.55;
271  else : return self.mvaRun2(name) > -0.60;
272  else:
273  if (eta < 0.8) : return self.mvaRun2(name) > -0.16;
274  elif (eta < 1.479): return self.mvaRun2(name) > -0.65;
275  else : return self.mvaRun2(name) > -0.74;
276  elif wp=="VLooseIdEmu":
277  if (eta < 0.8) : return self.mvaRun2(name) > -0.70;
278  elif (eta < 1.479): return self.mvaRun2(name) > -0.83;
279  else : return self.mvaRun2(name) > -0.92;
280  elif wp=="VLooseIdIsoEmu":
281  if (eta < 0.8) : return self.mvaRun2(name) > -0.155;
282  elif (eta < 1.479): return self.mvaRun2(name) > -0.56;
283  else : return self.mvaRun2(name) > -0.76;
284  elif wp=="Tight":
285  if (eta < 0.8) : return self.mvaRun2(name) > 0.87;
286  elif (eta < 1.479): return self.mvaRun2(name) > 0.60;
287  else : return self.mvaRun2(name) > 0.17;
288  elif wp == "HZZ":
289  if self.pt() <= 10:
290  if eta < 0.8 : return self.mvaRun2(name) > -0.265;
291  elif eta < 1.479: return self.mvaRun2(name) > -0.556;
292  else : return self.mvaRun2(name) > -0.551;
293  else:
294  if eta < 0.8 : return self.mvaRun2(name) > -0.072;
295  elif eta < 1.479: return self.mvaRun2(name) > -0.286;
296  else : return self.mvaRun2(name) > -0.267;
297  elif wp == "POG80":
298  if self.pt() > 10.:
299  if eta < 0.8: return self.mvaRun2(name) > 0.967083
300  elif eta < 1.479: return self.mvaRun2(name) > 0.929117
301  else: return self.mvaRun2(name) > 0.726311
302  else: # pt <= 10
303  if eta < 0.8: return self.mvaRun2(name) > 0.287435
304  elif eta < 1.479: return self.mvaRun2(name) > 0.221846
305  else: return self.mvaRun2(name) > -0.303263
306  elif wp == "POG90":
307  if self.pt() > 10.:
308  if eta < 0.8: return self.mvaRun2(name) > 0.913286
309  elif eta < 1.479: return self.mvaRun2(name) > 0.805013
310  else: return self.mvaRun2(name) > 0.358969
311  else: # pt <= 10
312  if eta < 0.8: return self.mvaRun2(name) > -0.083313
313  elif eta < 1.479: return self.mvaRun2(name) > -0.235222
314  else: return self.mvaRun2(name) > -0.67099
315  else: raise RuntimeError, "Ele MVA ID Working point not found"
316  else: raise RuntimeError, "Ele MVA ID type not found"
317 
318 
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def Electron.Electron.mvaIDTight (   self,
  full5x5 = False 
)

Definition at line 216 of file Electron.py.

References funct.abs(), eta, Electron.Electron.mvaTrigV0(), eetest::CandForTest.pt(), mypt.pt, res::HelperMuon.pt(), res::HelperElectron.pt(), res::HelperJet.pt(), reco::VoronoiBackground.pt(), RecoObj.pt, ScoutingParticle.pt(), tauImpactParameter::LorentzVectorParticle.pt, L1MuCSCPtLut.pt(), ScoutingPhoton.pt(), reco::MuonMETCorrectionData.pt(), Residual1DHit.pt, ScoutingElectron.pt(), MatchStruct.pt, PtEtaPhiMass.pt(), PtHatReweightUserHook.pt, MySimTrack.pt, ALILine.pt(), ScoutingMuon.pt(), ScoutingCaloJet.pt(), L2TauPixelTrackMatch::TinyTrack.pt, ResonanceBuilder.Resonance.pt(), TrackMultiSelector::Block.pt, ScoutingPFJet.pt(), DTMuonLocalAlignment.pt, ElectronMVAEstimator.pt, TtFullHadSignalSel.pt(), PGlobalSimHit::Trk.pt, L1Analysis::L1AnalysisRecoTauDataFormat.pt, L1Analysis::L1AnalysisRecoMuon2DataFormat.pt, ZMuMuIsolationAnalyzer.pt, L1Analysis::L1AnalysisRecoElectronDataFormat.pt, PatTrackAnalyzer::Plots.pt, reco::CaloMuon.pt(), jpt::Map.pt(), SiStripLAProfileBooker.pt, PhysicsObjectsMonitor.pt, trigger::TriggerObject.pt(), TrackerValidationVariables::AVTrackStruct.pt, BSTrkParameters.pt(), ElectronMVAEstimatorRun2Phys14NonTrig::AllVariables.pt, goodseedhelpers::HeavyObjectCache.pt, MuScleFitMuon.pt(), SoftElectronMVAEstimator.pt, SimpleL1MuGMTCand.pt(), PTrajectoryStateOnDet.pt(), ValidationMisalignedTracker.pt, HTrackVariables.pt(), HepLine3D.pt(), L1MuDTTrack.pt(), ElectronMVAEstimatorRun2Spring15NonTrig::AllVariables.pt, TrajectoryStateClosestToPoint.pt(), L1MuBMTrack.pt(), ElectronMVAEstimatorRun2Spring15Trig::AllVariables.pt, MuonDTLocalMillepedeAlgorithm.pt, BPhysicsValidation::ParticleMonitor.pt, L1TMuon::InternalTrack.pt, MuonGmtPair.pt(), susybsm::HSCParticle.pt(), PhotonPair.pt(), QualityCutsAnalyzer::histogram_element_t.pt, reco::PreId.pt(), Lepton.pt, reco::Candidate.pt(), egHLT::OffPho.pt(), reco::Particle.pt(), TrackStruct::TrackParameterStruct.pt, reco::ParticleState.pt(), contrib::CMSBoostedTauSeedingAlgorithmStructure.pt(), PtHatRapReweightUserHook.pt, MuonResidualsFitter::MuonAlignmentTreeRow.pt, CandidateWithRef< Ref >.pt(), AlignmentMonitorMuonSystemMap1D::MyTrack.pt, reco::LeafCandidate.pt(), reco::PFCluster.pt(), CosmicRateAnalyzer.pt, JetAnalyzer_HeavyIons_matching::MyJet.pt, l1t::EMTFTrack.pt, L1Analysis::L1AnalysisRecoMuonDataFormat.pt, TrackingParticle.pt(), pat::MET::Vector2.pt(), GoodSeedProducer.pt, pat::PackedGenParticle.pt(), reco::TrackBase.pt(), pat::PackedCandidate.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().

217  def mvaIDTight(self, full5x5=False):
218  eta = abs(self.superCluster().eta())
219  if self.pt() < 20:
220  if (eta < 0.8) : return self.mvaTrigV0(full5x5) > +0.00;
221  elif (eta < 1.479): return self.mvaTrigV0(full5x5) > +0.10;
222  else : return self.mvaTrigV0(full5x5) > +0.62;
223  else:
224  if (eta < 0.8) : return self.mvaTrigV0(full5x5) > +0.94;
225  elif (eta < 1.479): return self.mvaTrigV0(full5x5) > +0.85;
226  else : return self.mvaTrigV0(full5x5) > +0.92;
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def Electron.Electron.mvaNonTrigV0 (   self,
  full5x5 = False,
  debug = False 
)

Definition at line 180 of file Electron.py.

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

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

181  def mvaNonTrigV0( self, full5x5=False, debug = False ):
182  if self._mvaNonTrigV0[full5x5] == None:
183  if self.associatedVertex == None: raise RuntimeError("You need to set electron.associatedVertex before calling any MVA")
184  if self.rho == None: raise RuntimeError("You need to set electron.rho before calling any MVA")
185  self._mvaNonTrigV0[full5x5] = ElectronMVAID_NonTrig(self.physObj, self.associatedVertex, self.rho, full5x5, debug)
186  return self._mvaNonTrigV0[full5x5]
tuple ElectronMVAID_NonTrig
def Electron.Electron.mvaRun2 (   self,
  name,
  debug = False 
)

Definition at line 201 of file Electron.py.

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

Referenced by Electron.Electron.mvaIDRun2().

202  def mvaRun2( self, name, debug = False ):
203  if name not in self._mvaRun2:
204  if name == "NonTrigSpring15MiniAOD" and self.physObj.hasUserFloat("ElectronMVAEstimatorRun2Spring15NonTrig25nsV1Values"):
205  self._mvaRun2[name] = self.physObj.userFloat("ElectronMVAEstimatorRun2Spring15NonTrig25nsV1Values")
206  return self._mvaRun2[name]
207  if name not in ElectronMVAID_ByName: raise RuntimeError, "Unknown electron run2 mva id %s (known ones are: %s)\n" % (name, ElectronMVAID_ByName.keys())
208  if self.associatedVertex == None: raise RuntimeError, "You need to set electron.associatedVertex before calling any MVA"
209  if self.rho == None: raise RuntimeError, "You need to set electron.rho before calling any MVA"
210  # -v---- below is correct in Heppy 74X, but probably not functional anyway
211  self._mvaRun2[name] = ElectronMVAID_ByName[name](self.physObj, self.associatedVertex, self.rho, True, debug)
212  # -v---- below would be correct for CMGTools 74X witht the updated Spring15 MVA electron ID
213  #if self.event == None: raise RuntimeError, "You need to set electron.event before calling any MVA"
214  #self._mvaRun2[name] = ElectronMVAID_ByName[name](self.physObj, self.associatedVertex, self.event, self.rho, True, debug)
215  return self._mvaRun2[name]
def Electron.Electron.mvaTrigNoIPV0 (   self,
  full5x5 = False,
  debug = False 
)

Definition at line 194 of file Electron.py.

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

195  def mvaTrigNoIPV0( self, full5x5=False, debug = False ):
196  if self._mvaTrigNoIPV0[full5x5] == None:
197  if self.associatedVertex == None: raise RuntimeError("You need to set electron.associatedVertex before calling any MVA")
198  if self.rho == None: raise RuntimeError("You need to set electron.rho before calling any MVA")
199  self._mvaTrigNoIPV0[full5x5] = ElectronMVAID_TrigNoIP(self.physObj, self.associatedVertex, self.rho, full5x5, debug)
200  return self._mvaTrigNoIPV0[full5x5]
tuple ElectronMVAID_TrigNoIP
def Electron.Electron.mvaTrigV0 (   self,
  full5x5 = False,
  debug = False 
)

Definition at line 187 of file Electron.py.

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

Referenced by Electron.Electron.mvaIDTight().

188  def mvaTrigV0( self, full5x5=False, debug = False ):
189  if self._mvaTrigV0[full5x5] == None:
190  if self.associatedVertex == None: raise RuntimeError("You need to set electron.associatedVertex before calling any MVA")
191  if self.rho == None: raise RuntimeError("You need to set electron.rho before calling any MVA")
192  self._mvaTrigV0[full5x5] = ElectronMVAID_Trig(self.physObj, self.associatedVertex, self.rho, full5x5, debug)
193  return self._mvaTrigV0[full5x5]
tuple ElectronMVAID_Trig
def Electron.Electron.neutralHadronIsoR (   self,
  R = 0.4 
)

Definition at line 324 of file Electron.py.

Referenced by Lepton.Lepton.absIsoR(), Muon.Muon.absIsoWithFSR(), and Electron.Electron.absIsoWithFSR().

325  def neutralHadronIsoR(self,R=0.4):
326  if R == 0.3: return self.physObj.pfIsolationVariables().sumNeutralHadronEt
327  elif R == 0.4: return self.physObj.neutralHadronIso()
328  raise RuntimeError("Electron neutralHadronIso missing for R=%s" % R)
def Electron.Electron.p4 (   self)

Definition at line 381 of file Electron.py.

References PhysicsObject.PhysicsObject.physObj.

Referenced by Tau.Tau.dxy_approx(), Tau.Tau.dz(), and Lepton.Lepton.p4WithFSR().

382  def p4(self):
383  return ROOT.reco.Candidate.p4(self.physObj)
384 
385 # def p4(self):
386 # return self.physObj.p4(self.physObj.candidateP4Kind()) # if kind == None else kind)
def Electron.Electron.photonIsoR (   self,
  R = 0.4 
)

Definition at line 329 of file Electron.py.

Referenced by Lepton.Lepton.absIsoR(), Muon.Muon.absIsoWithFSR(), and Electron.Electron.absIsoWithFSR().

330  def photonIsoR(self,R=0.4):
331  if R == 0.3: return self.physObj.pfIsolationVariables().sumPhotonEt
332  elif R == 0.4: return self.physObj.photonIso()
333  raise RuntimeError("Electron photonIso missing for R=%s" % R)
def Electron.Electron.ptErr (   self)

Definition at line 411 of file Electron.py.

References reco::GsfElectron::Corrections.candidateP4Kind, reco::GsfElectron.candidateP4Kind(), mayown_ptr< T >.p, mayown_ptr< T, N >.p, edm::ConfigurationHandshake.p, funct::IntegralStruct< F, X >.p, tauImpactParameter::LorentzVectorParticle.p, LMFSextuple.p, ora::AnyData.p, Residual1DHit.p, EventShape.p, DataFormats_DTRecHit::dictionary.p, Exhume::Particle.p, funct::IntegralStruct< F >.p, DDHtmlFormatter.p(), DTMuonLocalAlignment.p, StripCPE::AlgoParam.p, reco::CaloMuon.p(), TrackerValidationVariables::AVTrackStruct.p, ValidationMisalignedTracker.p, trigger::TriggerObject.p(), HTrackVariables.p(), reco::Candidate.p(), BPhysicsValidation::ParticleMonitor.p, MuonDTLocalMillepedeAlgorithm.p, gen::@498.p, susybsm::HSCParticle.p(), reco::Particle.p(), HitEff.p, reco::ParticleState.p(), Vispa.Views.RootCanvasView.RootCanvasView.p, hitfit::Lepjets_Event_Lep.p(), gen::@570.p, L1MuGMTMatrix< int >.p, L1MuGMTMatrix< T >.p, L1MuGMTMatrix< bool >.p, TrackStruct::TrackParameterStruct.p, hitfit::FE_Obj.p, CandidateWithRef< Ref >.p(), reco::LeafCandidate.p(), sistrip::SpyEventMatcher::CountersWrapper.p, TrackingParticle.p(), funct::SimpifyS2C2Sum< n, m, A, false >.p, CaloTower.p(), pat::PackedGenParticle.p(), CosmicRateAnalyzer.p, EMECALShowerParametrization.p(), L1Analysis::L1AnalysisRecoMuonDataFormat.p, reco::TrackBase.p(), HLTEgamma::OpenHLTElectron.p, pat::PackedCandidate.p(), Config.TestModuleCommand.p, reco::GsfElectron.p4Error(), eetest::CandForTest.pt(), mypt.pt, res::HelperMuon.pt(), res::HelperElectron.pt(), res::HelperJet.pt(), reco::VoronoiBackground.pt(), RecoObj.pt, tauImpactParameter::LorentzVectorParticle.pt, ScoutingParticle.pt(), L1MuCSCPtLut.pt(), ScoutingPhoton.pt(), Residual1DHit.pt, reco::MuonMETCorrectionData.pt(), ScoutingElectron.pt(), PtHatReweightUserHook.pt, MatchStruct.pt, PtEtaPhiMass.pt(), MySimTrack.pt, ALILine.pt(), ScoutingMuon.pt(), ScoutingCaloJet.pt(), L2TauPixelTrackMatch::TinyTrack.pt, TrackMultiSelector::Block.pt, ResonanceBuilder.Resonance.pt(), ScoutingPFJet.pt(), DTMuonLocalAlignment.pt, PGlobalSimHit::Trk.pt, TtFullHadSignalSel.pt(), ElectronMVAEstimator.pt, L1Analysis::L1AnalysisRecoTauDataFormat.pt, ZMuMuIsolationAnalyzer.pt, L1Analysis::L1AnalysisRecoMuon2DataFormat.pt, L1Analysis::L1AnalysisRecoElectronDataFormat.pt, PatTrackAnalyzer::Plots.pt, SiStripLAProfileBooker.pt, PhysicsObjectsMonitor.pt, jpt::Map.pt(), reco::CaloMuon.pt(), trigger::TriggerObject.pt(), TrackerValidationVariables::AVTrackStruct.pt, BSTrkParameters.pt(), ElectronMVAEstimatorRun2Phys14NonTrig::AllVariables.pt, goodseedhelpers::HeavyObjectCache.pt, MuScleFitMuon.pt(), SoftElectronMVAEstimator.pt, PTrajectoryStateOnDet.pt(), SimpleL1MuGMTCand.pt(), ValidationMisalignedTracker.pt, HTrackVariables.pt(), HepLine3D.pt(), L1MuDTTrack.pt(), ElectronMVAEstimatorRun2Spring15NonTrig::AllVariables.pt, TrajectoryStateClosestToPoint.pt(), L1MuBMTrack.pt(), ElectronMVAEstimatorRun2Spring15Trig::AllVariables.pt, MuonDTLocalMillepedeAlgorithm.pt, BPhysicsValidation::ParticleMonitor.pt, MuonGmtPair.pt(), L1TMuon::InternalTrack.pt, PhotonPair.pt(), susybsm::HSCParticle.pt(), QualityCutsAnalyzer::histogram_element_t.pt, reco::PreId.pt(), Lepton.pt, reco::Candidate.pt(), egHLT::OffPho.pt(), TrackStruct::TrackParameterStruct.pt, reco::Particle.pt(), reco::ParticleState.pt(), contrib::CMSBoostedTauSeedingAlgorithmStructure.pt(), PtHatRapReweightUserHook.pt, MuonResidualsFitter::MuonAlignmentTreeRow.pt, AlignmentMonitorMuonSystemMap1D::MyTrack.pt, CandidateWithRef< Ref >.pt(), reco::LeafCandidate.pt(), reco::PFCluster.pt(), CosmicRateAnalyzer.pt, JetAnalyzer_HeavyIons_matching::MyJet.pt, l1t::EMTFTrack.pt, L1Analysis::L1AnalysisRecoMuonDataFormat.pt, TrackingParticle.pt(), pat::MET::Vector2.pt(), GoodSeedProducer.pt, pat::PackedGenParticle.pt(), reco::TrackBase.pt(), pat::PackedCandidate.pt(), PMuonSimHit::Trk.pt, PTrackerSimHit::Trk.pt, and Electron.Electron.validCandidateP4Kind().

412  def ptErr(self):
413  return self.p4Error(self.candidateP4Kind())*self.pt()/self.p() if self.validCandidateP4Kind() else None
414 
def validCandidateP4Kind
Definition: Electron.py:407
def Electron.Electron.puChargedHadronIsoR (   self,
  R = 0.4 
)

Definition at line 341 of file Electron.py.

Referenced by Lepton.Lepton.absIsoR(), Muon.Muon.absIsoWithFSR(), and Electron.Electron.absIsoWithFSR().

342  def puChargedHadronIsoR(self,R=0.4):
343  if R == 0.3: return self.physObj.pfIsolationVariables().sumPUPt
344  elif R == 0.4: return self.physObj.puChargedHadronIso()
345  raise RuntimeError("Electron chargedHadronIso missing for R=%s" % R)
346 
def puChargedHadronIsoR
Definition: Electron.py:341
def Electron.Electron.tightId (   self)

Definition at line 177 of file Electron.py.

References Electron.Electron.tightIdResult.

178  def tightId( self ):
179  return self.tightIdResult
def Electron.Electron.validCandidateP4Kind (   self)

Definition at line 407 of file Electron.py.

Referenced by Electron.Electron.ptErr().

408  def validCandidateP4Kind(self):
409  raw = self.physObj.candidateP4Kind()
410  return raw in (0,1,2)
def validCandidateP4Kind
Definition: Electron.py:407

Member Data Documentation

Electron.Electron._mvaNonTrigV0
private

Definition at line 19 of file Electron.py.

Referenced by Electron.Electron.mvaNonTrigV0().

Electron.Electron._mvaRun2
private

Definition at line 22 of file Electron.py.

Referenced by Electron.Electron.mvaRun2().

Electron.Electron._mvaTrigNoIPV0
private

Definition at line 21 of file Electron.py.

Referenced by Electron.Electron.mvaTrigNoIPV0().

Electron.Electron._mvaTrigV0
private

Definition at line 20 of file Electron.py.

Referenced by Electron.Electron.mvaTrigV0().

Electron.Electron.associatedVertex

Definition at line 17 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 18 of file Electron.py.

Referenced by Lepton.Lepton.absIsoFromEA(), Muon.Muon.absIsoWithFSR(), Electron.Electron.absIsoWithFSR(), Photon.Photon.chargedHadronIso(), Electron.Electron.electronID(), Electron.Electron.mvaNonTrigV0(), Electron.Electron.mvaRun2(), Electron.Electron.mvaTrigNoIPV0(), Electron.Electron.mvaTrigV0(), Photon.Photon.neutralHadronIso(), and Photon.Photon.photonIso().

Electron.Electron.tightIdResult

Definition at line 16 of file Electron.py.

Referenced by Electron.Electron.tightId().