CMS 3D CMS Logo

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

Public Member Functions

def __init__
 
def absEffAreaIso
 
def chargedAllIso
 
def chargedAllIsoR
 
def chargedHadronIsoR
 
def dxy
 
def dz
 
def edxy
 
def edz
 
def looseId
 
def muonID
 
def mvaId
 
def neutralHadronIsoR
 
def photonIsoR
 
def puChargedHadronIsoR
 
def setTrackForDxyDz
 
def tightId
 

Private Attributes

 _trackForDxyDz
 

Detailed Description

Definition at line 3 of file Muon.py.

Constructor & Destructor Documentation

def Muon.Muon.__init__ (   self,
  args,
  kwargs 
)

Definition at line 4 of file Muon.py.

4 
5  def __init__(self, *args, **kwargs):
6  super(Muon, self).__init__(*args, **kwargs)
7  self._trackForDxyDz = "muonBestTrack"
def __init__
Definition: Muon.py:4
_trackForDxyDz
Definition: Muon.py:6

Member Function Documentation

def Muon.Muon.absEffAreaIso (   self,
  rho,
  effectiveAreas 
)

Definition at line 52 of file Muon.py.

References Lepton.Lepton.absIsoFromEA(), DBlmapWriter::_LMapRowHBEF.eta, res::HelperElectron.eta(), res::HelperMuon.eta(), res::HelperJet.eta(), RecoObj.eta, muonisolation::NominalEfficiencyThresholds::ThresholdLocation.eta, MSLayersKeeperX0AtEta.eta(), HcalCellType::HcalCell.eta, res::HelperMET.eta(), SimG4HcalHitCluster.eta(), Raddam_ch.eta, jetData.eta, SuperClusterHelper.eta(), Residual1DHit.eta, CaloHit.eta(), DDHCalTBZposAlgo.eta, DDHCalTestBeamAlgo.eta, MatchStruct.eta, HcalChannelId.eta, PtEtaPhiMass.eta(), BenchmarkTreeEntry.eta, HcalFlexiHardcodeGeometryLoader::HBHOCellParameters.eta, learn_.eta, ImpactPoint.eta, reco::isodeposit::Direction.eta(), L2TauPixelTrackMatch::TinyTrack.eta, EnergyResolutionVsLumi::DegradationAtEta.eta, TrackerValidationVariables::AVHitStruct.eta, egHLT::BinData.eta, ShallowClustersProducer::NearDigis.eta(), ElectronMVAEstimator.eta, LMapLoader::_LMapRowHBEF.eta, LMapRow.eta, DTMuonLocalAlignment.eta, HcalTestHistoClass::Hit.eta, HcalFlexiHardcodeGeometryLoader::HECellParameters.eta, PatTrackAnalyzer::Plots.eta, ZMuMuIsolationAnalyzer.eta, PHcalTB04Info.eta(), BeamProfileVtxGenerator.eta(), MaterialBudgetCastorHistos.eta, lhef::JetClustering::Jet.eta(), GloballyPositioned< float >.eta(), GloballyPositioned< align::Scalar >.eta(), GloballyPositioned< T >.eta(), RotationType.eta(), QcdLowPtDQM::Pixel.eta(), PHcalTB06Info::Hit.eta, IdealZPrism.eta(), StripCPEgeometric::WrappedCluster.eta(), IdealObliquePrism.eta(), jpt::Map.eta(), OnePiRange< T >.eta(), Geom::OnePiRange< T >.eta(), PGlobalSimHit::CalHit.eta, MaterialBudget.eta, HLTJetsCleanedFromLeadingLeptons< JetType >::EtaPhiE.eta(), L1MuGMTEtaLUT.eta(), trigger::TriggerObject.eta(), FWPFCandidateDetailView.eta(), JetCalibrationParameterSetTauJet.eta(), TrackerValidationVariables::AVTrackStruct.eta, MaterialBudgetForward.eta, XMLHTRZeroSuppressionLoader::_datasetDBConfig.eta, PFECALSuperClusterAlgo::CalibratedPFCluster.eta(), reco::GhostTrackPrediction.eta(), HcalDDDRecConstants::HcalActiveLength.eta, HcalTB02HistoClass.eta(), MaterialBudgetHcalHistos.eta, IsolatedPixelTrackCandidateProducer::seedAtEC.eta, HcalFlexiHardcodeGeometryLoader::HFCellParameters.eta, reco::PattRecoPeak< double >.eta(), reco::PattRecoPeak< float >.eta(), PattRecoPeak< Real >.eta(), reco::PattRecoPeak< Real >.eta(), SoftElectronMVAEstimator.eta, PGlobalSimHit::FwdHit.eta, reco::CaloMuon.eta(), PHcalTB06Info.eta(), PdtPdgMini.eta, HTrackVariables.eta(), SimpleL1MuGMTCand.eta(), CSCSP_SPblock.eta(), MuScleFitMuon.eta(), ValidationMisalignedTracker.eta, EleRelPoint.eta(), HcalDDDRecConstantsTemp::HcalActiveLength.eta, reco::CastorCell.eta(), XMLProcessor::_LMapRowHBEF.eta, cms::MinBias.eta, PhotonFix.eta(), L1MuDTEtaPattern.eta(), LMapDetId.eta, PatPhotonSimpleAnalyzer::struct_recPhoton.eta, PGlobalSimHit::BrlHit.eta, cms::Analyzer_minbias.eta, PhotonIDSimpleAnalyzer::struct_recPhoton.eta, reco::IsoDeposit.eta(), reco::CastorEgamma.eta(), reco::CastorJet.eta(), PV3DBase< float, PointTag, GlobalTag >.eta(), PV3DBase< align::Scalar, PointTag, GlobalTag >.eta(), Point3DBase< T, Frame >.eta(), QcdLowPtDQM::Tracklet.eta(), PV3DBase< Scalar, VectorTag, GlobalTag >.eta(), Vector3DBase< double, LocalTag >.eta(), Point3DBase< U, GlobalTag >.eta(), Vector3DBase< U, LocalTag >.eta(), PV3DBase< float, VectorTag, LocalTag >.eta(), PV3DBase< float, PointTag, LocalTag >.eta(), PV3DBase< float, VectorTag, MeasurementTag >.eta(), PV3DBase< float, VectorTag, GlobalTag >.eta(), PV3DBase< Scalar, PointTag, GlobalTag >.eta(), PV3DBase< T, VectorTag, FrameTag >.eta(), Point3DBase< U, LocalTag >.eta(), Vector3DBase< U, FrameTag >.eta(), PV3DBase< T, PVType, FrameType >.eta(), PV3DBase< float, PointTag, MeasurementTag >.eta(), Vector3DBase< U, GlobalTag >.eta(), PV3DBase< long double, PointTag, GlobalTag >.eta(), PV3DBase< T, PointTag, GlobalTag >.eta(), Vector3DBase< T, FrameTag >.eta(), Vector3DBase< T, Frame >.eta(), PV3DBase< T, PointTag, FrameTag >.eta(), Point3DBase< U, FrameTag >.eta(), Vector3DBase< U, Frame >.eta(), Point3DBase< U, Frame >.eta(), MuonDTLocalMillepedeAlgorithm.eta, L1MuDTTrack.eta(), L1MuDTEtaProcessor.eta(), HcalTB02Analysis.eta, EgammaTowerIsolationNew< NC >.eta, L1TDEMON.eta, MuonGmtPair.eta(), L1TdeGCT.eta, reco::PreId.eta(), reco::CastorCluster.eta(), Lepton.eta, reco::Candidate.eta(), egHLT::OffPho.eta(), JetPartonNamespace::JetPartonCalibrationParameterSet.eta(), reco::Particle.eta(), TrackingParticle.eta(), reco::ParticleState.eta(), L1GctInternJetData.eta(), egHLT::OffEle.eta(), pat::PackedGenParticle.eta(), EcalTestPulseAnalyzer.eta, EcalABAnalyzer.eta, MuonGeometryArrange::MGACollection.eta, pat::PackedCandidate.eta(), Basic3DVector< long double >.eta(), reco::LeafCandidate.eta(), CandidateWithRef< Ref >.eta(), EcalPerEvtLaserAnalyzer.eta, reco::IsoDeposit::const_iterator.eta(), Basic3DVector< align::Scalar >.eta(), Basic3DVector< Scalar >.eta(), Basic3DVector< float >.eta(), Basic3DVector< float > mom GlobalVector.eta(), Basic3DVector< double >.eta(), Basic3DVector< float > pos GlobalPoint.eta(), Basic3DVector< U >.eta(), Basic3DVector< T >.eta(), GoodSeedProducer.eta, reco::CaloCluster.eta(), EcalLaserAnalyzer.eta, RawParticle.eta(), EcalLaserAnalyzer2.eta, SiPixelErrorEstimation.eta, HLTEgamma::OpenHLTPhoton.eta, reco::TrackBase.eta(), HLTEgamma::OpenHLTElectron.eta, EcalSelectiveReadoutValidation::energiesEb_t.eta, EcalSelectiveReadoutValidation::energiesEe_t.eta, SiPixelTrackingRecHitsValid.eta, PMuonSimHit::Trk.eta, and PTrackerSimHit::Trk.eta.

