CMS 3D CMS Logo

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

Public Member Functions

def __str__
 
def absIsoFromEA
 
def absIsoR
 
def ip3D
 
def lostInner
 
def p4WithFSR
 
def relIso
 
def relIsoFromEA
 
def relIsoR
 
def sip3D
 

Detailed Description

Definition at line 4 of file Lepton.py.

Member Function Documentation

def Lepton.Lepton.__str__ (   self)

Definition at line 54 of file Lepton.py.

References IsoTrack.IsoTrack.relIso(), and Lepton.Lepton.relIso().

54 
55  def __str__(self):
56  ptc = super(Lepton, self).__str__()
57  return '{ptc}, iso={iso:5.2f}'.format(ptc=ptc, iso=self.relIso())
def relIso
Definition: Lepton.py:23
def __str__
Definition: Lepton.py:54
def Lepton.Lepton.absIsoFromEA (   self,
  area = '04' 
)
Calculate Isolation using the effective area approach.

Definition at line 14 of file Lepton.py.

References Photon.Photon.chargedHadronIso(), pat::Lepton< LeptonType >.chargedHadronIso(), pat::Photon.chargedHadronIso(), pat::Lepton< reco::BaseTau >.chargedHadronIso(), pat::Lepton< reco::GsfElectron >.chargedHadronIso(), pat::Lepton< reco::Muon >.chargedHadronIso(), Lepton< LeptonType >.chargedHadronIso(), reco::Photon::PflowIsolationVariables.chargedHadronIso, reco::Photon.chargedHadronIso(), bookConverter.max, Photon.Photon.neutralHadronIso(), pat::Lepton< reco::GsfElectron >.neutralHadronIso(), pat::Lepton< LeptonType >.neutralHadronIso(), pat::Photon.neutralHadronIso(), pat::Lepton< reco::BaseTau >.neutralHadronIso(), pat::Lepton< reco::Muon >.neutralHadronIso(), Lepton< LeptonType >.neutralHadronIso(), reco::Photon::PflowIsolationVariables.neutralHadronIso, reco::Photon.neutralHadronIso(), Photon.Photon.photonIso(), pat::Lepton< LeptonType >.photonIso(), pat::Lepton< reco::Muon >.photonIso(), Lepton< LeptonType >.photonIso(), pat::Photon.photonIso(), pat::Lepton< reco::BaseTau >.photonIso(), pat::Lepton< reco::GsfElectron >.photonIso(), reco::Photon::PflowIsolationVariables.photonIso, reco::Photon.photonIso(), Photon.Photon.rho, Electron.Electron.rho, BinomialProbHelper.rho(), CalorimeterProperties.rho(), PreshowerProperties.rho(), ECALProperties.rho(), TauValidation.rho, correctionValue_class.rho, TangentCircle.rho(), TangentHelix.rho(), HCALProperties.rho(), MaterialEffectsSimulator.rho(), RhoEtaPhi.rho(), QcdLowPtDQM::Pixel.rho(), FastCircle.rho(), reco::GhostTrackPrediction.rho(), fastjet::BackgroundEstimator.rho(), StoredPileupJetIdentifier.rho(), FastCircleFit.rho(), reco::CastorCell.rho(), CylindricalState.rho(), reco::CastorJet.rho(), reco::CastorEgamma.rho(), reco::CastorTower.rho(), reco::CastorCluster.rho(), GeometricDet.rho(), AlignmentMonitorMuonSystemMap1D::MyResidual.rho, HGCalImagingAlgo::Hexel.rho, and objects.JetAnalyzer.JetAnalyzer.rho.

Referenced by Lepton.Lepton.relIsoFromEA().

14 
15  def absIsoFromEA(self, area='04'):
16  '''Calculate Isolation using the effective area approach.'''
17  photonIso = self.photonIso()
18  offset = self.rho*getattr(self,"EffectiveArea"+area)
19  return self.chargedHadronIso()+max(0.,photonIso+self.neutralHadronIso()-offset)
def absIsoFromEA
Definition: Lepton.py:14
def Lepton.Lepton.absIsoR (   self,
  R = 0.4,
  dBetaFactor = 0,
  allCharged = False 
)
Isolation in given cone with optional delta-beta subtraction.

