CMS 3D CMS Logo

List of all members | Public Member Functions
Lepton.Lepton Class Reference
Inheritance diagram for Lepton.Lepton:

Public Member Functions

def __str__ (self)
 
def absIsoFromEA (self, area='04')
 
def absIsoR (self, R=0.4, dBetaFactor=0, allCharged=False)
 
def ip3D (self)
 
def lostInner (self)
 
def p4WithFSR (self)
 
def relIso (self, dBetaFactor=0, allCharged=0)
 
def relIsoFromEA (self, area='04')
 
def relIsoR (self, R=0.4, dBetaFactor=0, allCharged=False)
 
def sip3D (self)
 

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  def __str__(self):
55  ptc = super(Lepton, self).__str__()
56  return '{ptc}, iso={iso:5.2f}'.format(ptc=ptc, iso=self.relIso())
57 
def __str__(self)
Definition: Lepton.py:54
def relIso(self, dBetaFactor=0, allCharged=0)
Definition: Lepton.py:23
def Lepton.Lepton.absIsoFromEA (   self,
  area = '04' 
)
Calculate Isolation using the effective area approach.

Definition at line 14 of file Lepton.py.

References pat::PFIsolation.chargedHadronIso(), Photon.Photon.chargedHadronIso(), pat::Photon.chargedHadronIso(), pat::Lepton< LeptonType >.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(), SiStripPI.max, pat::PFIsolation.neutralHadronIso(), Photon.Photon.neutralHadronIso(), pat::Photon.neutralHadronIso(), pat::Lepton< reco::BaseTau >.neutralHadronIso(), pat::Lepton< LeptonType >.neutralHadronIso(), pat::Lepton< reco::GsfElectron >.neutralHadronIso(), pat::Lepton< reco::Muon >.neutralHadronIso(), Lepton< LeptonType >.neutralHadronIso(), reco::Photon::PflowIsolationVariables.neutralHadronIso, reco::Photon.neutralHadronIso(), pat::PFIsolation.photonIso(), Photon.Photon.photonIso(), pat::Photon.photonIso(), pat::Lepton< reco::GsfElectron >.photonIso(), pat::Lepton< reco::Muon >.photonIso(), pat::Lepton< LeptonType >.photonIso(), Lepton< LeptonType >.photonIso(), pat::Lepton< reco::BaseTau >.photonIso(), reco::Photon::PflowIsolationVariables.photonIso, reco::Photon.photonIso(), Photon.Photon.rho, Electron.Electron.rho, CalorimeterProperties.rho(), BinomialProbHelper.rho(), PreshowerProperties.rho(), ECALProperties.rho(), TauValidation.rho, correctionValue_class.rho, TangentCircle.rho(), TangentHelix.rho(), HCALProperties.rho(), MaterialEffectsSimulator.rho(), RhoEtaPhi.rho(), FastCircle.rho(), QcdLowPtDQM::Pixel.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(), GeometricTimingDet.rho(), GeometricDet.rho(), AlignmentMonitorMuonSystemMap1D::MyResidual.rho, HGCalCLUEAlgo::Hexel.rho, HGCalImagingAlgo::Hexel.rho, and objects.JetAnalyzer.JetAnalyzer.rho.

Referenced by Lepton.Lepton.relIsoFromEA().

14  def absIsoFromEA(self, area='04'):
15  '''Calculate Isolation using the effective area approach.'''
16  photonIso = self.photonIso()
17  offset = self.rho*getattr(self,"EffectiveArea"+area)
18  return self.chargedHadronIso()+max(0.,photonIso+self.neutralHadronIso()-offset)
19 
def absIsoFromEA(self, area='04')
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(), SiStripPI.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  def absIsoR(self, R=0.4, dBetaFactor=0, allCharged=False):
29  '''Isolation in given cone with optional delta-beta subtraction.'''
30  if dBetaFactor>0 and self.puChargedHadronIsoR(R)<0:
31  raise ValueError('If you want to use dbeta corrections, you must make sure that the pu charged hadron iso is available. This should never happen')
32  neutralIso = self.neutralHadronIsoR(R) + self.photonIsoR(R)
33  corNeutralIso = neutralIso - dBetaFactor * self.puChargedHadronIsoR(R)
34  charged = self.chargedHadronIsoR(R)
35  if allCharged:
36  charged = self.chargedAllIsoR(R)
37  return charged + max(corNeutralIso, 0.)
38 
def absIsoR(self, R=0.4, dBetaFactor=0, allCharged=False)
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  def ip3D(self):
6  '''3D impact parameter value.'''
7  return abs(self.dB(self.PV3D))
8 
def ip3D(self)
Definition: Lepton.py:5
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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(), and HcalRaddamMuon.innerTrack.

