Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:23:59

0001 ## import skeleton process
0002 from PhysicsTools.PatAlgos.patTemplate_cfg import *
0003 
0004 #process.Tracer = cms.Service("Tracer")
0005 
0006 # load the PAT config
0007 process.load("PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff")
0008 patAlgosToolsTask.add(process.patCandidatesTask)
0009 #Temporary customize to the unit tests that fail due to old input samples
0010 process.patTaus.skipMissingTauID = True
0011 
0012 process.load("PhysicsTools.PatAlgos.selectionLayer1.selectedPatCandidates_cff")
0013 patAlgosToolsTask.add(process.selectedPatCandidatesTask)
0014 
0015 ## add inFlightMuons
0016 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0017 process.inFlightMuons = cms.EDProducer("PATGenCandsFromSimTracksProducer",
0018         src           = cms.InputTag("g4SimHits"),   ## use "fastSimProducer" for FastSim
0019         setStatus     = cms.int32(-1),
0020         particleTypes = cms.vstring("mu+"),          ## picks also mu-, of course
0021         filter        = cms.vstring("pt > 0.5"),     ## just for testing
0022         makeMotherLink = cms.bool(True),
0023         writeAncestors = cms.bool(True),             ## save also the intermediate GEANT ancestors of the muons
0024         genParticles   = cms.InputTag("genParticles"),
0025 )
0026 patAlgosToolsTask.add(process.inFlightMuons)
0027 
0028 process.out.outputCommands.append('keep *_inFlightMuons_*_*')
0029 
0030 ## prepare several clones of match associations for status 1, 3 and in flight muons (status -1)
0031 process.muMatch3 = process.muonMatch.clone(mcStatus = cms.vint32( 3))
0032 patAlgosToolsTask.add(process.muMatch3)
0033 
0034 process.muMatch1 = process.muonMatch.clone(mcStatus = cms.vint32( 1))
0035 patAlgosToolsTask.add(process.muMatch1)
0036 
0037 process.muMatchF = process.muonMatch.clone(mcStatus = cms.vint32(-1),matched = cms.InputTag("inFlightMuons"))
0038 patAlgosToolsTask.add(process.muMatchF)
0039 
0040 process.patMuons.genParticleMatch = cms.VInputTag(
0041     cms.InputTag("muMatch3"),
0042     cms.InputTag("muMatch1"),
0043     cms.InputTag("muMatchF"),
0044 )
0045 
0046 ## dump event content
0047 process.content = cms.EDAnalyzer("EventContentAnalyzer")
0048 
0049 ## ------------------------------------------------------
0050 #  In addition you usually want to change the following
0051 #  parameters:
0052 ## ------------------------------------------------------
0053 #
0054 #   process.GlobalTag.globaltag =  ...    ##  (according to https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions)
0055 #                                         ##
0056 ## switch to RECO input
0057 from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarGENSIMRECO
0058 process.source.fileNames = filesRelValTTbarGENSIMRECO
0059 #                                         ##
0060 process.maxEvents.input = 10
0061 #                                         ##
0062 #   process.out.outputCommands = [ ... ]  ##  (e.g. taken from PhysicsTools/PatAlgos/python/patEventContent_cff.py)
0063 #                                         ##
0064 process.out.fileName = 'patTuple_addDecayInFlight.root'
0065 #                                         ##
0066 #   process.options.wantSummary = False   ##  (to suppress the long output at the end of the job)