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 process.maxEvents.input = 1000
0013
0014
0015 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0016 process.inFlightMuons = cms.EDProducer("PATGenCandsFromSimTracksProducer",
0017 src = cms.InputTag("g4SimHits"),
0018 setStatus = cms.int32(-1),
0019 particleTypes = cms.vstring("mu+"),
0020 filter = cms.vstring("pt > 0.5"),
0021 makeMotherLink = cms.bool(True),
0022 writeAncestors = cms.bool(True),
0023 genParticles = cms.InputTag("genParticles"),
0024 )
0025
0026 process.muMatch3 = process.muonMatch.clone(mcStatus = [3])
0027 process.muMatch1 = process.muonMatch.clone(mcStatus = [1])
0028
0029
0030
0031 process.patDefaultSequence.replace(process.muonMatch,
0032 process.muMatch1 +
0033 process.muMatch3
0034 )
0035
0036 process.patMuons.genParticleMatch = cms.VInputTag(
0037 cms.InputTag("muMatch3"),
0038 cms.InputTag("muMatch1")
0039 )
0040
0041
0042
0043
0044
0045
0046 process.TFileService = cms.Service("TFileService",
0047 fileName = cms.string('analyzePatMCMatching.root')
0048 )
0049
0050 process.MessageLogger = cms.Service("MessageLogger")
0051
0052
0053
0054
0055
0056
0057 process.analyzePatMCMatching = cms.EDAnalyzer("PatMCMatching",
0058 muonSrc = cms.untracked.InputTag("cleanPatMuons")
0059 )
0060
0061
0062 process.outpath.remove(process.out)
0063
0064 process.p = cms.Path(process.patDefaultSequence + process.analyzePatMCMatching)
0065
0066 del(process.out)
0067 del(process.outpath)
0068