File indexing completed on 2024-04-06 12:24:02
0001 import FWCore.ParameterSet.Config as cms
0002
0003 process = cms.Process("Test")
0004
0005
0006
0007
0008
0009 from PhysicsTools.PatAlgos.patTemplate_cfg import *
0010
0011
0012
0013 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0014 process.inFlightMuons = cms.EDProducer("PATGenCandsFromSimTracksProducer",
0015 src = cms.InputTag("g4SimHits"),
0016 setStatus = cms.int32(-1),
0017 particleTypes = cms.vstring("mu+"),
0018 filter = cms.vstring("pt > 0.5"),
0019 makeMotherLink = cms.bool(True),
0020 writeAncestors = cms.bool(True),
0021 genParticles = cms.InputTag("genParticles"),
0022 )
0023
0024 process.muMatch3 = process.muonMatch.clone(mcStatus = [3])
0025 process.muMatch1 = process.muonMatch.clone(mcStatus = [1])
0026 process.muMatchF = process.muonMatch.clone(mcStatus = [-1], matched = cms.InputTag("inFlightMuons"))
0027
0028 process.muMatch1.checkCharge = False
0029 process.muMatch3.checkCharge = False
0030
0031
0032
0033
0034 process.muMatch3.maxDeltaR = 0.05
0035 process.muMatch3.maxDPtRel = 0.1
0036
0037 process.muMatch1.maxDeltaR = 0.05
0038 process.muMatch1.maxDPtRel = 0.1
0039
0040 process.muMatchF.maxDeltaR = 0.3
0041 process.muMatchF.maxDPtRel = 0.2
0042
0043
0044 process.muonMatchByPt = cms.EDProducer("MCMatcherByPt",
0045 src = cms.InputTag("muons"),
0046 matched = cms.InputTag("genParticles"),
0047 mcPdgId = cms.vint32(13),
0048 checkCharge = cms.bool(True),
0049 mcStatus = cms.vint32(1),
0050 maxDeltaR = cms.double(0.5),
0051 maxDPtRel = cms.double(0.5),
0052 resolveAmbiguities = cms.bool(True),
0053 resolveByMatchQuality = cms.bool(False),
0054 )
0055
0056
0057
0058 process.patDefaultSequence.replace(process.muonMatch,
0059 process.muMatch1 +
0060 process.muMatch3 +
0061 process.muMatchF
0062
0063 )
0064
0065 process.patMuons.genParticleMatch = cms.VInputTag(
0066 cms.InputTag("muMatch3"),
0067 cms.InputTag("muMatch1"),
0068 cms.InputTag("muMatchF")
0069
0070 )
0071
0072
0073
0074
0075
0076
0077 process.TFileService = cms.Service("TFileService",
0078 fileName = cms.string('analyzePatMCMatchingExtended.root')
0079 )
0080
0081 process.MessageLogger = cms.Service("MessageLogger")
0082
0083
0084
0085
0086
0087
0088 process.analyzePatMCMatching = cms.EDAnalyzer("PatMCMatchingExtended",
0089 muonSrc = cms.untracked.InputTag("cleanPatMuons")
0090 )
0091
0092 process.out.outputCommands = cms.untracked.vstring('keep *')
0093 process.outpath.remove(process.out)
0094
0095
0096 process.p = cms.Path(process.inFlightMuons + process.patDefaultSequence + process.analyzePatMCMatching)
0097
0098
0099
0100
0101
0102 process.maxEvents.input = -1
0103
0104
0105 from PhysicsTools.PatAlgos.tools.cmsswVersionTools import pickRelValInputFiles
0106 process.source = cms.Source("PoolSource",
0107 fileNames = cms.untracked.vstring(
0108 pickRelValInputFiles( cmsswVersion = 'CMSSW_4_2_8'
0109
0110 , relVal = 'RelValJpsiMM'
0111 , globalTag = 'START42_V12'
0112 , numberOfFiles = 1
0113 )
0114 )
0115 )
0116
0117 del(process.out)
0118 del(process.outpath)