File indexing completed on 2024-07-02 00:53:35
0001 import FWCore.ParameterSet.Config as cms
0002
0003 from PhysicsTools.NanoAOD.common_cff import *
0004 from DPGAnalysis.MuonTools.common_cff import *
0005
0006 from PhysicsTools.NanoAOD.simplePATMuonFlatTableProducer_cfi import simplePATMuonFlatTableProducer
0007
0008 from PhysicsTools.PatAlgos.producersLayer1.muonProducer_cfi import *
0009
0010 muonFlatTable = simplePATMuonFlatTableProducer.clone(
0011 src = cms.InputTag("patMuons"),
0012 name = cms.string("muon"),
0013 doc = cms.string("RECO muon information"),
0014
0015 variables = cms.PSet(CandVars,
0016 isGlobal = Var("isGlobalMuon", bool, doc="muon is a global muon"),
0017 isTracker = Var("isTrackerMuon", bool, doc="muon is a tracker muon"),
0018
0019 isStandalone = Var("isStandAloneMuon", bool, doc="muon is a standalone muon"),
0020 isRPC = Var("isRPCMuon", bool, doc="muon is an RPC muon"),
0021 isGEM = Var("isGEMMuon", bool, doc="muon is a GEM muon"),
0022
0023 isLoose = Var("passed('CutBasedIdLoose')", bool, doc="Loose muon ID"),
0024 isMedium = Var("passed('CutBasedIdMedium')", bool, doc="Medium muon ID"),
0025 isTight = Var("passed('CutBasedIdTight')", bool, doc="Tight muon ID"),
0026
0027 pfIso04 = Var("(pfIsolationR04().sumChargedHadronPt + max(pfIsolationR04().sumNeutralHadronEt + pfIsolationR04().sumPhotonEt - pfIsolationR04().sumPUPt/2,0.0))/pt", float, doc="relative PF-isolation (delta beta corrected, 0.4 cone)", precision=6),
0028 trkIso03 = Var("isolationR03().sumPt/tunePMuonBestTrack().pt", float, doc="relative tracker isolation (0.3 cone)", precision=6),
0029
0030 trk_dz = Var(f"?!innerTrack().isNull()? dB('PVDZ') : {defaults.FLOAT}", float, doc="dz (with sign) wrt first PV - cm", precision=10),
0031 trk_dxy = Var(f"?!innerTrack().isNull()? dB('PV2D') : {defaults.FLOAT}", float, doc="dxy (with sign) wrt first PV - cm", precision=10),
0032
0033 trk_algo = Var(f"?!innerTrack().isNull()? innerTrack().algo() : {defaults.INT_POS}", "int16", doc="iterative tracking algorithm used to build the inner track"),
0034 trk_origAlgo = Var(f"?!innerTrack().isNull()? innerTrack().originalAlgo() : {defaults.INT_POS}", "int16", doc="original (pre muon iterations) iterative tracking algorithm used to build the inner track"),
0035
0036 trk_numberOfValidPixelHits = Var(f"?!innerTrack().isNull()? innerTrack().hitPattern().numberOfValidPixelHits() : {defaults.INT_POS}", "int16", doc="number of valid pixel hits"),
0037 trk_numberOfValidTrackerLayers = Var(f"?!innerTrack().isNull()? innerTrack().hitPattern().trackerLayersWithMeasurement() : {defaults.INT_POS}", "int16", doc="number of valid tracker layers"),
0038 trk_validFraction = Var(f"?!innerTrack().isNull()? innerTrack().validFraction() : {defaults.FLOAT_POS}", "int16", doc="fraction of tracker layer with muon hits"),
0039
0040 trkMu_stationMask = Var("stationMask()", "uint8", doc="bit map of stations with tracks within given distance (in cm) of chamber edges"),
0041 trkMu_numberOfMatchedStations = Var("numberOfMatchedStations()", "int16", doc="number of matched DT/CSC stations"),
0042 rpcMu_numberOfMatchedRPCLayers = Var("numberOfMatchedRPCLayers()", "int16", doc="number of matched RPC layers"),
0043
0044 staMu_numberOfValidMuonHits = Var(f"?isStandAloneMuon()? outerTrack().hitPattern().numberOfValidMuonHits() : {defaults.INT_POS}", "int16", doc="Number of valid muon hits"),
0045
0046 staMu_normChi2 = Var(f"?isStandAloneMuon()? outerTrack().chi2()/outerTrack().ndof() : {defaults.FLOAT_POS}", float, doc="chi2/ndof (standalone track)", precision=10),
0047 glbMu_normChi2 = Var(f"?isGlobalMuon()? globalTrack().chi2()/globalTrack().ndof() : {defaults.FLOAT_POS}", float, doc="chi2/ndof (global track)", precision=10)
0048 )
0049 )
0050
0051 from DPGAnalysis.MuonTools.muDTMuonExtTableProducer_cfi import muDTMuonExtTableProducer
0052
0053 muDTMuonExtTable = muDTMuonExtTableProducer.clone()
0054
0055 from RecoMuon.TrackingTools.MuonServiceProxy_cff import MuonServiceProxy
0056
0057 from DPGAnalysis.MuonTools.muGEMMuonExtTableProducer_cfi import muGEMMuonExtTableProducer
0058
0059 muGEMMuonExtTable = muGEMMuonExtTableProducer.clone()
0060 muGEMMuonExtTable.ServiceParameters = MuonServiceProxy.ServiceParameters
0061
0062 from DPGAnalysis.MuonTools.muCSCTnPFlatTableProducer_cfi import muCSCTnPFlatTableProducer
0063 muCSCTnPFlatTable = muCSCTnPFlatTableProducer.clone()
0064 muCSCTnPFlatTable.ServiceParameters = MuonServiceProxy.ServiceParameters
0065
0066 muRecoTables = cms.Sequence(patMuons
0067 + muonFlatTable
0068 + muDTMuonExtTable
0069 + muGEMMuonExtTable
0070 + muCSCTnPFlatTable
0071 )