File indexing completed on 2024-04-06 12:22:48
0001 import FWCore.ParameterSet.Config as cms
0002
0003 process = cms.Process("PATMuon")
0004
0005 process.load("FWCore.MessageService.MessageLogger_cfi")
0006 process.MessageLogger.cerr.FwkReport.reportEvery = 100
0007
0008 process.load('Configuration.StandardSequences.Services_cff')
0009 process.load("Configuration.StandardSequences.GeometryDB_cff")
0010 process.load("Configuration.StandardSequences.MagneticField_38T_cff")
0011 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0012 process.load("Configuration.StandardSequences.Reconstruction_cff")
0013
0014 process.GlobalTag.globaltag = 'PRE_ST62_V8::All'
0015
0016 from Configuration.EventContent.EventContent_cff import *
0017 process.source = cms.Source("PoolSource",
0018 fileNames = cms.untracked.vstring(
0019 '/store/relval/CMSSW_6_2_0/RelValTTbar/GEN-SIM-RECO/PU_PRE_ST62_V8-v2/00000/E03F79C5-A7EC-E211-A92E-003048F00520.root',
0020 ),
0021 inputCommands = RECOSIMEventContent.outputCommands,
0022 dropDescendantsOfDroppedBranches = cms.untracked.bool(False),
0023 )
0024
0025 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
0026 process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
0027
0028 process.oneGoodVertexFilter = cms.EDFilter("VertexSelector",
0029 src = cms.InputTag("offlinePrimaryVertices"),
0030 cut = cms.string("!isFake && ndof >= 4 && abs(z) <= 15 && position.Rho <= 2"),
0031 filter = cms.bool(True),
0032 )
0033 process.noScraping = cms.EDFilter("FilterOutScraping",
0034 applyfilter = cms.untracked.bool(True),
0035 debugOn = cms.untracked.bool(False),
0036 numtrack = cms.untracked.uint32(10),
0037 thresh = cms.untracked.double(0.25)
0038 )
0039 process.countCollisionEvents = cms.EDProducer("EventCountProducer")
0040 process.preFilter = cms.Sequence(process.oneGoodVertexFilter * process.noScraping * process.countCollisionEvents )
0041
0042 process.mergedTruth = cms.EDProducer("GenPlusSimParticleProducer",
0043 src = cms.InputTag("g4SimHits"),
0044 setStatus = cms.int32(5),
0045 filter = cms.vstring("pt > 0.0"),
0046 genParticles = cms.InputTag("genParticles")
0047 )
0048 process.genMuons = cms.EDProducer("GenParticlePruner",
0049 src = cms.InputTag("genParticles"),
0050 select = cms.vstring(
0051 "drop * ",
0052 "++keep abs(pdgId) = 13",
0053 "drop pdgId == 21 && status = 2"
0054 )
0055 )
0056 process.load("PhysicsTools.PatAlgos.mcMatchLayer0.muonMatch_cfi")
0057
0058 process.filter = cms.EDFilter("CandViewCountFilter",
0059 src = cms.InputTag("muons"),
0060 minNumber = cms.uint32(1),
0061 )
0062
0063 import PhysicsTools.PatAlgos.producersLayer1.muonProducer_cfi
0064 process.patMuons = PhysicsTools.PatAlgos.producersLayer1.muonProducer_cfi.patMuons.clone(
0065 muonSource = 'muons',
0066
0067 embedTrack = True,
0068 embedCombinedMuon = True,
0069 embedStandAloneMuon = True,
0070 embedPFCandidate = False,
0071 embedCaloMETMuonCorrs = cms.bool(False),
0072 embedTcMETMuonCorrs = cms.bool(False),
0073
0074
0075 embedPickyMuon = False,
0076 embedTpfmsMuon = False,
0077 userIsolation = cms.PSet(),
0078 isoDeposits = cms.PSet(),
0079 addGenMatch = False,
0080 embedGenMatch = False,
0081 )
0082
0083 process.patMuons.userData.userInts.src = []
0084 process.patMuons.userData.userFloats.src = []
0085 process.patMuons.userData.userCands.src = []
0086 process.patMuons.userData.userClasses.src = []
0087
0088 process.load("MuonAnalysis.MuonAssociators.muonClassificationByHits_cfi")
0089
0090 from MuonAnalysis.MuonAssociators.muonClassificationByHits_cfi import addUserData as addClassByHits
0091 addClassByHits(process.patMuons, extraInfo=True)
0092
0093
0094
0095 process.classByHitsTMLSLoose = process.classByHitsTM.clone(
0096 muonPreselection = cms.string("muonID('TMLastStationLoose')")
0097 )
0098 addClassByHits(process.patMuons, labels=["classByHitsTMLSLoose"], extraInfo=True)
0099
0100
0101 process.go = cms.Path(
0102 process.preFilter +
0103 process.filter +
0104 ( process.mergedTruth *
0105 process.genMuons *
0106 process.muonMatch +
0107 process.muonClassificationByHits +
0108 process.classByHitsTMLSLoose ) *
0109 process.patMuons
0110 )
0111
0112
0113 process.out = cms.OutputModule("PoolOutputModule",
0114 fileName = cms.untracked.string("patMuons_MC.root"),
0115 outputCommands = cms.untracked.vstring(
0116 "drop *",
0117 "keep *_patMuons_*_*",
0118 "keep *_genMuons_*_*",
0119 "keep *_countCollisionEvents_*_*",
0120 "keep recoTrackExtras_standAloneMuons_*_*",
0121 "keep recoTracks_standAloneMuons__*",
0122 "keep edmTriggerResults_*_*_HLT",
0123 "keep l1extraL1MuonParticles_l1extraParticles_*_*",
0124 "keep *_offlinePrimaryVertices__*",
0125 "keep *_offlineBeamSpot__*",
0126 ),
0127 SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring("go")),
0128 )
0129 process.end = cms.EndPath(process.out)