Referenced by Lepton.Lepton.relEffAreaIso().

52 
53  def absEffAreaIso(self,rho,effectiveAreas):
54  return self.absIsoFromEA(rho,self.eta(),effectiveAreas.muon)
55 
56 
def absEffAreaIso
Definition: Muon.py:52
def Muon.Muon.chargedAllIso (   self)

Definition at line 104 of file Muon.py.

References Muon.Muon.chargedAllIsoR(), and Electron.Electron.chargedAllIsoR().

Referenced by Lepton.Lepton.absIso().

105  def chargedAllIso(self):
106  return self.chargedAllIsoR()
def chargedAllIso
Definition: Muon.py:104
def chargedAllIsoR
Definition: Muon.py:99
def Muon.Muon.chargedAllIsoR (   self,
  R = 0.4 
)

Definition at line 99 of file Muon.py.

Referenced by Muon.Muon.chargedAllIso().

99 
100  def chargedAllIsoR(self,R=0.4):
101  if R == 0.3: return self.physObj.pfIsolationR03().sumChargedParticlePt
102  elif R == 0.4: return self.physObj.pfIsolationR04().sumChargedParticlePt
103  raise RuntimeError, "Muon chargedAllIso missing for R=%s" % R
def chargedAllIsoR
Definition: Muon.py:99
def Muon.Muon.chargedHadronIsoR (   self,
  R = 0.4 
)