42  def lostInner(self):
43  if hasattr(self.innerTrack(),"trackerExpectedHitsInner") :
44  return self.innerTrack().trackerExpectedHitsInner().numberOfLostHits()
45  else :
46  return self.innerTrack().hitPattern().numberOfLostHits(ROOT.reco.HitPattern.MISSING_INNER_HITS)
47 
def lostInner(self)
Definition: Lepton.py:42
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(), PuppiCandidate.pt, eetest::CandForTest.pt(), btagbtvdeep::TrackPairFeatures.pt, btagbtvdeep::SecondaryVertexFeatures.pt, mypt.pt, btagbtvdeep::JetFeatures.pt, btagbtvdeep::SeedingTrackFeatures.pt, res::HelperElectron.pt(), res::HelperMuon.pt(), res::HelperJet.pt(), reco::VoronoiBackground.pt(), RecoObj.pt, btagbtvdeep::SeedingTrackInfoBuilder.pt(), tauImpactParameter::LorentzVectorParticle.pt, ScoutingParticle.pt(), dnn_inputs_2017v1.pt, L1MuCSCPtLut.pt(), ScoutingPhoton.pt(), Residual1DHit.pt, ScoutingElectron.pt(), reco::MuonMETCorrectionData.pt(), PtHatReweightUserHook.pt, MatchStruct.pt, PtEtaPhiMass.pt(), MySimTrack.pt, ALILine.pt(), ScoutingCaloJet.pt(), L2TauPixelTrackMatch::TinyTrack.pt, ResonanceBuilder.Resonance.pt(), ScoutingPFJet.pt(), ScoutingMuon.pt(), DTMuonLocalAlignment.pt, TtFullHadSignalSel.pt(), L1Analysis::L1AnalysisRecoTauDataFormat.pt, ZMuMuIsolationAnalyzer.pt, L1Analysis::L1AnalysisRecoElectronDataFormat.pt, PatTrackAnalyzer::Plots.pt, PGlobalSimHit::Trk.pt, L1Analysis::L1AnalysisRecoMuon2DataFormat.pt, PhysicsObjectsMonitor.pt, SiStripLAProfileBooker.pt, jpt::Map.pt(), reco::CaloMuon.pt(), trigger::TriggerObject.pt(), BSTrkParameters.pt(), reco::ForwardProton.pt(), TrackerValidationVariables::AVTrackStruct.pt, goodseedhelpers::HeavyObjectCache.pt, TauL1TPair.pt(), MuScleFitMuon.pt(), ValidationMisalignedTracker.pt, SimpleL1MuGMTCand.pt(), HTrackVariables.pt(), PTrajectoryStateOnDet.pt(), HepLine3D.pt(), L1MuDTTrack.pt(), L1MuBMTrack.pt(), QualityCutsAnalyzer::histogram_element_t.pt, TrajectoryStateClosestToPoint.pt(), MuonDTLocalMillepedeAlgorithm.pt, BPhysicsValidation::ParticleMonitor.pt, susybsm::HSCParticle.pt(), Lepton.pt, reco::PreId.pt(), reco::Candidate.pt(), egHLT::OffPho.pt(), reco::Particle.pt(), reco::ParticleState.pt(), contrib::CMSBoostedTauSeedingAlgorithmStructure.pt(), PrimaryVertexAnalyzer4PUSlimmed::recoPrimaryVertex.pt, MuonResidualsFitter::MuonAlignmentTreeRow.pt, TrackStruct::TrackParameterStruct.pt, CaloParticle.pt(), AlignmentMonitorMuonSystemMap1D::MyTrack.pt, reco::LeafCandidate.pt(), CandidateWithRef< Ref >.pt(), HGCalClusterT< C >.pt(), SimCluster.pt(), reco::PFCluster.pt(), CosmicRateAnalyzer.pt, PtHatRapReweightUserHook.pt, JetAnalyzer_HeavyIons_matching::MyJet.pt, L1Analysis::L1AnalysisRecoMuonDataFormat.pt, TrackingParticle.pt(), GoodSeedProducer.pt, MuonGmtPair.pt(), l1t::EMTFTrack.pt, pat::PackedGenParticle.pt(), pat::MET::Vector2.pt(), RawParticle.pt(), reco::TrackBase.pt(), pat::PackedCandidate.pt(), PMuonSimHit::Trk.pt, and PTrackerSimHit::Trk.pt.

