CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
triggerMatcherExamples_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # Examples for configurations of the trigger match for various physics objects
4 #
5 # A detailed description is given in
6 # https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePATTrigger#PATTriggerMatcher
7 # Cuts on the parameters
8 # - 'maxDPtRel' and
9 # - 'maxDeltaR'
10 # are NOT tuned (using old values from TQAF MC match, January 2008)
11 
12 
13 ## Example matches ##
14 
15 # firing trigger objects used in succeeding HLT path 'HLT_Mu17'
16 somePatMuonTriggerMatchHLTMu17 = cms.EDProducer(
17  "PATTriggerMatcherDRDPtLessByR" # match by DeltaR only, best match by DeltaR
18 , src = cms.InputTag( "selectedPatMuons" )
19 , matched = cms.InputTag( "patTrigger" ) # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
20 , matchedCuts = cms.string( 'path( "HLT_Mu17_v*" )' )
21 , maxDPtRel = cms.double( 0.5 )
22 , maxDeltaR = cms.double( 0.5 )
23 , resolveAmbiguities = cms.bool( True ) # only one match per trigger object
24 , resolveByMatchQuality = cms.bool( True ) # take best match found per reco object: by DeltaR here (s. above)
25 )
26 
27 # firing trigger objects used in succeeding HLT path 'HLT_DoubleMu5_IsoMu5'
28 somePatMuonTriggerMatchHLTDoubleMu5IsoMu5 = cms.EDProducer(
29  "PATTriggerMatcherDRDPtLessByR" # match by DeltaR only, best match by DeltaR
30 , src = cms.InputTag( "selectedPatMuons" )
31 , matched = cms.InputTag( "patTrigger" ) # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
32 , matchedCuts = cms.string( 'path( "HLT_DoubleMu5_IsoMu5_v*" )' )
33 , maxDPtRel = cms.double( 0.5 )
34 , maxDeltaR = cms.double( 0.5 )
35 , resolveAmbiguities = cms.bool( True ) # only one match per trigger object
36 , resolveByMatchQuality = cms.bool( True ) # take best match found per reco object: by DeltaR here (s. above)
37 )
38 
39 # firing trigger objects used in succeeding HLT path 'HLT_Photon26_Photon18'
40 somePatPhotonTriggerMatchHLTPhoton26Photon18 = cms.EDProducer(
41  "PATTriggerMatcherDRDPtLessByR" # match by DeltaR only, best match by DeltaR
42 , src = cms.InputTag( "selectedPatPhotons" )
43 , matched = cms.InputTag( "patTrigger" ) # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
44 , matchedCuts = cms.string( 'path( "HLT_Photon26_Photon18_v*" )' )
45 , maxDPtRel = cms.double( 0.5 )
46 , maxDeltaR = cms.double( 0.5 )
47 , resolveAmbiguities = cms.bool( True ) # only one match per trigger object
48 , resolveByMatchQuality = cms.bool( True ) # take best match found per reco object: by DeltaR here (s. above)
49 )
50 
51 # firing trigger objects used in succeeding HLT path 'HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL'
52 somePatElectronTriggerMatchHLTEle17CaloIdTCaloIsoVLTrkIdVLTrkIsoVL = cms.EDProducer(
53  "PATTriggerMatcherDRDPtLessByR" # match by DeltaR only, best match by DeltaR
54 , src = cms.InputTag( "selectedPatElectrons" )
55 , matched = cms.InputTag( "patTrigger" ) # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
56 , matchedCuts = cms.string( 'path( "HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_v*" )' )
57 , maxDPtRel = cms.double( 0.5 )
58 , maxDeltaR = cms.double( 0.5 )
59 , resolveAmbiguities = cms.bool( True ) # only one match per trigger object
60 , resolveByMatchQuality = cms.bool( True ) # take best match found per reco object: by DeltaR here (s. above)
61 )
62 
63 # firing trigger objects used in succeeding HLT path 'HLT_DoubleMediumIsoPFTau30_Trk1_eta2p1'
64 somePatTauTriggerMatchHLTDoubleMediumIsoPFTau30Trk1eta2p1 = cms.EDProducer(
65  "PATTriggerMatcherDRDPtLessByR" # match by DeltaR only, best match by DeltaR
66 , src = cms.InputTag( "selectedPatTaus" )
67 , matched = cms.InputTag( "patTrigger" ) # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
68 , matchedCuts = cms.string( 'path( "HLT_DoubleMediumIsoPFTau30_Trk1_eta2p1_v*" )' )
69 , maxDPtRel = cms.double( 0.5 )
70 , maxDeltaR = cms.double( 0.5 )
71 , resolveAmbiguities = cms.bool( True ) # only one match per trigger object
72 , resolveByMatchQuality = cms.bool( True ) # take best match found per reco object: by DeltaR here (s. above)
73 )
74 
75 # firing trigger objects used in succeeding HLT path 'HLT_PFJet40'
76 somePatJetTriggerMatchHLTPFJet40 = cms.EDProducer(
77  "PATTriggerMatcherDRLessByR" # match by DeltaR only, best match by DeltaR
78 , src = cms.InputTag( 'selectedPatJets' )
79 , matched = cms.InputTag( 'patTrigger' ) # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
80 , matchedCuts = cms.string( 'path( "HLT_PFJet40_v*" )' )
81 , maxDPtRel = cms.double( 3.0 )
82 , maxDeltaR = cms.double( 0.4 )
83 , resolveAmbiguities = cms.bool( True ) # only one match per trigger object
84 , resolveByMatchQuality = cms.bool( True ) # take best match found per reco object: by DeltaR here (s. above)
85 )
86 
87 # firing trigger objects used in succeeding HLT path 'HLT_MET120'
88 somePatMetTriggerMatchHLTMET120 = cms.EDProducer(
89  "PATTriggerMatcherDRLessByR" # match by DeltaR only, best match by DeltaR
90 , src = cms.InputTag( 'patMETs' )
91 , matched = cms.InputTag( 'patTrigger' ) # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
92 , matchedCuts = cms.string( 'path( "HLT_MET120_v*" )' )
93 , maxDPtRel = cms.double( 3.0 )
94 , maxDeltaR = cms.double( 0.4 )
95 , resolveAmbiguities = cms.bool( True ) # only one match per trigger object
96 , resolveByMatchQuality = cms.bool( True ) # take best match found per reco object: by DeltaR here (s. above)
97 )
98 
99 # firing trigger objects used in succeeding HLT path 'HLT_Mu8_DiJet30' (x-trigger)
100 somePatMuonTriggerMatchHLTMu8DiJet30 = cms.EDProducer(
101  "PATTriggerMatcherDRDPtLessByR" # match by DeltaR only, best match by DeltaR
102 , src = cms.InputTag( "selectedPatMuons" )
103 , matched = cms.InputTag( "patTrigger" ) # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
104 , matchedCuts = cms.string( 'type( "TriggerMuon" ) && path( "HLT_Mu8_DiJet30_v*" )' )
105 , maxDPtRel = cms.double( 0.5 )
106 , maxDeltaR = cms.double( 0.5 )
107 , resolveAmbiguities = cms.bool( True ) # only one match per trigger object
108 , resolveByMatchQuality = cms.bool( True ) # take best match found per reco object: by DeltaR here (s. above)
109 )
110 somePatJetTriggerMatchHLTMu8DiJet30 = cms.EDProducer(
111  "PATTriggerMatcherDRDPtLessByR" # match by DeltaR only, best match by DeltaR
112 , src = cms.InputTag( "selectedPatJets" )
113 , matched = cms.InputTag( "patTrigger" ) # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
114 , matchedCuts = cms.string( 'type( "TriggerJet" ) && path( "HLT_Mu8_DiJet30_v*" )' )
115 , maxDPtRel = cms.double( 3.0 )
116 , maxDeltaR = cms.double( 0.4 )
117 , resolveAmbiguities = cms.bool( True ) # only one match per trigger object
118 , resolveByMatchQuality = cms.bool( True ) # take best match found per reco object: by DeltaR here (s. above)
119 )
120 
121 
122 _exampleTriggerMatchers = [ 'somePatMuonTriggerMatchHLTMu17'
123  , 'somePatMuonTriggerMatchHLTDoubleMu5IsoMu5'
124  , 'somePatPhotonTriggerMatchHLTPhoton26Photon18'
125  , 'somePatElectronTriggerMatchHLTEle17CaloIdTCaloIsoVLTrkIdVLTrkIsoVL'
126  , 'somePatTauTriggerMatchHLTDoubleMediumIsoPFTau30Trk1eta2p1'
127  , 'somePatJetTriggerMatchHLTPFJet40'
128  , 'somePatMetTriggerMatchHLTMET120'
129  , 'somePatMuonTriggerMatchHLTMu8DiJet30'
130  , 'somePatJetTriggerMatchHLTMu8DiJet30'
131  ]
132 
133 
134 ## Further examples ##
135 
136 # L1 e/gammas by original collection
137 somePatElectronTriggerMatchL1EGammaCollection = cms.EDProducer(
138  "PATTriggerMatcherDRLessByR" # match by DeltaR only, best match by DeltaR
139 , src = cms.InputTag( 'selectedPatElectrons' )
140 , matched = cms.InputTag( 'patTrigger' ) # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
141 , matchedCuts = cms.string( 'coll( "l1extraParticles:NonIsolated" ) || coll( "l1extraParticles:Isolated" )' )
142 , maxDPtRel = cms.double( 0.5 )
143 , maxDeltaR = cms.double( 0.5 )
144 , resolveAmbiguities = cms.bool( True ) # only one match per trigger object
145 , resolveByMatchQuality = cms.bool( False ) # take first match found per reco object
146 )
147 
148 # L1 and HLT muons by ID
149 somePatMuonTriggerMatchTriggerMuon = cms.EDProducer(
150  "PATTriggerMatcherDRDPtLessByR" # match by DeltaR and DeltaPt, best match by DeltaR
151 , src = cms.InputTag( 'selectedPatMuons' )
152 , matched = cms.InputTag( 'patTrigger' ) # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
153 , matchedCuts = cms.string( 'type( "TriggerL1Mu" ) || type( "TriggerMuon" )' )
154 , maxDPtRel = cms.double( 0.5 )
155 , maxDeltaR = cms.double( 0.5 )
156 , resolveAmbiguities = cms.bool( True ) # only one match per trigger object
157 , resolveByMatchQuality = cms.bool( False ) # take first match found per reco object
158 )
159 
160 # firing trigger objects used in succeeding HLT paths of PD /SingleMu
161 somePatMuonTriggerMatchPDSingleMu = cms.EDProducer(
162  "PATTriggerMatcherDRDPtLessByR" # match by DeltaR and DeltaPt, best match by DeltaR
163 , src = cms.InputTag( 'selectedPatMuons' )
164 , matched = cms.InputTag( 'patTrigger' ) # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
165 , matchedCuts = cms.string( 'path( "HLT_RelIso1p0Mu5_v*" ) || path( "HLT_RelIso1p0Mu20_v*" ) || path( "HLT_Mu5_v*" ) || path( "HLT_Mu50_eta2p1_v*" ) || path( "HLT_Mu40_v*" ) || path( "HLT_Mu40_eta2p1_v*" ) || path( "HLT_Mu40_eta2p1_Track60_dEdx3p7_v*" ) || path( "HLT_Mu40_eta2p1_Track50_dEdx3p6_v*" ) || path( "HLT_Mu30_v*" ) || path( "HLT_Mu30_eta2p1_v*" ) || path( "HLT_Mu24_v*" ) || path( "HLT_Mu24_eta2p1_v*" ) || path( "HLT_Mu24_PFJet30_PFJet25_Deta3_CentralPFJet25_v*" ) || path( "HLT_Mu24_CentralPFJet30_CentralPFJet25_v*" ) || path( "HLT_Mu24_CentralPFJet30_CentralPFJet25_v*" ) || path( "HLT_Mu17_eta2p1_TriCentralPFNoPUJet45_35_25_v*" ) || path( "HLT_Mu17_eta2p1_CentralPFNoPUJet30_BTagIPIter_v*" ) || path( "HLT_Mu15_eta2p1_v*" ) || path( "HLT_Mu15_eta2p1_TriCentral_40_20_20_v*" ) || path( "HLT_Mu15_eta2p1_TriCentral_40_20_20_DiBTagIP3D1stTrack_v*" ) || path( "HLT_Mu15_eta2p1_TriCentral_40_20_20_BTagIP3D1stTrack_v*" ) || path( "HLT_Mu15_eta2p1_L1Mu10erJetC12WdEtaPhi1DiJetsC_v*" ) || path( "HLT_Mu12_v*" ) || path( "HLT_Mu12_eta2p1_L1Mu10erJetC12WdEtaPhi1DiJetsC_v*" ) || path( "HLT_Mu12_eta2p1_DiCentral_40_20_v*" ) || path( "HLT_Mu12_eta2p1_DiCentral_40_20_DiBTagIP3D1stTrack_v*" ) || path( "HLT_Mu12_eta2p1_DiCentral_20_v*" ) || path( "HLT_L2Mu70_2Cha_eta2p1_PFMET60_v*" ) || path( "HLT_L2Mu70_2Cha_eta2p1_PFMET55_v*" ) || path( "HLT_IsoMu40_eta2p1_v*" ) || path( "HLT_IsoMu34_eta2p1_v*" ) || path( "HLT_IsoMu30_v*" ) || path( "HLT_IsoMu30_eta2p1_v*" ) || path( "HLT_IsoMu24_v*" ) || path( "HLT_IsoMu24_eta2p1_v*" ) || path( "HLT_IsoMu24_PFJet30_PFJet25_Deta3_CentralPFJet25_v*" ) || path( "HLT_IsoMu24_CentralPFJet30_CentralPFJet25_v*" ) || path( "HLT_IsoMu24_CentralPFJet30_CentralPFJet25_PFMET20_v*" ) || path( "HLT_IsoMu20_eta2p1_v*" ) || path( "HLT_IsoMu20_eta2p1_CentralPFJet80_v*" ) || path( "HLT_IsoMu20_WCandPt80_v*" ) || path( "HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet45_35_25_v*" ) || path( "HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet30_v*" ) || path( "HLT_IsoMu17_eta2p1_DiCentralPFNoPUJet30_v*" ) || path( "HLT_IsoMu17_eta2p1_CentralPFNoPUJet30_v*" ) || path( "HLT_IsoMu17_eta2p1_CentralPFNoPUJet30_BTagIPIter_v*" )' )
166 , maxDPtRel = cms.double( 0.5 )
167 , maxDeltaR = cms.double( 0.5 )
168 , resolveAmbiguities = cms.bool( True ) # only one match per trigger object
169 , resolveByMatchQuality = cms.bool( True ) # take best match found per reco object: by DeltaR here (s. above)
170 )
171 
172 # all trigger objects used in HLT path 'HLT_Mu17' (fake MET)
173 somePatMetTriggerMatchHLTMu17 = cms.EDProducer(
174  "PATTriggerMatcherDRLessByR" # match by DeltaR only, best match by DeltaR
175 , src = cms.InputTag( 'patMETs' )
176 , matched = cms.InputTag( 'patTrigger' ) # default producer label as defined in PhysicsTools/PatAlgos/python/triggerLayer1/triggerProducer_cfi.py
177 , matchedCuts = cms.string( 'path( "HLT_Mu17_v*" )' )
178 , maxDPtRel = cms.double( 0.5 )
179 , maxDeltaR = cms.double( 0.5 )
180 , resolveAmbiguities = cms.bool( True ) # only one match per trigger object
181 , resolveByMatchQuality = cms.bool( True ) # take best match found per reco object: by DeltaR here (s. above)
182 )
183 
184 triggerMatcherExamplesTask = cms.Task(
185  somePatMuonTriggerMatchHLTMu17,
186  somePatMuonTriggerMatchHLTDoubleMu5IsoMu5,
187  somePatPhotonTriggerMatchHLTPhoton26Photon18,
188  somePatElectronTriggerMatchHLTEle17CaloIdTCaloIsoVLTrkIdVLTrkIsoVL,
189  somePatTauTriggerMatchHLTDoubleMediumIsoPFTau30Trk1eta2p1,
190  somePatJetTriggerMatchHLTPFJet40,
191  somePatMetTriggerMatchHLTMET120,
192  somePatMuonTriggerMatchHLTMu8DiJet30,
193  somePatJetTriggerMatchHLTMu8DiJet30,
194  somePatElectronTriggerMatchL1EGammaCollection,
195  somePatMuonTriggerMatchTriggerMuon,
196  somePatMuonTriggerMatchPDSingleMu,
197  somePatMetTriggerMatchHLTMu17
198 )