Definition at line 84 of file Muon.py.

84 
85  def chargedHadronIsoR(self,R=0.4):
86  if R == 0.3: return self.physObj.pfIsolationR03().sumChargedHadronPt
87  elif R == 0.4: return self.physObj.pfIsolationR04().sumChargedHadronPt
88  raise RuntimeError, "Muon chargedHadronIso missing for R=%s" % R
def chargedHadronIsoR
Definition: Muon.py:84
def Muon.Muon.dxy (   self,
  vertex = None 
)
either pass the vertex, or set associatedVertex before calling the function.
note: the function does not work with standalone muons as innerTrack
is not available.

Definition at line 57 of file Muon.py.

References Muon.Muon._trackForDxyDz, Electron.Electron.associatedVertex, and reco::tau::RecoTauVertexAssociator.associatedVertex().

57 
58  def dxy(self, vertex=None):
59  '''either pass the vertex, or set associatedVertex before calling the function.
60  note: the function does not work with standalone muons as innerTrack
61  is not available.
62  '''
63  if vertex is None:
64  vertex = self.associatedVertex
65  return getattr(self,self._trackForDxyDz)().dxy( vertex.position() )
def dxy
Definition: Muon.py:57
_trackForDxyDz
Definition: Muon.py:6
def Muon.Muon.dz (   self,
  vertex = None 
)
either pass the vertex, or set associatedVertex before calling the function.
note: the function does not work with standalone muons as innerTrack
is not available.