Definition at line 28 of file Lepton.py.

References Muon.Muon.chargedAllIsoR(), Electron.Electron.chargedAllIsoR(), Muon.Muon.chargedHadronIsoR(), Electron.Electron.chargedHadronIsoR(), bookConverter.max, Muon.Muon.neutralHadronIsoR(), Electron.Electron.neutralHadronIsoR(), Muon.Muon.photonIsoR(), Electron.Electron.photonIsoR(), Muon.Muon.puChargedHadronIsoR(), and Electron.Electron.puChargedHadronIsoR().

Referenced by Lepton.Lepton.relIso(), and Lepton.Lepton.relIsoR().

28 
29  def absIsoR(self, R=0.4, dBetaFactor=0, allCharged=False):
30  '''Isolation in given cone with optional delta-beta subtraction.'''
31  if dBetaFactor>0 and self.puChargedHadronIsoR(R)<0:
32  raise ValueError('If you want to use dbeta corrections, you must make sure that the pu charged hadron iso is available. This should never happen')
33  neutralIso = self.neutralHadronIsoR(R) + self.photonIsoR(R)
34  corNeutralIso = neutralIso - dBetaFactor * self.puChargedHadronIsoR(R)
35  charged = self.chargedHadronIsoR(R)
36  if allCharged:
37  charged = self.chargedAllIsoR(R)
38  return charged + max(corNeutralIso, 0.)
def absIsoR
Definition: Lepton.py:28
def Lepton.Lepton.ip3D (   self)
3D impact parameter value.

Definition at line 5 of file Lepton.py.

References funct.abs(), pat::Electron.dB(), pat::Muon.dB(), pat::Electron.PV3D, and pat::Muon.PV3D.

5 
6  def ip3D(self):
7  '''3D impact parameter value.'''
8  return abs(self.dB(self.PV3D))
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def ip3D
Definition: Lepton.py:5
def Lepton.Lepton.lostInner (   self)

Definition at line 42 of file Lepton.py.

References reco::CaloMuon.innerTrack(), reco::ME0Muon.innerTrack(), reco::Muon.innerTrack(), pat::Muon.innerTrack(), HcalRaddamMuon.innerTrack, HcalHBHEMuonAnalyzer.innerTrack, and TrackCollections2monitor_cff.numberOfLostHits.

42 
43  def lostInner(self):
44  if hasattr(self.innerTrack(),"trackerExpectedHitsInner") :
return self.innerTrack().trackerExpectedHitsInner().numberOfLostHits()
def lostInner
Definition: Lepton.py:42
def Lepton.Lepton.p4WithFSR (   self)

Definition at line 48 of file Lepton.py.

References ResonanceBuilder.Resonance.p4(), CondFormats_SiPixelObjects::dictionary.p4, reco::PUSubMETCandInfo.p4(), InvariantMassFromVertex.p4(), tauImpactParameter::LorentzVectorParticle.p4(), MuScleFitMuon.p4(), reco::Candidate.p4(), reco::Particle.p4(), reco::ParticleState.p4(), BPHKinematicFit.p4(), CaloParticle.p4(), TopDecaySubset.p4(), PrimaryVertexAnalyzer4PUSlimmed::simPrimaryVertex.p4, SimCluster.p4(), @606.p4, reco::LeafCandidate.p4(), CandidateWithRef< Ref >.p4(), TrackingParticle.p4(), egHLT::OffPho.p4(), egHLT::OffEle.p4(), CaloTower.p4(), reco::tau::RecoTauConstructor.p4(), pat::PackedGenParticle.p4(), reco::Vertex.p4(), reco::Photon.p4(), pat::PackedCandidate.p4(), Electron.Electron.p4(), and reco::GsfElectron.p4().

48 
49  def p4WithFSR(self):
50  ret = self.p4()
51  for p in getattr(self, 'ownFsrPhotons', getattr(self, 'fsrPhotons', [])):
52  ret += p.p4()
53  return ret
def p4WithFSR
Definition: Lepton.py:48
def Lepton.Lepton.relIso (   self,
  dBetaFactor = 0,
  allCharged = 0 
)
Relative isolation with default cone size of 0.4.

