/
producePatTrigger_cfg.py
70 lines (62 loc) · 2.56 KB
/
producePatTrigger_cfg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
### ========
### Skeleton
### ========
## ---
## Start with pre-defined skeleton process
## ---
from PhysicsTools.PatAlgos.patTemplate_cfg import *
import FWCore.Utilities.FileUtils as FileUtils
mylist=FileUtils.loadListFromFile('/afs/cern.ch/user/m/mshi/amumu_trigger_matching/CMSSW_7_4_1_patch4/src/sourceFiles.txt')
## switch to uncheduled mode
process.options.allowUnscheduled = cms.untracked.bool(True)
#process.Tracer = cms.Service("Tracer")
#process.load("PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff")
#process.load("PhysicsTools.PatAlgos.selectionLayer1.selectedPatCandidates_cff")
##process.load("PhysicsTools.PatAlgos.slimming.slimming_cff")
process.source.fileNames = cms.untracked.vstring(*mylist)
process.maxEvents.input = 1000 # reduce number of events for testing.
process.options.wantSummary = True # to suppress the long output at the end of the job
### ========
### Plug-ins
### ========
## ---
## PAT trigger matching
## --
process.muonTriggerMatchHLTMuons = cms.EDProducer(
# matching in DeltaR, sorting by best DeltaR
"PATTriggerMatcherDRLessByR"
# matcher input collections
, src = cms.InputTag( 'slimmedMuons' )
, matched = cms.InputTag( 'patTrigger' )
# selections of trigger objects
, matchedCuts = cms.string( 'type( "TriggerMuon" ) && path( "HLT_Mu16_TkMu0_dEta18_Onia_v1", 1, 0 )' ) # input does not yet have the 'saveTags' parameter in HLT
# selection of matches
, maxDPtRel = cms.double( 0.5 ) # no effect here
, maxDeltaR = cms.double( 0.5 )
, maxDeltaEta = cms.double( 0.2 ) # no effect here
# definition of matcher output
, resolveAmbiguities = cms.bool( True )
, resolveByMatchQuality = cms.bool( True )
)
### ============
### Python tools
### ============
## --
## Switch to selected PAT objects in the main work flow
## --
##from PhysicsTools.PatAlgos.tools.coreTools import removeCleaning
##removeCleaning( process ) ## this function is not available anymore in 70X (TJ)
# to save a bit of disk space
process.out.outputCommands += [ 'drop *_*_*_*'
,'keep *_patTrigger*_*_*'
,'keep *_slimmedMuons*_*_*'
]
process.out.fileName = 'edmPatTrigger.root'
## --
## Switch on PAT trigger
## --
from PhysicsTools.PatAlgos.tools.trigTools import *
switchOnTrigger( process ) # This is optional and can be omitted.
switchOnTriggerMatching( process, triggerMatchers = [ 'muonTriggerMatchHLTMuons' ])
# Switch to selected PAT objects in the trigger matching
#removeCleaningFromTriggerMatching( process ) ## this function is not available anymore in 70X (TJ)