Definition at line 71 of file Muon.py.

References Muon.Muon._trackForDxyDz, Electron.Electron.associatedVertex, and reco::tau::RecoTauVertexAssociator.associatedVertex().

71 
72  def dz(self, vertex=None):
73  '''either pass the vertex, or set associatedVertex before calling the function.
74  note: the function does not work with standalone muons as innerTrack
75  is not available.
76  '''
77  if vertex is None:
78  vertex = self.associatedVertex
79  return getattr(self,self._trackForDxyDz)().dz( vertex.position() )
_trackForDxyDz
Definition: Muon.py:6
def dz
Definition: Muon.py:71
def Muon.Muon.edxy (   self)
returns the uncertainty on dxy (from gsf track)

Definition at line 66 of file Muon.py.

References Muon.Muon._trackForDxyDz.

66 
67  def edxy(self):
68  '''returns the uncertainty on dxy (from gsf track)'''
69  return getattr(self,self._trackForDxyDz)().dxyError()
70 
def edxy
Definition: Muon.py:66
_trackForDxyDz
Definition: Muon.py:6
def Muon.Muon.edz (   self)
returns the uncertainty on dxz (from gsf track)

Definition at line 80 of file Muon.py.

References Muon.Muon._trackForDxyDz.

80 
81  def edz(self):
82  '''returns the uncertainty on dxz (from gsf track)'''
83  return getattr(self,self._trackForDxyDz)().dzError()
def edz
Definition: Muon.py:80
_trackForDxyDz
Definition: Muon.py:6
def Muon.Muon.looseId (   self)
Loose ID as recommended by mu POG.

Definition at line 13 of file Muon.py.

Referenced by Muon.Muon.muonID().

13 
14  def looseId( self ):
15  '''Loose ID as recommended by mu POG.'''
16  return self.physObj.isLooseMuon()
def looseId
Definition: Muon.py:13
def Muon.Muon.muonID (   self,
  name,
  vertex = None 
)

Definition at line 21 of file Muon.py.

References reco::MuonTrackLinks.globalTrack(), reco::Muon.globalTrack(), pat::Muon.globalTrack(), reco::CaloMuon.innerTrack(), reco::Muon.innerTrack(), pat::Muon.innerTrack(), HcalRaddamMuon.innerTrack, HcalHBHEMuonAnalyzer.innerTrack, reco::ShallowClonePtrCandidate.isGlobalMuon(), reco::ShallowCloneCandidate.isGlobalMuon(), reco::LeafRefCandidateT.isGlobalMuon(), reco::Muon.isGlobalMuon(), pat::PackedGenParticle.isGlobalMuon(), CandidateWithRef< Ref >.isGlobalMuon(), reco::LeafCandidate.isGlobalMuon(), reco::Candidate.isGlobalMuon(), pat::PackedCandidate.isGlobalMuon(), Muon.Muon.looseId(), and reco::Muon.numberOfMatchedStations().

Referenced by Muon.Muon.tightId().

21 
22  def muonID(self, name, vertex=None):
23  if name == "" or name is None:
24  return True
25  if name.startswith("POG_"):
26  if name == "POG_ID_Loose": return self.physObj.isLooseMuon()
27  if vertex is None:
28  vertex = getattr(self, 'associatedVertex', None)
29  if name == "POG_ID_Tight": return self.physObj.isTightMuon(vertex)
30  if name == "POG_ID_HighPt": return self.physObj.isHighPtMuon(vertex)
31  if name == "POG_ID_Soft": return self.physObj.isSoftMuon(vertex)
32  if name == "POG_ID_TightNoVtx": return self.looseId() and \
33  self.isGlobalMuon() and \
34  self.globalTrack().normalizedChi2() < 10 and \
35  self.globalTrack().hitPattern().numberOfValidMuonHits() > 0 and \
36  self.numberOfMatchedStations()>1 and \
37  self.innerTrack().hitPattern().numberOfValidPixelHits()>0 and \
38  self.innerTrack().hitPattern().trackerLayersWithMeasurement() > 5
39  if name == "POG_ID_Medium":
40  if not self.looseId(): return False
41  goodGlb = self.physObj.isGlobalMuon() and self.physObj.globalTrack().normalizedChi2() < 3 and self.physObj.combinedQuality().chi2LocalPosition < 12 and self.physObj.combinedQuality().trkKink < 20;
42  return self.physObj.innerTrack().validFraction() >= 0.8 and self.physObj.segmentCompatibility() >= (0.303 if goodGlb else 0.451)
43  if name == "POG_Global_OR_TMArbitrated":
44  return self.physObj.isGlobalMuon() or (self.physObj.isTrackerMuon() and self.physObj.numberOfMatchedStations() > 0)
45  return self.physObj.muonID(name)
def looseId
Definition: Muon.py:13
def muonID
Definition: Muon.py:21
def Muon.Muon.mvaId (   self)
For a transparent treatment of electrons and muons. Returns -99

