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 109 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().

110  def absEffAreaIso(self,rho,effectiveAreas):
111  '''MIKE, missing doc.
112  Should have the same name as the function in the mother class.
113  Can call the mother class function with super.
114  '''
115  return self.absIsoFromEA(rho,self.superCluster().eta(),effectiveAreas.eGamma)
def Electron.Electron.chargedAllIso (   self)

Definition at line 210 of file Electron.py.

Referenced by Lepton.Lepton.absIso().

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

Definition at line 206 of file Electron.py.

Referenced by Muon.Muon.chargedAllIso().

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

Definition at line 191 of file Electron.py.

192  def chargedHadronIsoR(self,R=0.4):
193  if R == 0.3: return self.physObj.pfIsolationVariables().sumChargedHadronPt
194  elif R == 0.4: return self.physObj.chargedHadronIso()
195  raise RuntimeError, "Electron chargedHadronIso missing for R=%s" % R
def Electron.Electron.cutBasedId (   self,
  wp,
  showerShapes = "auto" 
)

Definition at line 40 of file Electron.py.

References funct.abs().

Referenced by Electron.Electron.electronID().

40 
41  def cutBasedId(self, wp, showerShapes="auto"):
42  if "_full5x5" in wp:
43  showerShapes = "full5x5"
44  wp = wp.replace("_full5x5","")
45  elif showerShapes == "auto":
46  if "POG_CSA14_25ns_v1" in wp or "POG_CSA14_50ns_v1" in wp or "POG_PHYS14_25ns_v1" in wp:
47  showerShapes = "full5x5"
48  vars = {
49  'dEtaIn' : abs(self.physObj.deltaEtaSuperClusterTrackAtVtx()),
50  'dPhiIn' : abs(self.physObj.deltaPhiSuperClusterTrackAtVtx()),
51  'sigmaIEtaIEta' : self.physObj.full5x5_sigmaIetaIeta() if showerShapes == "full5x5" else self.physObj.sigmaIetaIeta(),
52  'H/E' : self.physObj.hadronicOverEm(),
53  #'1/E-1/p' : abs(1.0/self.physObj.ecalEnergy() - self.physObj.eSuperClusterOverP()/self.physObj.ecalEnergy()),
54  '1/E-1/p' : abs(1.0/self.physObj.ecalEnergy() - self.physObj.eSuperClusterOverP()/self.physObj.ecalEnergy()) if self.physObj.ecalEnergy()>0. else 9e9,
55  'conversionVeto' : self.physObj.passConversionVeto(),
56  '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
57  }
58  WP = {
59  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/EgammaCutBasedIdentification?rev=31
60  '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])],
61  '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])],
62  '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])],
63  '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])],
64  # RIC: in the EG POG WPs, isolation is included too. Here only the pure ID part.
65  # dz and d0 cuts are excluded here as well.
66  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_CSA14_samples?rev=13
67  '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])],
68  '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])],
69  '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])],
70  '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])],
71  '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 ])],
72  '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 ])],
73  '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 ])],
74  '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])],
75  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_PHYS14_sample?rev=13
76  '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])],
77  '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])],
78  '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])],
79  '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])],
80  }
81  WP_conversion_veto = {
82  # missing Hits incremented by 1 because we return False if >=, note the '='
83  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_CSA14_samples?rev=13
84  'POG_CSA14_25ns_v1_ConvVeto_Veto' : WP['POG_CSA14_25ns_v1_Veto' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 4])],
85  'POG_CSA14_25ns_v1_ConvVeto_Loose' : WP['POG_CSA14_25ns_v1_Loose' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
86  'POG_CSA14_25ns_v1_ConvVeto_Medium' : WP['POG_CSA14_25ns_v1_Medium']+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
87  'POG_CSA14_25ns_v1_ConvVeto_Tight' : WP['POG_CSA14_25ns_v1_Tight' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
88  'POG_CSA14_50ns_v1_ConvVeto_Veto' : WP['POG_CSA14_50ns_v1_Veto' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 4])],
89  'POG_CSA14_50ns_v1_ConvVeto_Loose' : WP['POG_CSA14_50ns_v1_Loose' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
90  'POG_CSA14_50ns_v1_ConvVeto_Medium' : WP['POG_CSA14_50ns_v1_Medium']+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
91  'POG_CSA14_50ns_v1_ConvVeto_Tight' : WP['POG_CSA14_50ns_v1_Tight' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
92  ## ------- https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2#Working_points_for_PHYS14_sample?rev=13
93  'POG_PHYS14_25ns_v1_ConvVeto_Veto' : WP['POG_PHYS14_25ns_v1_Veto' ]+[('conversionVeto', [True, True]), ('missingHits', [3, 4])],
94  'POG_PHYS14_25ns_v1_ConvVeto_Loose' : WP['POG_PHYS14_25ns_v1_Loose' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
95  'POG_PHYS14_25ns_v1_ConvVeto_Medium' : WP['POG_PHYS14_25ns_v1_Medium']+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
96  'POG_PHYS14_25ns_v1_ConvVeto_Tight' : WP['POG_PHYS14_25ns_v1_Tight' ]+[('conversionVeto', [True, True]), ('missingHits', [2, 2])],
97  }
98 
99  WP.update(WP_conversion_veto)
100 
101  if wp not in WP:
102  raise RuntimeError, "Working point '%s' not yet implemented in Electron.py" % wp
103  for (cut_name,(cut_eb,cut_ee)) in WP[wp]:
104  if cut_name == 'conversionVeto':
105  return vars[cut_name] == (cut_eb if self.physObj.isEB() else cut_ee)
106  elif vars[cut_name] >= (cut_eb if self.physObj.isEB() else cut_ee):
107  return False
108  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 218 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().

219  def dxy(self, vertex=None):
220  '''Returns dxy.
221  Computed using vertex (or self.associatedVertex if vertex not specified),
222  and the gsf track.
223  '''
224  if vertex is None:
225  vertex = self.associatedVertex
226  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 237 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().

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

Definition at line 227 of file Electron.py.

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

228  def edxy(self):
229  '''returns the uncertainty on dxy (from gsf track)'''
230  return self.gsfTrack().dxyError()
def Electron.Electron.edz (   self)
returns the uncertainty on dxz (from gsf track)

Definition at line 246 of file Electron.py.

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

247  def edz(self):
248  '''returns the uncertainty on dxz (from gsf track)'''
249  return self.gsfTrack().dzError()
250 
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_Loose": return self.mvaIDRun2("NonTrigPhys14","Loose")
33  elif id == "POG_MVA_ID_Run2_NonTrig_Tight": return self.mvaIDRun2("NonTrigPhys14","Tight")
34  elif id.startswith("POG_Cuts_ID_"):
35  return self.cutBasedId(id.replace("POG_Cuts_ID_","POG_"))
36  for ID in self.electronIDs():
37  if ID.first == id:
38  return ID.second
39  raise RuntimeError, "Electron id '%s' not yet implemented in Electron.py" % id
def Electron.Electron.lostInner (   self)

Definition at line 251 of file Electron.py.

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

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

Definition at line 116 of file Electron.py.

References Electron.Electron.mvaNonTrigV0().

117  def mvaId( self ):
118  return self.mvaNonTrigV0()
def Electron.Electron.mvaIDLoose (   self,
  full5x5 = False 
)

Definition at line 162 of file Electron.py.

References funct.abs(), eta, Electron.Electron.mvaNonTrigV0(), 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(), PtHatReweightUserHook.pt, PtEtaPhiMass.pt(), MatchStruct.pt, ALILine.pt(), ScoutingMuon.pt(), ScoutingCaloJet.pt(), L2TauPixelTrackMatch::TinyTrack.pt, TrackMultiSelector::Block.pt, ScoutingPFJet.pt(), DTMuonLocalAlignment.pt, ElectronMVAEstimator.pt, PGlobalSimHit::Trk.pt, TtFullHadSignalSel.pt(), lhef::JetClustering::Jet.pt(), ZMuMuIsolationAnalyzer.pt, PatTrackAnalyzer::Plots.pt, SiStripLAProfileBooker.pt, jpt::Map.pt(), PhysicsObjectsMonitor.pt, reco::CaloMuon.pt(), TrackerValidationVariables::AVTrackStruct.pt, trigger::TriggerObject.pt(), BSTrkParameters.pt(), ElectronMVAEstimatorRun2Phys14NonTrig::AllVariables.pt, goodseedhelpers::HeavyObjectCache.pt, MuScleFitMuon.pt(), SoftElectronMVAEstimator.pt, PTrajectoryStateOnDet.pt(), SimpleL1MuGMTCand.pt(), HTrackVariables.pt(), ValidationMisalignedTracker.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(), TrackStruct::TrackParameterStruct.pt, reco::ParticleState.pt(), pat::PackedGenParticle.pt(), contrib::CMSBoostedTauSeedingAlgorithmStructure.pt(), PtHatRapReweightUserHook.pt, MuonResidualsFitter::MuonAlignmentTreeRow.pt, AlignmentMonitorMuonSystemMap1D::MyTrack.pt, CandidateWithRef< Ref >.pt(), reco::LeafCandidate.pt(), JetAnalyzer_HeavyIons_matching::MyJet.pt, reco::PFCluster.pt(), pat::PackedCandidate.pt(), TrackingParticle.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(), reco::SiStripElectron.superCluster(), pat::Electron.superCluster(), pat::GenericParticle.superCluster(), and reco::GsfElectron.superCluster().

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

163  def mvaIDLoose(self, full5x5=False):
164  eta = abs(self.superCluster().eta())
165  if self.pt() < 10:
166  if (eta < 0.8) : return self.mvaNonTrigV0(full5x5) > +0.47;
167  elif (eta < 1.479): return self.mvaNonTrigV0(full5x5) > +0.004;
168  else : return self.mvaNonTrigV0(full5x5) > +0.295;
169  else:
170  if (eta < 0.8) : return self.mvaNonTrigV0(full5x5) > -0.34;
171  elif (eta < 1.479): return self.mvaNonTrigV0(full5x5) > -0.65;
172  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 173 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().

174  def mvaIDRun2(self, name, wp):
175  eta = abs(self.superCluster().eta())
176  if name == "NonTrigPhys14":
177  if wp=="Loose":
178  if (eta < 0.8) : return self.mvaRun2(name) > +0.35;
179  elif (eta < 1.479): return self.mvaRun2(name) > +0.20;
180  else : return self.mvaRun2(name) > -0.52;
181  elif wp=="Tight":
182  if (eta < 0.8) : return self.mvaRun2(name) > 0.73;
183  elif (eta < 1.479): return self.mvaRun2(name) > 0.57;
184  else : return self.mvaRun2(name) > 0.05;
185  else: raise RuntimeError, "Ele MVA ID Working point not found"
186  else: raise RuntimeError, "Ele MVA ID type not found"
187 
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def Electron.Electron.mvaIDTight (   self,
  full5x5 = False 
)

Definition at line 151 of file Electron.py.

References funct.abs(), eta, Electron.Electron.mvaTrigV0(), 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(), PtHatReweightUserHook.pt, PtEtaPhiMass.pt(), MatchStruct.pt, ALILine.pt(), ScoutingMuon.pt(), ScoutingCaloJet.pt(), L2TauPixelTrackMatch::TinyTrack.pt, TrackMultiSelector::Block.pt, ScoutingPFJet.pt(), DTMuonLocalAlignment.pt, ElectronMVAEstimator.pt, PGlobalSimHit::Trk.pt, TtFullHadSignalSel.pt(), lhef::JetClustering::Jet.pt(), ZMuMuIsolationAnalyzer.pt, PatTrackAnalyzer::Plots.pt, SiStripLAProfileBooker.pt, jpt::Map.pt(), PhysicsObjectsMonitor.pt, reco::CaloMuon.pt(), TrackerValidationVariables::AVTrackStruct.pt, trigger::TriggerObject.pt(), BSTrkParameters.pt(), ElectronMVAEstimatorRun2Phys14NonTrig::AllVariables.pt, goodseedhelpers::HeavyObjectCache.pt, MuScleFitMuon.pt(), SoftElectronMVAEstimator.pt, PTrajectoryStateOnDet.pt(), SimpleL1MuGMTCand.pt(), HTrackVariables.pt(), ValidationMisalignedTracker.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(), TrackStruct::TrackParameterStruct.pt, reco::ParticleState.pt(), pat::PackedGenParticle.pt(), contrib::CMSBoostedTauSeedingAlgorithmStructure.pt(), PtHatRapReweightUserHook.pt, MuonResidualsFitter::MuonAlignmentTreeRow.pt, AlignmentMonitorMuonSystemMap1D::MyTrack.pt, CandidateWithRef< Ref >.pt(), reco::LeafCandidate.pt(), JetAnalyzer_HeavyIons_matching::MyJet.pt, reco::PFCluster.pt(), pat::PackedCandidate.pt(), TrackingParticle.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(), reco::SiStripElectron.superCluster(), pat::Electron.superCluster(), pat::GenericParticle.superCluster(), and reco::GsfElectron.superCluster().

Referenced by Electron.Electron.electronID().

152  def mvaIDTight(self, full5x5=False):
153  eta = abs(self.superCluster().eta())
154  if self.pt() < 20:
155  if (eta < 0.8) : return self.mvaTrigV0(full5x5) > +0.00;
156  elif (eta < 1.479): return self.mvaTrigV0(full5x5) > +0.10;
157  else : return self.mvaTrigV0(full5x5) > +0.62;
158  else:
159  if (eta < 0.8) : return self.mvaTrigV0(full5x5) > +0.94;
160  elif (eta < 1.479): return self.mvaTrigV0(full5x5) > +0.85;
161  else : return self.mvaTrigV0(full5x5) > +0.92;
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def Electron.Electron.mvaIDZZ (   self)

Definition at line 188 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().

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

Definition at line 122 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().

123  def mvaNonTrigV0( self, full5x5=False, debug = False ):
124  if self._mvaNonTrigV0[full5x5] == None:
125  if self.associatedVertex == None: raise RuntimeError, "You need to set electron.associatedVertex before calling any MVA"
126  if self.rho == None: raise RuntimeError, "You need to set electron.rho before calling any MVA"
127  self._mvaNonTrigV0[full5x5] = ElectronMVAID_NonTrig(self.physObj, self.associatedVertex, self.rho, full5x5, debug)
128  return self._mvaNonTrigV0[full5x5]
tuple ElectronMVAID_NonTrig
def Electron.Electron.mvaRun2 (   self,
  name,
  debug = False 
)

Definition at line 143 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().

144  def mvaRun2( self, name, debug = False ):
145  if name not in self._mvaRun2:
146  if name not in ElectronMVAID_ByName: raise RuntimeError, "Unknown electron run2 mva id %s (known ones are: %s)\n" % (name, ElectronMVAID_ByName.keys())
147  if self.associatedVertex == None: raise RuntimeError, "You need to set electron.associatedVertex before calling any MVA"
148  if self.rho == None: raise RuntimeError, "You need to set electron.rho before calling any MVA"
149  self._mvaRun2[name] = ElectronMVAID_ByName[name](self.physObj, self.associatedVertex, self.rho, True, debug)
150  return self._mvaRun2[name]
def Electron.Electron.mvaTrigNoIPV0 (   self,
  full5x5 = False,
  debug = False 
)

Definition at line 136 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.

137  def mvaTrigNoIPV0( self, full5x5=False, debug = False ):
138  if self._mvaTrigNoIPV0[full5x5] == None:
139  if self.associatedVertex == None: raise RuntimeError, "You need to set electron.associatedVertex before calling any MVA"
140  if self.rho == None: raise RuntimeError, "You need to set electron.rho before calling any MVA"
141  self._mvaTrigNoIPV0[full5x5] = ElectronMVAID_TrigNoIP(self.physObj, self.associatedVertex, self.rho, full5x5, debug)
142  return self._mvaTrigNoIPV0[full5x5]
tuple ElectronMVAID_TrigNoIP
def Electron.Electron.mvaTrigV0 (   self,
  full5x5 = False,
  debug = False 
)

Definition at line 129 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().

130  def mvaTrigV0( self, full5x5=False, debug = False ):
131  if self._mvaTrigV0[full5x5] == None:
132  if self.associatedVertex == None: raise RuntimeError, "You need to set electron.associatedVertex before calling any MVA"
133  if self.rho == None: raise RuntimeError, "You need to set electron.rho before calling any MVA"
134  self._mvaTrigV0[full5x5] = ElectronMVAID_Trig(self.physObj, self.associatedVertex, self.rho, full5x5, debug)
135  return self._mvaTrigV0[full5x5]
tuple ElectronMVAID_Trig
def Electron.Electron.neutralHadronIsoR (   self,
  R = 0.4 
)

Definition at line 196 of file Electron.py.

197  def neutralHadronIsoR(self,R=0.4):
198  if R == 0.3: return self.physObj.pfIsolationVariables().sumNeutralHadronEt
199  elif R == 0.4: return self.physObj.neutralHadronIso()
200  raise RuntimeError, "Electron neutralHadronIso missing for R=%s" % R
def Electron.Electron.p4 (   self)

Definition at line 231 of file Electron.py.

References PhysicsObject.PhysicsObject.physObj.

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

232  def p4(self):
233  return ROOT.reco.Candidate.p4(self.physObj)
234 
235 # def p4(self):
236 # return self.physObj.p4(self.physObj.candidateP4Kind()) # if kind == None else kind)
def Electron.Electron.photonIsoR (   self,
  R = 0.4 
)

Definition at line 201 of file Electron.py.

202  def photonIsoR(self,R=0.4):
203  if R == 0.3: return self.physObj.pfIsolationVariables().sumPhotonEt
204  elif R == 0.4: return self.physObj.photonIso()
205  raise RuntimeError, "Electron photonIso missing for R=%s" % R
def Electron.Electron.puChargedHadronIsoR (   self,
  R = 0.4 
)

Definition at line 213 of file Electron.py.

214  def puChargedHadronIsoR(self,R=0.4):
215  if R == 0.3: return self.physObj.pfIsolationVariables().sumPUPt
216  elif R == 0.4: return self.physObj.puChargedHadronIso()
217  raise RuntimeError, "Electron chargedHadronIso missing for R=%s" % R
def puChargedHadronIsoR
Definition: Electron.py:213
def Electron.Electron.tightId (   self)

Definition at line 119 of file Electron.py.

References Electron.Electron.tightIdResult.

120  def tightId( self ):
121  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().