Referenced by Lepton.Lepton.__str__().

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

Definition at line 20 of file Lepton.py.

References Lepton.Lepton.absIsoFromEA(), PuppiCandidate.pt, eetest::CandForTest.pt(), btagbtvdeep::TrackPairFeatures.pt, btagbtvdeep::SecondaryVertexFeatures.pt, mypt.pt, btagbtvdeep::JetFeatures.pt, btagbtvdeep::SeedingTrackFeatures.pt, res::HelperElectron.pt(), res::HelperMuon.pt(), res::HelperJet.pt(), reco::VoronoiBackground.pt(), RecoObj.pt, btagbtvdeep::SeedingTrackInfoBuilder.pt(), tauImpactParameter::LorentzVectorParticle.pt, ScoutingParticle.pt(), dnn_inputs_2017v1.pt, L1MuCSCPtLut.pt(), ScoutingPhoton.pt(), Residual1DHit.pt, ScoutingElectron.pt(), reco::MuonMETCorrectionData.pt(), PtHatReweightUserHook.pt, MatchStruct.pt, PtEtaPhiMass.pt(), MySimTrack.pt, ALILine.pt(), ScoutingCaloJet.pt(), L2TauPixelTrackMatch::TinyTrack.pt, ResonanceBuilder.Resonance.pt(), ScoutingPFJet.pt(), ScoutingMuon.pt(), DTMuonLocalAlignment.pt, TtFullHadSignalSel.pt(), L1Analysis::L1AnalysisRecoTauDataFormat.pt, ZMuMuIsolationAnalyzer.pt, L1Analysis::L1AnalysisRecoElectronDataFormat.pt, PatTrackAnalyzer::Plots.pt, PGlobalSimHit::Trk.pt, L1Analysis::L1AnalysisRecoMuon2DataFormat.pt, PhysicsObjectsMonitor.pt, SiStripLAProfileBooker.pt, jpt::Map.pt(), reco::CaloMuon.pt(), trigger::TriggerObject.pt(), BSTrkParameters.pt(), reco::ForwardProton.pt(), TrackerValidationVariables::AVTrackStruct.pt, goodseedhelpers::HeavyObjectCache.pt, TauL1TPair.pt(), MuScleFitMuon.pt(), ValidationMisalignedTracker.pt, SimpleL1MuGMTCand.pt(), HTrackVariables.pt(), PTrajectoryStateOnDet.pt(), HepLine3D.pt(), L1MuDTTrack.pt(), L1MuBMTrack.pt(), QualityCutsAnalyzer::histogram_element_t.pt, TrajectoryStateClosestToPoint.pt(), MuonDTLocalMillepedeAlgorithm.pt, BPhysicsValidation::ParticleMonitor.pt, susybsm::HSCParticle.pt(), Lepton.pt, reco::PreId.pt(), reco::Candidate.pt(), egHLT::OffPho.pt(), reco::Particle.pt(), reco::ParticleState.pt(), contrib::CMSBoostedTauSeedingAlgorithmStructure.pt(), PrimaryVertexAnalyzer4PUSlimmed::recoPrimaryVertex.pt, MuonResidualsFitter::MuonAlignmentTreeRow.pt, TrackStruct::TrackParameterStruct.pt, CaloParticle.pt(), AlignmentMonitorMuonSystemMap1D::MyTrack.pt, reco::LeafCandidate.pt(), CandidateWithRef< Ref >.pt(), HGCalClusterT< C >.pt(), SimCluster.pt(), reco::PFCluster.pt(), CosmicRateAnalyzer.pt, PtHatRapReweightUserHook.pt, JetAnalyzer_HeavyIons_matching::MyJet.pt, L1Analysis::L1AnalysisRecoMuonDataFormat.pt, TrackingParticle.pt(), GoodSeedProducer.pt, MuonGmtPair.pt(), l1t::EMTFTrack.pt, pat::PackedGenParticle.pt(), pat::MET::Vector2.pt(), RawParticle.pt(), reco::TrackBase.pt(), pat::PackedCandidate.pt(), PMuonSimHit::Trk.pt, and PTrackerSimHit::Trk.pt.

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

Definition at line 39 of file Lepton.py.