Definition at line 46 of file Muon.py.

46 
47  def mvaId(self):
48  '''For a transparent treatment of electrons and muons. Returns -99'''
49  return -99
50 
51 
def mvaId
Definition: Muon.py:46
def Muon.Muon.neutralHadronIsoR (   self,
  R = 0.4 
)

Definition at line 89 of file Muon.py.

89 
90  def neutralHadronIsoR(self,R=0.4):
91  if R == 0.3: return self.physObj.pfIsolationR03().sumNeutralHadronEt
92  elif R == 0.4: return self.physObj.pfIsolationR04().sumNeutralHadronEt
93  raise RuntimeError, "Muon neutralHadronIso missing for R=%s" % R
def neutralHadronIsoR
Definition: Muon.py:89
def Muon.Muon.photonIsoR (   self,
  R = 0.4 
)

Definition at line 94 of file Muon.py.

94 
95  def photonIsoR(self,R=0.4):
96  if R == 0.3: return self.physObj.pfIsolationR03().sumPhotonEt
97  elif R == 0.4: return self.physObj.pfIsolationR04().sumPhotonEt
98  raise RuntimeError, "Muon photonIso missing for R=%s" % R
def photonIsoR
Definition: Muon.py:94
def Muon.Muon.puChargedHadronIsoR (   self,
  R = 0.4 
)

Definition at line 107 of file Muon.py.

108  def puChargedHadronIsoR(self,R=0.4):
109  if R == 0.3: return self.physObj.pfIsolationR03().sumPUPt
110  elif R == 0.4: return self.physObj.pfIsolationR04().sumPUPt
111  raise RuntimeError, "Muon chargedHadronIso missing for R=%s" % R
112 
113 
114 
115 
def puChargedHadronIsoR
Definition: Muon.py:107
def Muon.Muon.setTrackForDxyDz (   self,
  what 
)

Definition at line 8 of file Muon.py.

References Muon.Muon._trackForDxyDz.

8 
9  def setTrackForDxyDz(self,what):
10  if not hasattr(self,what):
11  raise RuntimeError, "I don't have a track called "+what
12  self._trackForDxyDz = what
def setTrackForDxyDz
Definition: Muon.py:8
_trackForDxyDz
Definition: Muon.py:6
def Muon.Muon.tightId (   self)
Tight ID as recommended by mu POG (unless redefined in the lepton analyzer).

Definition at line 17 of file Muon.py.

References Muon.Muon.muonID(), and pat::Muon.muonID().

17 
18  def tightId( self ):
19  '''Tight ID as recommended by mu POG (unless redefined in the lepton analyzer).'''
20  return getattr(self,"tightIdResult",self.muonID("POG_ID_Tight"))
def tightId
Definition: Muon.py:17
def muonID
Definition: Muon.py:21

Member Data Documentation

Muon.Muon._trackForDxyDz
private

Definition at line 6 of file Muon.py.

Referenced by Muon.Muon.dxy(), Muon.Muon.dz(), Muon.Muon.edxy(), Muon.Muon.edz(), and Muon.Muon.setTrackForDxyDz().