Definition at line 23 of file Lepton.py.

References Lepton.Lepton.absIsoR(), 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, 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::L1AnalysisRecoElectronDataFormat.pt, PatTrackAnalyzer::Plots.pt, L1Analysis::L1AnalysisRecoMuon2DataFormat.pt, jpt::Map.pt(), SiStripLAProfileBooker.pt, PhysicsObjectsMonitor.pt, reco::CaloMuon.pt(), TrackerValidationVariables::AVTrackStruct.pt, trigger::TriggerObject.pt(), BSTrkParameters.pt(), ElectronMVAEstimatorRun2Phys14NonTrig::AllVariables.pt, goodseedhelpers::HeavyObjectCache.pt, MuScleFitMuon.pt(), SoftElectronMVAEstimator.pt, SimpleL1MuGMTCand.pt(), PTrajectoryStateOnDet.pt(), ValidationMisalignedTracker.pt, HTrackVariables.pt(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables.pt, HepLine3D.pt(), ElectronMVAEstimatorRun2Spring16HZZ::AllVariables.pt, L1MuDTTrack.pt(), ElectronMVAEstimatorRun2Spring15NonTrig::AllVariables.pt, TrajectoryStateClosestToPoint.pt(), L1MuBMTrack.pt(), ElectronMVAEstimatorRun2Spring15Trig::AllVariables.pt, MuonDTLocalMillepedeAlgorithm.pt, BPhysicsValidation::ParticleMonitor.pt, MuonGmtPair.pt(), L1TMuon::InternalTrack.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(), PrimaryVertexAnalyzer4PUSlimmed::recoPrimaryVertex.pt, PtHatRapReweightUserHook.pt, MuonResidualsFitter::MuonAlignmentTreeRow.pt, CandidateWithRef< Ref >.pt(), AlignmentMonitorMuonSystemMap1D::MyTrack.pt, reco::LeafCandidate.pt(), reco::PFCluster.pt(), CaloParticle.pt(), CosmicRateAnalyzer.pt, JetAnalyzer_HeavyIons_matching::MyJet.pt, SimCluster.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, and PTrackerSimHit::Trk.pt.

Referenced by Lepton.Lepton.__str__().

23 
24  def relIso(self, dBetaFactor=0, allCharged=0):
25  '''Relative isolation with default cone size of 0.4.'''
26  rel = self.absIsoR(dBetaFactor=dBetaFactor, allCharged=allCharged)/self.pt()
27  return rel
def relIso
Definition: Lepton.py:23
def absIsoR
Definition: Lepton.py:28
def Lepton.Lepton.relIsoFromEA (   self,
  area = '04' 
)

Definition at line 20 of file Lepton.py.

References Lepton.Lepton.absIsoFromEA(), 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, 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::L1AnalysisRecoElectronDataFormat.pt, PatTrackAnalyzer::Plots.pt, L1Analysis::L1AnalysisRecoMuon2DataFormat.pt, jpt::Map.pt(), SiStripLAProfileBooker.pt, PhysicsObjectsMonitor.pt, reco::CaloMuon.pt(), TrackerValidationVariables::AVTrackStruct.pt, trigger::TriggerObject.pt(), BSTrkParameters.pt(), ElectronMVAEstimatorRun2Phys14NonTrig::AllVariables.pt, goodseedhelpers::HeavyObjectCache.pt, MuScleFitMuon.pt(), SoftElectronMVAEstimator.pt, SimpleL1MuGMTCand.pt(), PTrajectoryStateOnDet.pt(), ValidationMisalignedTracker.pt, HTrackVariables.pt(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables.pt, HepLine3D.pt(), ElectronMVAEstimatorRun2Spring16HZZ::AllVariables.pt, L1MuDTTrack.pt(), ElectronMVAEstimatorRun2Spring15NonTrig::AllVariables.pt, TrajectoryStateClosestToPoint.pt(), L1MuBMTrack.pt(), ElectronMVAEstimatorRun2Spring15Trig::AllVariables.pt, MuonDTLocalMillepedeAlgorithm.pt, BPhysicsValidation::ParticleMonitor.pt, MuonGmtPair.pt(), L1TMuon::InternalTrack.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(), PrimaryVertexAnalyzer4PUSlimmed::recoPrimaryVertex.pt, PtHatRapReweightUserHook.pt, MuonResidualsFitter::MuonAlignmentTreeRow.pt, CandidateWithRef< Ref >.pt(), AlignmentMonitorMuonSystemMap1D::MyTrack.pt, reco::LeafCandidate.pt(), reco::PFCluster.pt(), CaloParticle.pt(), CosmicRateAnalyzer.pt, JetAnalyzer_HeavyIons_matching::MyJet.pt, SimCluster.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, and PTrackerSimHit::Trk.pt.

20 
21  def relIsoFromEA(self, area='04'):
22  return self.absIsoFromEA(area)/self.pt()
def relIsoFromEA
Definition: Lepton.py:20
def absIsoFromEA
Definition: Lepton.py:14
def Lepton.Lepton.relIsoR (   self,
  R = 0.4,
  dBetaFactor = 0,
  allCharged = False 
)

Definition at line 39 of file Lepton.py.

References Lepton.Lepton.absIsoR(), 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, 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::L1AnalysisRecoElectronDataFormat.pt, PatTrackAnalyzer::Plots.pt, L1Analysis::L1AnalysisRecoMuon2DataFormat.pt, jpt::Map.pt(), SiStripLAProfileBooker.pt, PhysicsObjectsMonitor.pt, reco::CaloMuon.pt(), TrackerValidationVariables::AVTrackStruct.pt, trigger::TriggerObject.pt(), BSTrkParameters.pt(), ElectronMVAEstimatorRun2Phys14NonTrig::AllVariables.pt, goodseedhelpers::HeavyObjectCache.pt, MuScleFitMuon.pt(), SoftElectronMVAEstimator.pt, SimpleL1MuGMTCand.pt(), PTrajectoryStateOnDet.pt(), ValidationMisalignedTracker.pt, HTrackVariables.pt(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables.pt, HepLine3D.pt(), ElectronMVAEstimatorRun2Spring16HZZ::AllVariables.pt, L1MuDTTrack.pt(), ElectronMVAEstimatorRun2Spring15NonTrig::AllVariables.pt, TrajectoryStateClosestToPoint.pt(), L1MuBMTrack.pt(), ElectronMVAEstimatorRun2Spring15Trig::AllVariables.pt, MuonDTLocalMillepedeAlgorithm.pt, BPhysicsValidation::ParticleMonitor.pt, MuonGmtPair.pt(), L1TMuon::InternalTrack.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(), PrimaryVertexAnalyzer4PUSlimmed::recoPrimaryVertex.pt, PtHatRapReweightUserHook.pt, MuonResidualsFitter::MuonAlignmentTreeRow.pt, CandidateWithRef< Ref >.pt(), AlignmentMonitorMuonSystemMap1D::MyTrack.pt, reco::LeafCandidate.pt(), reco::PFCluster.pt(), CaloParticle.pt(), CosmicRateAnalyzer.pt, JetAnalyzer_HeavyIons_matching::MyJet.pt, SimCluster.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, and PTrackerSimHit::Trk.pt.

39 
40  def relIsoR(self, R=0.4, dBetaFactor=0, allCharged=False):
41  return self.absIsoR(R, dBetaFactor, allCharged)/self.pt()
def relIsoR
Definition: Lepton.py:39
def absIsoR
Definition: Lepton.py:28
def Lepton.Lepton.sip3D (   self)
3D impact parameter significance.

Definition at line 9 of file Lepton.py.

References funct.abs(), pat::Electron.dB(), pat::Muon.dB(), pat::Electron.edB(), pat::Muon.edB(), pat::Electron.PV3D, and pat::Muon.PV3D.

9 
10  def sip3D(self):
11  '''3D impact parameter significance.'''
12  db, edb = self.dB(self.PV3D), self.edB(self.PV3D)
13  return abs(db/edb) if edb > 0 else 999.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def sip3D
Definition: Lepton.py:9