References Lepton.Lepton.absIsoR(), PuppiCandidate.pt, eetest::CandForTest.pt(), btagbtvdeep::TrackPairFeatures.pt, btagbtvdeep::SecondaryVertexFeatures.pt, mypt.pt, btagbtvdeep::JetFeatures.pt, btagbtvdeep::SeedingTrackFeatures.pt, res::HelperElectron.pt(), res::HelperMuon.pt(), res::HelperJet.pt(), reco::VoronoiBackground.pt(), RecoObj.pt, btagbtvdeep::SeedingTrackInfoBuilder.pt(), tauImpactParameter::LorentzVectorParticle.pt, ScoutingParticle.pt(), dnn_inputs_2017v1.pt, L1MuCSCPtLut.pt(), ScoutingPhoton.pt(), Residual1DHit.pt, ScoutingElectron.pt(), reco::MuonMETCorrectionData.pt(), PtHatReweightUserHook.pt, MatchStruct.pt, PtEtaPhiMass.pt(), MySimTrack.pt, ALILine.pt(), ScoutingCaloJet.pt(), L2TauPixelTrackMatch::TinyTrack.pt, ResonanceBuilder.Resonance.pt(), ScoutingPFJet.pt(), ScoutingMuon.pt(), DTMuonLocalAlignment.pt, TtFullHadSignalSel.pt(), L1Analysis::L1AnalysisRecoTauDataFormat.pt, ZMuMuIsolationAnalyzer.pt, L1Analysis::L1AnalysisRecoElectronDataFormat.pt, PatTrackAnalyzer::Plots.pt, PGlobalSimHit::Trk.pt, L1Analysis::L1AnalysisRecoMuon2DataFormat.pt, PhysicsObjectsMonitor.pt, SiStripLAProfileBooker.pt, jpt::Map.pt(), reco::CaloMuon.pt(), trigger::TriggerObject.pt(), BSTrkParameters.pt(), reco::ForwardProton.pt(), TrackerValidationVariables::AVTrackStruct.pt, goodseedhelpers::HeavyObjectCache.pt, TauL1TPair.pt(), MuScleFitMuon.pt(), ValidationMisalignedTracker.pt, SimpleL1MuGMTCand.pt(), HTrackVariables.pt(), PTrajectoryStateOnDet.pt(), HepLine3D.pt(), L1MuDTTrack.pt(), L1MuBMTrack.pt(), QualityCutsAnalyzer::histogram_element_t.pt, TrajectoryStateClosestToPoint.pt(), MuonDTLocalMillepedeAlgorithm.pt, BPhysicsValidation::ParticleMonitor.pt, susybsm::HSCParticle.pt(), Lepton.pt, reco::PreId.pt(), reco::Candidate.pt(), egHLT::OffPho.pt(), reco::Particle.pt(), reco::ParticleState.pt(), contrib::CMSBoostedTauSeedingAlgorithmStructure.pt(), PrimaryVertexAnalyzer4PUSlimmed::recoPrimaryVertex.pt, MuonResidualsFitter::MuonAlignmentTreeRow.pt, TrackStruct::TrackParameterStruct.pt, CaloParticle.pt(), AlignmentMonitorMuonSystemMap1D::MyTrack.pt, reco::LeafCandidate.pt(), CandidateWithRef< Ref >.pt(), HGCalClusterT< C >.pt(), SimCluster.pt(), reco::PFCluster.pt(), CosmicRateAnalyzer.pt, PtHatRapReweightUserHook.pt, JetAnalyzer_HeavyIons_matching::MyJet.pt, L1Analysis::L1AnalysisRecoMuonDataFormat.pt, TrackingParticle.pt(), GoodSeedProducer.pt, MuonGmtPair.pt(), l1t::EMTFTrack.pt, pat::PackedGenParticle.pt(), pat::MET::Vector2.pt(), RawParticle.pt(), reco::TrackBase.pt(), pat::PackedCandidate.pt(), PMuonSimHit::Trk.pt, and PTrackerSimHit::Trk.pt.

39  def relIsoR(self, R=0.4, dBetaFactor=0, allCharged=False):
40  return self.absIsoR(R, dBetaFactor, allCharged)/self.pt()
41 
def relIsoR(self, R=0.4, dBetaFactor=0, allCharged=False)
Definition: Lepton.py:39
def absIsoR(self, R=0.4, dBetaFactor=0, allCharged=False)
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  def sip3D(self):
10  '''3D impact parameter significance.'''
11  db, edb = self.dB(self.PV3D), self.edB(self.PV3D)
12  return abs(db/edb) if edb > 0 else 999.
13 
def sip3D(self)
Definition: Lepton.py:9
Abs< T >::type abs(const T &t)
Definition: Abs.h:22