Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:03

0001 
0002 ### ========
0003 ### Skeleton
0004 ### ========
0005 
0006 ## ---
0007 ## Start with pre-defined skeleton process
0008 ## ---
0009 from PhysicsTools.PatAlgos.patTemplate_cfg import *
0010 
0011 ## ---
0012 ## Modifications
0013 ## ---
0014 # general
0015 process.maxEvents.input     = 1000 # reduce number of events for testing.
0016 process.options.wantSummary = False # to suppress the long output at the end of the job
0017 # specific
0018 process.patJetCorrFactors.useRho = False
0019 process.patJets.addTagInfos      = False # to save space
0020 process.selectedPatMuons.cut     = 'isTrackerMuon=1 & isGlobalMuon=1 & innerTrack.numberOfValidHits>=11 & globalTrack.normalizedChi2<10.0  & globalTrack.hitPattern.numberOfValidMuonHits>0 & abs(dB)<0.02 & (trackIso+caloIso)/pt<0.05'
0021 
0022 ## ---
0023 ## Define the path
0024 ## ---
0025 process.p = cms.Path(
0026   process.patDefaultSequence
0027 )
0028 
0029 ### ========
0030 ### Plug-ins
0031 ### ========
0032 
0033 ## ---
0034 ## PAT trigger matching
0035 ## --
0036 process.muonTriggerMatchHLTMuons = cms.EDProducer(
0037   # matching in DeltaR, sorting by best DeltaR
0038   "PATTriggerMatcherDRLessByR"
0039   # matcher input collections
0040 , src     = cms.InputTag( 'cleanPatMuons' )
0041 , matched = cms.InputTag( 'patTrigger' )
0042   # selections of trigger objects
0043 , matchedCuts = cms.string( 'type( "TriggerMuon" ) && path( "HLT_Mu24_v*", 1, 0 )' ) # input does not yet have the 'saveTags' parameter in HLT
0044   # selection of matches
0045 , maxDPtRel   = cms.double( 0.5 ) # no effect here
0046 , maxDeltaR   = cms.double( 0.5 )
0047 , maxDeltaEta = cms.double( 0.2 ) # no effect here
0048   # definition of matcher output
0049 , resolveAmbiguities    = cms.bool( True )
0050 , resolveByMatchQuality = cms.bool( True )
0051 )
0052 
0053 ### ============
0054 ### Python tools
0055 ### ============
0056 
0057 ## --
0058 ## Switch to selected PAT objects in the main work flow
0059 ## --
0060 from PhysicsTools.PatAlgos.tools.coreTools import removeCleaning
0061 removeCleaning( process )
0062 # to save a bit of disk space
0063 process.out.outputCommands += [ 'drop recoBaseTagInfosOwned_*_*_*'
0064                               , 'drop CaloTowers_*_*_*'
0065                               , 'drop recoGenJets_*_*_*'
0066                               ]
0067 
0068 ## --
0069 ## Switch on PAT trigger
0070 ## --
0071 from PhysicsTools.PatAlgos.tools.trigTools import *
0072 switchOnTrigger( process ) # This is optional and can be omitted.
0073 switchOnTriggerMatching( process, triggerMatchers = [ 'muonTriggerMatchHLTMuons' ] )
0074 # Switch to selected PAT objects in the trigger matching
0075 removeCleaningFromTriggerMatching( process )