CMS 3D CMS Logo

triggerObjects_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
4 from PhysicsTools.NanoAOD.triggerObjectTableProducer_cfi import triggerObjectTableProducer
5 from PhysicsTools.NanoAOD.globalVariablesTableProducer_cfi import globalVariablesTableProducer
6 import copy
7 
8 unpackedPatTrigger = cms.EDProducer("PATTriggerObjectStandAloneUnpacker",
9  patTriggerObjectsStandAlone = cms.InputTag('slimmedPatTrigger'),
10  triggerResults = cms.InputTag('TriggerResults::HLT'),
11  unpackFilterLabels = cms.bool(True)
12 )
13 
14 def mksel( selection, doc=None, bit=None):
15  ddoc=""
16  if 'OR' in selection:
17  selection,ddoc=OR(selection)
18  if 'AND' in selection:
19  selection,ddoc=AND(selection)
20  if type(selection)==list:
21  selection,ddoc=OR(selection)
22  if type(selection)==tuple:
23  selection,ddoc=AND(selection)
24  if doc==None:
25  doc=ddoc
26  #print("creating an entry with",selection,doc)
27  return cms.PSet(selection=cms.string(selection),doc=cms.string(doc),bit=cms.uint32(bit)) if bit is not None else cms.PSet(selection=cms.string(selection),doc=cms.string(doc))
28 
29 def chaintoken_(tokens,f,OR_or_AND=None):
30  if (not type(tokens) in [list,tuple]):
31  doc=tokens
32  tokens= [t.strip().rstrip() for t in tokens.split(OR_or_AND)]
33  else:
34  doc=f' {OR_or_AND} '.join(tokens)
35  selection = f"filter('{tokens[0]}')"
36  for token in tokens[1:]:
37  filter = f"filter('{token}')"
38  selection = f"{f}({filter},{selection})"
39  return selection,doc
40 def OR(tokens):
41  return chaintoken_(tokens,"max","OR")
42 def AND(tokens):
43  return chaintoken_(tokens,"min","AND")
44 
45 triggerObjectTable = triggerObjectTableProducer.clone(
46  name= cms.string("TrigObj"),
47  src = cms.InputTag("unpackedPatTrigger"),
48  l1EG = cms.InputTag("caloStage2Digis","EGamma"),
49  l1Sum = cms.InputTag("caloStage2Digis","EtSum"),
50  l1Jet = cms.InputTag("caloStage2Digis","Jet"),
51  l1Muon = cms.InputTag("gmtStage2Digis","Muon"),
52  l1Tau = cms.InputTag("caloStage2Digis","Tau"),
53  selections = cms.PSet(
54  Electron = cms.PSet(
55  doc = cms.string("PixelMatched e/gamma"), # this may also select photons!
56  id = cms.int32(11),
57  sel = cms.string("type(92) && pt > 7 && (coll('hltEgammaCandidates') || coll('hltEgammaCandidatesUnseeded')) && (filter('*PixelMatchFilter') || filter('*PixelMatchUnseededFilter'))"),
58  l1seed = cms.string("type(-98)"), l1deltaR = cms.double(0.3),
59  #l2seed = cms.string("type(92) && coll('')"), l2deltaR = cms.double(0.5),
60  skipObjectsNotPassingQualityBits = cms.bool(True),
61  qualityBits = cms.VPSet(
62  mksel("filter('*CaloIdLTrackIdLIsoVL*TrackIso*Filter')","CaloIdL_TrackIdL_IsoVL"),
63  mksel("filter('hltEle*WPTight*TrackIsoFilter*')","1e (WPTight)"),
64  mksel("filter('hltEle*WPLoose*TrackIsoFilter')","1e (WPLoose)"),
65  mksel("filter('*OverlapFilter*IsoEle*PFTau*')","OverlapFilter PFTau"),
66  mksel("filter('hltEle*Ele*CaloIdLTrackIdLIsoVLTrackIsoLeg1Filter')","2e (Leg 1)"),
67  mksel("filter('hltEle*Ele*CaloIdLTrackIdLIsoVLTrackIsoLeg2Filter')","2e (Leg 2)"),
68  mksel("filter('hltMu*TrkIsoVVL*Ele*CaloIdLTrackIdLIsoVL*Filter*')","1e-1mu"),
69  mksel("filter('hlt*OverlapFilterIsoEle*PFTau*')","1e-1tau"),
70  mksel("filter('hltEle*Ele*Ele*CaloIdLTrackIdLDphiLeg*Filter')","3e"),
71  mksel(["hltL3fL1Mu*DoubleEG*Filtered*","hltMu*DiEle*CaloIdLTrackIdLElectronleg*Filter"],"2e-1mu"),
72  mksel(["hltL3fL1DoubleMu*EG*Filter*","hltDiMu*Ele*CaloIdLTrackIdLElectronleg*Filter"],"1e-2mu"),
73  mksel(("hltEle32L1DoubleEGWPTightGsfTrackIsoFilter","hltEGL1SingleEGOrFilter"),"1e (32_L1DoubleEG_AND_L1SingleEGOr)"),
74  mksel("filter('hltEle*CaloIdVTGsfTrkIdTGsfDphiFilter')","1e (CaloIdVT_GsfTrkIdT)"),
75  mksel("path('HLT_Ele*PFJet*')","1e (PFJet)"),
76  mksel(["hltEG175HEFilter","hltEG200HEFilter"],"1e (Photon175_OR_Photon200)"),
77  mksel("filter('hltEle*CaloIdLMWPMS2Filter')","2e (CaloIdL_MW seeded)"),
78  mksel("filter('hltDiEle*CaloIdLMWPMS2UnseededFilter')","2e (CaloIdL_MW unseeded)")
79  )
80  ),
81  Photon = cms.PSet(
82  id = cms.int32(22),
83  sel = cms.string("type(92) && pt > 15 && coll('hltEgammaCandidates')"),
84  l1seed = cms.string("type(-98)"), l1deltaR = cms.double(0.3),
85  #l2seed = cms.string("type(92) && coll('')"), l2deltaR = cms.double(0.5),
86  skipObjectsNotPassingQualityBits = cms.bool(True),
87  qualityBits = cms.VPSet(
88  mksel("filter('hltEG33L1EG26HEFilter')","hltEG33L1EG26HEFilter"),
89  mksel("filter('hltEG50HEFilter')","hltEG50HEFilter"),
90  mksel("filter('hltEG75HEFilter')","hltEG75HEFilter"),
91  mksel("filter('hltEG90HEFilter')","hltEG90HEFilter"),
92  mksel("filter('hltEG120HEFilter')","hltEG120HEFilter"),
93  mksel("filter('hltEG150HEFilter')","hltEG150HEFilter"),
94  mksel("filter('hltEG175HEFilter')","hltEG175HEFilter"),
95  mksel("filter('hltEG200HEFilter')","hltEG200HEFilter"),
96  mksel("filter('hltHtEcal800')","hltHtEcal800"),
97  mksel("filter('hltEG110EBTightIDTightIsoTrackIsoFilter')","hltEG110EBTightIDTightIsoTrackIsoFilter"),
98  mksel("filter('hltEG120EBTightIDTightIsoTrackIsoFilter')","hltEG120EBTightIDTightIsoTrackIsoFilter"),
99  mksel("filter('hltMu17Photon30IsoCaloIdPhotonlegTrackIsoFilter')","1mu-1photon"),
100  mksel("filter('hltEG30LR9Id85b90eHE12R9Id50b80eR9IdLastFilter')","hltEG30LR9Id85b90eHE12R9Id50b80eR9IdLastFilter"),
101  mksel("filter('hltEG30LIso60CaloId15b35eHE12R9Id50b80eEcalIsoLastFilter')","hltEG30LIso60CaloId15b35eHE12R9Id50b80eEcalIsoLastFilter"),
102  mksel("filter('hltEG22Iso60CaloId15b35eHE12R9Id50b80eTrackIsoUnseededLastFilter')","hltEG22Iso60CaloId15b35eHE12R9Id50b80eTrackIsoUnseededLastFilter"),
103  mksel("filter('hltEG22R9Id85b90eHE12R9Id50b80eR9UnseededLastFilter')","hltEG22R9Id85b90eHE12R9Id50b80eR9UnseededLastFilter"),
104  mksel("filter('hltEG30Iso60CaloId15b35eR9Id50b90eHE12b10eR9Id50b80eEcalIsoFilter')","hltEG30Iso60CaloId15b35eR9Id50b90eHE12b10eR9Id50b80eEcalIsoFilter"),
105  mksel("filter('hltEG18TrackIso60Iso60CaloId15b35eR9Id50b90eHE12b10eR9Id50b80eTrackIsoUnseededFilter')","hltEG18TrackIso60Iso60CaloId15b35eR9Id50b90eHE12b10eR9Id50b80eTrackIsoUnseededFilter")
106  )
107  ),
108  Muon = cms.PSet(
109  id = cms.int32(13),
110  sel = cms.string("type(83) && pt > 5 && (coll('hltIterL3MuonCandidates') || (pt > 45 && coll('hltHighPtTkMuonCands')) || (pt > 95 && coll('hltOldL3MuonCandidates')))"),
111  l1seed = cms.string("type(-81)"), l1deltaR = cms.double(0.5),
112  l2seed = cms.string("type(83) && coll('hltL2MuonCandidates')"), l2deltaR = cms.double(0.3),
113  skipObjectsNotPassingQualityBits = cms.bool(True),
114  qualityBits = cms.VPSet(
115  mksel(["*RelTrkIsoVVLFiltered0p4","*RelTrkIsoVVLFiltered"],"TrkIsoVVL"),
116  mksel(["hltL3crIso*IsoFiltered0p07","hltL3crIso*IsoFiltered0p08","hltL3crIso*IsoFiltered"],"Iso"),
117  mksel("filter('*OverlapFilterIsoMu*PFTau*')","OverlapFilter PFTau"),
118  mksel(["hltL3crIsoL1*SingleMu*IsoFiltered0p07","hltL3crIsoL1sMu*IsoFiltered0p07","hltL3crIsoL1*SingleMu*IsoFiltered0p08","hltL3crIsoL1sMu*IsoFiltered0p08","hltL3crIsoL1*SingleMu*IsoFiltered","hltL3crIsoL1sMu*IsoFiltered"],"1mu"),
119  mksel("filter('hltDiMuon*Filtered*')","2mu"),
120  mksel("filter('hltMu*TrkIsoVVL*Ele*CaloIdLTrackIdLIsoVL*Filter*')","1mu-1e"),
121  mksel("filter('hlt*OverlapFilterIsoMu*PFTau*')","1mu-1tau"),
122  mksel("filter('hltL3fL1TripleMu*')","3mu"),
123  mksel(["hltL3fL1DoubleMu*EG*Filtered*","hltDiMu*Ele*CaloIdLTrackIdLElectronleg*Filter"],"2mu-1e"),
124  mksel(["hltL3fL1Mu*DoubleEG*Filtered*","hltMu*DiEle*CaloIdLTrackIdLElectronleg*Filter"],"1mu-2e"),
125  mksel(["hltL3fL1sMu*L3Filtered50*","hltL3fL1sMu*TkFiltered50*"],"1mu (Mu50)"),
126  mksel(["hltL3fL1sMu*L3Filtered100*","hltL3fL1sMu*TkFiltered100*"],"1mu (Mu100)"),
127  mksel("filter('hltMu17Photon30IsoCaloIdMuonlegL3Filtered17Q')","1mu-1photon")
128  )
129  ),
130  Tau = cms.PSet(
131  id = cms.int32(15),
132  sel = cms.string("type(84) && pt > 5 && coll('*Tau*') && ( filter('*Loose*') || filter('*Medium*') || filter('*Tight*') || filter('*DeepTau*') || filter('*ChargedIso*') || filter('hltL2Tau*IsoFilter*') || filter('hltL2TauTagNNFilter*') || filter('*OverlapFilter*') || filter('*DisplPFTau*') || filter('*VBFIsoTau*') || filter('*Monitoring*') || filter('*DoublePFTau*') || filter('*SingleTau*') || filter('hlt*SelectedPFTau') || filter('*ETau*') || filter('*MuTau*') )"), #All trigger objects from a Tau collection + passing at least one filter
133  l1seed = cms.string("type(-100)"), l1deltaR = cms.double(0.3),
134  l2seed = cms.string("type(84) && coll('hltL2TauJetsL1IsoTauSeeded')"), l2deltaR = cms.double(0.3),
135  skipObjectsNotPassingQualityBits = cms.bool(True),
136  qualityBits = cms.VPSet(
137  mksel("filter('*Loose*')","Loose"), # 0
138  mksel("filter('*Medium*')","Medium"), # 1
139  mksel("filter('*Tight*')","Tight"), # 2
140  mksel("filter('*DeepTau*')","DeepTau no spec WP"), #3
141  mksel("filter('*ChargedIso*')","ChargedIso"), # 4
142  mksel("filter('*Hps*')","HPS"), # 5
143  mksel("filter('*ETau*')","e-tau inside filter"), # 6
144  mksel("filter('*MuTau*')","mu-tau inside filter"), # 7
145  mksel("filter('*SingleTau*')","single-tau inside filter"), # 8
146  mksel("filter('hltMatchedVBFIsoTau*')","VBF matching"), # 9
147  mksel("filter('hlt*DoublePFTau*L1HLTMatched')","di-tau"), # 10
148  mksel("filter('hltHpsOverlapFilterIsoEle*WPTightGsf*PFTau*')","e-tau"), # 11
149  mksel("filter('hltHpsOverlapFilterIsoMu*PFTau*')","mu-tau"), # 12
150  mksel("filter('hltHpsOverlapFilterDeepTauDoublePFTau*PFJet*')","di-tau + PFJet"), # 13
151  mksel("filter('hltHpsOverlapFilterDisplacedEle*DisplPFTau*')","e-tau displaced"), # 14
152  mksel("filter('hltHpsOverlapFilterDisplacedMu*DisplPFTau*')","mu-tau displaced"), # 15
153  mksel("filter('hlt*Double*ChargedIsoDisplPFTau*')","di-tau displaced"), # 16
154  mksel("filter('*Monitoring')","Monitoring"), # 17
155  mksel("filter('*MonitoringForVBFIsoTau')","MonitoringForVBFIsoTau"), # 18
156  mksel("filter('hltHpsOverlapFilterDeepTauPFTau*PFJet*')","'Monitoring di-tau + PFJet"), # 19
157  mksel("filter('hltHpsOverlapFilterIsoMu*MediumChargedIsoDisplTau*')","'Monitoring muTau displaced"), # 20
158  mksel("filter('*OneProng*')","OneProng"), # 21
159  mksel("filter('*2*DiJetCorr*')","DiJetCorr"), # 22
160  mksel("filter('*OverlapFilter*')","OverlapFilter"), # 23
161  mksel("filter('*Dxy*')","Dxy"), # 24
162  mksel("filter('*L1HLTMatched*')","MatchL1HLT"), # 25
163  mksel("filter('*L1Seeded')","MatchL1HLT"), # 26
164  mksel("filter('hltHpsOverlapFilterIsoMu27MediumDeepTauDitauWPPFTau20')","VBF + DoubleTau Monitoring"), # 27
165  mksel("filter('hltHpsOverlapFilterIsoMu24MediumDeepTauPFTau20')","For matching to monitoring trigger for 20 GeV tau leg of VBF triggers"), # 28
166  mksel("filter('*SinglePFTau*')","single PF-tau inside filter"), # 29
167  )
168  ),
169  BoostedTau = cms.PSet(
170  id = cms.int32(1515),
171  sel = cms.string("type(85) && pt > 120 && coll('hltAK8PFJetsCorrected') && filter('hltAK8SinglePFJets*SoftDropMass40*ParticleNetTauTau')"),
172  l1seed = cms.string("type(-99)"), l1deltaR = cms.double(0.3),
173  l2seed = cms.string("type(85) && coll('hltAK8CaloJetsCorrectedIDPassed')"), l2deltaR = cms.double(0.3),
174  skipObjectsNotPassingQualityBits = cms.bool(True),
175  qualityBits = cms.VPSet(
176  mksel("filter('hltAK8SinglePFJets*SoftDropMass40*ParticleNetTauTau')","HLT_AK8PFJetX_SoftDropMass40_PFAK8ParticleNetTauTau0p30"),
177  mksel(["hltAK8SinglePFJets230SoftDropMass40PNetTauTauTag0p03"])
178  )
179  ),
180  Jet = cms.PSet(
181  id = cms.int32(1),
182  sel = cms.string("( type(0) || type(85) || type(86) || type(-99) )"),
183  l1seed = cms.string("type(-99)"), l1deltaR = cms.double(0.3),
184  l2seed = cms.string("type(85) || type(86) || type(-99)"), l2deltaR = cms.double(0.3),
185  skipObjectsNotPassingQualityBits = cms.bool(True),
186  qualityBits = cms.VPSet(
187  mksel(["hlt4PixelOnlyPFCentralJetTightIDPt20"]), # 0
188  mksel(["hlt3PixelOnlyPFCentralJetTightIDPt30"]), # 1
189  mksel(["hltPFJetFilterTwoC30"]), # 2
190  mksel(["hlt4PFCentralJetTightIDPt30"]), # 3
191  mksel(["hlt4PFCentralJetTightIDPt35"]), # 4
192  mksel(["hltQuadCentralJet30"]), # 5
193  mksel(["hlt2PixelOnlyPFCentralJetTightIDPt40"]), # 6
194  mksel(["hltL1sTripleJet1008572VBFIorHTTIorDoubleJetCIorSingleJet","hltL1sTripleJet1058576VBFIorHTTIorDoubleJetCIorSingleJet","hltL1sTripleJetVBFIorHTTIorSingleJet"]), # 7
195  mksel(["hlt3PFCentralJetTightIDPt40"]), # 8
196  mksel(["hlt3PFCentralJetTightIDPt45"]), # 9
197  mksel(["hltL1sQuadJetC60IorHTT380IorHTT280QuadJetIorHTT300QuadJet","hltL1sQuadJetC50to60IorHTT280to500IorHTT250to340QuadJet"]), # 10
198  mksel(["hltBTagCaloDeepCSVp17Double"]), # 11
199  mksel(["hltPFCentralJetLooseIDQuad30"]), # 12
200  mksel(["hlt1PFCentralJetLooseID75"]), # 13
201  mksel(["hlt2PFCentralJetLooseID60"]), # 14
202  mksel(["hlt3PFCentralJetLooseID45"]), # 15
203  mksel(["hlt4PFCentralJetLooseID40"]), # 16
204  mksel("filter('hltHpsOverlapFilterDeepTauDoublePFTau*PFJet*')","(Double tau + jet) hltHpsOverlapFilterDeepTauDoublePFTau*PFJet*"), # 17
205  mksel("filter('*CrossCleaned*MediumDeepTauDitauWPPFTau*')","(VBF cross-cleaned from medium deeptau PFTau) *CrossCleaned*MediumDeepTauDitauWPPFTau*"), # 18
206  mksel("filter('*CrossCleanedUsingDiJetCorrChecker*')","(VBF cross-cleaned using dijet correlation checker) *CrossCleanedUsingDiJetCorrChecker*"), # 19
207  mksel("filter('hltHpsOverlapFilterDeepTauPFTau*PFJet*')","(monitoring muon + tau + jet) hltHpsOverlapFilterDeepTauPFTau*PFJet*"), # 20
208  mksel(["hlt2PFCentralJetTightIDPt50"]), # 21
209  mksel(["hlt1PixelOnlyPFCentralJetTightIDPt60"]), # 22
210  mksel(["hlt1PFCentralJetTightIDPt70"]), # 23
211  mksel(["hltBTagPFDeepJet1p5Single"]), # 24
212  mksel(["hltBTagPFDeepJet4p5Triple"]), # 25
213  mksel(["hltBTagCentralJetPt35PFParticleNet2BTagSum0p65","hltBTagCentralJetPt30PFParticleNet2BTagSum0p65","hltPFJetTwoC30PFBTagParticleNet2BTagSum0p65","hltPFCentralJetPt30PNet2BTagMean0p55"]), # 26
214  mksel(["hlt2PixelOnlyPFCentralJetTightIDPt20","hlt1PixelOnlyPFCentralJetTightIDPt50"]), # 27
215  mksel(["hlt2PFCentralJetTightIDPt30","hltPF2CentralJetTightIDPt30"]), # 28
216  mksel(["hlt1PFCentralJetTightIDPt60"]), # 29
217  mksel(["hltPF2CentralJetPt30PNet2BTagMean0p50"]), # 30
218 
219  ),
220  ),
221  FatJet = cms.PSet(
222  id = cms.int32(6),
223  sel = cms.string("type(85) && pt > 120"),
224  l1seed = cms.string("type(-99)"), l1deltaR = cms.double(0.3),
225  l2seed = cms.string("type(85) && coll('hltAK8CaloJetsCorrectedIDPassed')"), l2deltaR = cms.double(0.3),
226  skipObjectsNotPassingQualityBits = cms.bool(True),
227  qualityBits = cms.VPSet(
228  mksel("coll('hltAK8PFJetsCorrected')"), #1, always present
229  mksel(["hltAK8SingleCaloJet200"]), #2, always present
230  mksel("coll('hltAK8PFSoftDropJets230')"), #4, present if nothing else below is fired, otherwise 12, 20, 28, 52, 60
231  mksel(["hltAK8SinglePFJets230SoftDropMass40BTagParticleNetBB0p35",
232  "hltAK8SinglePFJets250SoftDropMass40BTagParticleNetBB0p35",
233  "hltAK8SinglePFJets275SoftDropMass40BTagParticleNetBB0p35"]), # 12 if nothing below is fired, #28 if also "hltAK8DoublePFJetSDModMass30", #60 if also "hltAK8DoublePFJetSDModMass50"
234  mksel(["hltAK8DoublePFJetSDModMass30"]), # 16 if onthing else (except #1), 20 if also #4, 28 if also #12
235  mksel(["hltAK8DoublePFJetSDModMass50"]), # 48 if also (obviously) "hltAK8DoublePFJetSDModMass30", 52 if also #4, #60 if all above
236  )
237  ),
238  MET = cms.PSet(
239  id = cms.int32(2),
240  sel = cms.string("type(87) && pt > 30 && coll('hltPFMETProducer')"),
241  l1seed = cms.string("type(-87) && coll('L1ETM')"), l1deltaR = cms.double(9999),
242  l1seed_2 = cms.string("type(-87) && coll('L1ETMHF')"), l1deltaR_2 = cms.double(9999),
243  l2seed = cms.string("type( 87) && coll('hltMetClean')"), l2deltaR = cms.double(9999),
244  skipObjectsNotPassingQualityBits = cms.bool(True),
245  qualityBits = cms.VPSet()
246  ),
247  HT = cms.PSet(
248  id = cms.int32(3),
249  sel = cms.string("type(89) || type(-89)"),
250  l1seed = cms.string("type(-89) && coll('L1HTT')"), l1deltaR = cms.double(9999),
251  l1seed_2 = cms.string("type(-89) && coll('L1HTTHF')"), l1deltaR_2 = cms.double(9999),
252  l2seed = cms.string("type(89) && coll('hltHtMhtJet30')"), l2deltaR = cms.double(9999),
253  skipObjectsNotPassingQualityBits = cms.bool(True),
254  qualityBits = cms.VPSet(
255  mksel(["hltL1sTripleJetVBFIorHTTIorDoubleJetCIorSingleJet"]),
256  mksel(["hltL1sQuadJetC50IorQuadJetC60IorHTT280IorHTT300IorHTT320IorTripleJet846848VBFIorTripleJet887256VBFIorTripleJet927664VBF","hltL1sQuadJetCIorTripleJetVBFIorHTT"]),
257  mksel(["hltL1sQuadJetC60IorHTT380IorHTT280QuadJetIorHTT300QuadJet","hltL1sQuadJetC50to60IorHTT280to500IorHTT250to340QuadJet"]),
258  mksel(["hltCaloQuadJet30HT300","hltCaloQuadJet30HT320"]),
259  mksel(["hltPFCentralJetsLooseIDQuad30HT300","hltPFCentralJetsLooseIDQuad30HT330"]),
260  mksel(["hltPFHT280Jet30"])
261  ),
262  ),
263  MHT = cms.PSet(
264  id = cms.int32(4),
265  sel = cms.string("type(90)"),
266  l1seed = cms.string("type(-90) && coll('L1HTM')"), l1deltaR = cms.double(9999),
267  l1seed_2 = cms.string("type(-90) && coll('L1HTMHF')"), l1deltaR_2 = cms.double(9999),
268  l2seed = cms.string("type(90) && coll('hltHtMhtJet30')"), l2deltaR = cms.double(9999),
269  skipObjectsNotPassingQualityBits = cms.bool(True),
270  qualityBits = cms.VPSet(
271  mksel(["hltCaloQuadJet30HT300","hltCaloQuadJet30HT320"]),
272  mksel(["hltPFCentralJetsLooseIDQuad30HT300","hltPFCentralJetsLooseIDQuad30HT330"])
273  ),
274  ),
275  ),
276 )
277 
278 # ERA-dependent configuration
279 # Tune filter and collection names to 2016 HLT menus
280 # FIXME: check non-lepton objects and cross check leptons
281 run2_HLTconditions_2016.toModify(
282  triggerObjectTable.selections.Muon,
283  sel = "type(83) && pt > 5 && (coll('hlt*L3MuonCandidates') || coll('hlt*TkMuonCands') || coll('hlt*TrkMuonCands'))",
284  qualityBits = cms.VPSet(
285  mksel("filter('*RelTrkIso*Filtered0p4')","TrkIsoVVL"),
286  mksel("filter('hltL3cr*IsoFiltered0p09')","Iso"),
287  mksel("filter('*OverlapFilter*IsoMu*PFTau*')","OverlapFilter PFTau"),
288  mksel("filter('hltL3f*IsoFiltered0p09')","IsoTkMu"),
289  mksel(["hltL3fL1sMu*L3Filtered50*","hltL3fL1sMu*TkFiltered50*"],"1mu (Mu50)", bit=10)
290  )
291 ).toModify(
292  triggerObjectTable.selections.Tau,
293  sel = "type(84) && pt > 5 && coll('*Tau*') && ( filter('*LooseIso*') || filter('*MediumIso*') || filter('*MediumComb*Iso*') || filter('hltL2TauIsoFilter') || filter('*OverlapFilter*IsoMu*') || filter('*OverlapFilter*IsoEle*') || filter('*L1HLTMatched*') || filter('*Dz02*') )",
294  qualityBits = cms.VPSet(
295  mksel("(filter('*LooseIso*')-filter('*VLooseIso*'))","LooseIso"),
296  mksel("filter('*Medium*Iso*')","Medium(Comb)Iso"),
297  mksel("filter('*VLooseIso*')","VLooseIso"),
298  mksel("0","None"),
299  mksel("filter('hltL2TauIsoFilter')","L2p5 pixel iso"),
300  mksel("filter('*OverlapFilter*IsoMu*')","OverlapFilter IsoMu"),
301  mksel("filter('*OverlapFilter*IsoEle*')","OverlapFilter IsoEle"),
302  mksel("filter('*L1HLTMatched*')","L1-HLT matched"),
303  mksel("filter('*Dz02*')","Dz")
304  )
305 )
306 
307 _run2_2017_2018_tau_filters = [
308  mksel("filter('*LooseChargedIso*')","LooseChargedIso"),
309  mksel("filter('*MediumChargedIso*')","MediumChargedIso"),
310  mksel("filter('*TightChargedIso*')","TightChargedIso"),
311  mksel("filter('*DeepTau*')","DeepTau"),
312  mksel("filter('*TightOOSCPhotons*')","TightID OOSC photons"),
313  mksel("filter('*Hps*')","HPS"),
314  mksel("filter('hlt*DoublePFTau*TrackPt1*ChargedIsolation*Dz02*')","charged iso di-tau"),
315  mksel("filter('hlt*DoublePFTau*DeepTau*L1HLTMatched')","deeptau di-tau"),
316  mksel("filter('hlt*OverlapFilterIsoEle*WPTightGsf*PFTau*')","e-tau"),
317  mksel("filter('hlt*OverlapFilterIsoMu*PFTau*')","mu-tau"),
318  mksel("filter('hlt*SelectedPFTau*L1HLTMatched')","single-tau/tau+MET"),
319  mksel("filter('hlt*DoublePFTau*TrackPt1*ChargedIso*')","run 2 VBF+ditau"),
320  mksel("filter('hlt*DoublePFTau*Track*ChargedIso*AgainstMuon')","run 3 VBF+ditau"),
321  mksel("filter('hltHpsSinglePFTau*HLTMatched')","run 3 double PF jets + ditau"),
322  mksel("filter('hltHpsOverlapFilterDeepTauDoublePFTau*PFJet*')","di-tau + PFJet"),
323  mksel("filter('hlt*Double*ChargedIsoDisplPFTau*Dxy*')","Displaced Tau"),
324  mksel("filter('*Monitoring')","Monitoring"),
325  mksel("filter('*Reg')","regional paths"),
326  mksel("filter('*L1Seeded')","L1 seeded paths"),
327  mksel("filter('*1Prong')","1 prong tau paths")
328 ]
329 (run2_HLTconditions_2017 | run2_HLTconditions_2018).toModify(
330  triggerObjectTable.selections.Tau,
331  sel = "type(84) && pt > 5 && coll('*Tau*') && ( filter('*LooseChargedIso*') || filter('*MediumChargedIso*') || filter('*DeepTau*') || filter('*TightChargedIso*') || filter('*TightOOSCPhotons*') || filter('hltL2TauIsoFilter') || filter('*OverlapFilterIsoMu*') || filter('*OverlapFilterIsoEle*') || filter('*L1HLTMatched*') || filter('*Dz02*') || filter('*DoublePFTau*') || filter('*SinglePFTau*') || filter('hlt*SelectedPFTau') || filter('*DisplPFTau*') )",
332  qualityBits = cms.VPSet(_run2_2017_2018_tau_filters)
333 )
334 _run2_HLTconditions = run2_HLTconditions_2016 | run2_HLTconditions_2017 | run2_HLTconditions_2018
335 
336 _run2_2016_jet_filters = [
337  mksel(["*CrossCleaned*LooseChargedIsoPFTau*"], "VBF cross-cleaned from loose iso PFTau"), # 0
338  mksel(["hltBTagCaloCSVp087Triple"], "hltBTagCaloCSVp087Triple"), # 1
339  mksel(["hltDoubleCentralJet90"], "hltDoubleCentralJet90"), # 2
340  mksel(["hltDoublePFCentralJetLooseID90"], "hltDoublePFCentralJetLooseID90"), # 3
341  mksel(["hltL1sTripleJetVBFIorHTTIorDoubleJetCIorSingleJet"], "hltL1sTripleJetVBFIorHTTIorDoubleJetCIorSingleJet"), # 4
342  mksel(["hltQuadCentralJet30"], "hltQuadCentralJet30"), # 5
343  mksel(["hltQuadPFCentralJetLooseID30"], "hltQuadPFCentralJetLooseID30"), # 6
344  mksel(["hltL1sQuadJetC50IorQuadJetC60IorHTT280IorHTT300IorHTT320IorTripleJet846848VBFIorTripleJet887256VBFIorTripleJet927664VBF", "hltL1sQuadJetCIorTripleJetVBFIorHTT"], "hltL1sQuadJetC50IorQuadJetC60IorHTT280IorHTT300IorHTT320IorTripleJet846848VBFIorTripleJet887256VBFIorTripleJet927664VBF or hltL1sQuadJetCIorTripleJetVBFIorHTT"), # 7
345  mksel(["hltQuadCentralJet45"], "hltQuadCentralJet45"), # 8
346  mksel(["hltQuadPFCentralJetLooseID45"], "hltQuadPFCentralJetLooseID45"), # 9
347  mksel(["hltL1sQuadJetC60IorHTT380IorHTT280QuadJetIorHTT300QuadJet", "hltL1sQuadJetC50to60IorHTT280to500IorHTT250to340QuadJet"], "hltL1sQuadJetC60IorHTT380IorHTT280QuadJetIorHTT300QuadJet or hltL1sQuadJetC50to60IorHTT280to500IorHTT250to340QuadJet"), # 10
348  mksel(["hltBTagCaloCSVp05Double", "hltBTagCaloDeepCSVp17Double"], "hltBTagCaloCSVp05Double or hltBTagCaloDeepCSVp17Double"), # 11
349  mksel(["hltPFCentralJetLooseIDQuad30"], "hltPFCentralJetLooseIDQuad30"), # 12
350  mksel(["hlt1PFCentralJetLooseID75"], "hlt1PFCentralJetLooseID75"), # 13
351  mksel(["hlt2PFCentralJetLooseID60"], "hlt2PFCentralJetLooseID60"), # 14
352  mksel(["hlt3PFCentralJetLooseID45"], "hlt3PFCentralJetLooseID45"), # 15
353  mksel(["hlt4PFCentralJetLooseID40"], "hlt4PFCentralJetLooseID40"), # 16
354  mksel(["hltBTagPFCSVp070Triple", "hltBTagPFDeepCSVp24Triple", "hltBTagPFDeepCSV4p5Triple"], "hltBTagPFCSVp070Triple or hltBTagPFDeepCSVp24Triple or hltBTagPFDeepCSV4p5Triple"), # 17
355  mksel(["hltHpsOverlapFilterDeepTauDoublePFTau*PFJet*"], "Double tau + jet"), # 18
356  mksel(["*CrossCleaned*MediumDeepTauDitauWPPFTau*"], "VBF cross-cleaned from medium deeptau PFTau"), # 19
357  mksel(["*CrossCleanedUsingDiJetCorrChecker*"], "VBF cross-cleaned using dijet correlation checker"), # 20
358  mksel(["hltHpsOverlapFilterDeepTauPFTau*PFJet*"], "monitoring muon + tau + jet"), # 21
359 ]
360 run2_HLTconditions_2016.toModify(triggerObjectTable.selections.Jet, qualityBits = cms.VPSet(_run2_2016_jet_filters))
361 
362 _run2_2017_jet_filters = copy.deepcopy(_run2_2016_jet_filters)
363 _run2_2017_jet_filters[7] = mksel(["hltL1sTripleJet1008572VBFIorHTTIorDoubleJetCIorSingleJet","hltL1sTripleJet1058576VBFIorHTTIorDoubleJetCIorSingleJet","hltL1sTripleJetVBFIorHTTIorSingleJet"])
364 run2_HLTconditions_2017.toModify(triggerObjectTable.selections.Jet, qualityBits = cms.VPSet(_run2_2017_jet_filters))
365 
366 _run2_2018_jet_filters = copy.deepcopy(_run2_2017_jet_filters)
367 _run2_2018_jet_filters[2] = mksel(["hltPFJetFilterTwoC30"])
368 _run2_2018_jet_filters.append(mksel(["hltBTagPFDeepCSV1p5Single"])) # 22
369 run2_HLTconditions_2018.toModify(triggerObjectTable.selections.Jet, qualityBits = cms.VPSet(_run2_2018_jet_filters))
370 
371 
372 from PhysicsTools.PatUtils.L1PrefiringWeightProducer_cff import prefiringweight
373 #Next lines are for UL2016 maps
374 (run2_muon_2016 & tracker_apv_vfp30_2016).toModify(
375  prefiringweight,
376  DataEraECAL = cms.string("UL2016preVFP"),
377  DataEraMuon = cms.string("2016preVFP")
378 )
379 (run2_muon_2016 & ~tracker_apv_vfp30_2016).toModify(
380  prefiringweight,
381  DataEraECAL = cms.string("UL2016postVFP"),
382  DataEraMuon = cms.string("2016postVFP")
383 )
384 #Next line is for UL2017 maps
385 run2_jme_2017.toModify(
386  prefiringweight,
387  DataEraECAL = cms.string("UL2017BtoF"),
388  DataEraMuon = cms.string("20172018")
389 )
390 #Next line is for UL2018 maps
391 run2_muon_2018.toModify(
392  prefiringweight,
393  DataEraECAL = cms.string("None"),
394  DataEraMuon = cms.string("20172018")
395 )
396 
397 l1PreFiringEventWeightTable = globalVariablesTableProducer.clone(
398  name = cms.string("L1PreFiringWeight"),
399  variables = cms.PSet(
400  Nom = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProb"), "float", doc = "L1 pre-firing event correction weight (1-probability)", precision=8),
401  Up = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbUp"), "float", doc = "L1 pre-firing event correction weight (1-probability), up var.", precision=8),
402  Dn = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbDown"), "float", doc = "L1 pre-firing event correction weight (1-probability), down var.", precision=8),
403  Muon_Nom = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbMuon"), "float", doc = "Muon L1 pre-firing event correction weight (1-probability)", precision=8),
404  Muon_SystUp = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbMuonSystUp"), "float", doc = "Muon L1 pre-firing event correction weight (1-probability), up var. syst.", precision=8),
405  Muon_SystDn = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbMuonSystDown"), "float", doc = "Muon L1 pre-firing event correction weight (1-probability), down var. syst.", precision=8),
406  Muon_StatUp = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbMuonStatUp"), "float", doc = "Muon L1 pre-firing event correction weight (1-probability), up var. stat.", precision=8),
407  Muon_StatDn = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbMuonStatDown"), "float", doc = "Muon L1 pre-firing event correction weight (1-probability), down var. stat.", precision=8),
408  ECAL_Nom = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbECAL"), "float", doc = "ECAL L1 pre-firing event correction weight (1-probability)", precision=8),
409  ECAL_Up = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbECALUp"), "float", doc = "ECAL L1 pre-firing event correction weight (1-probability), up var.", precision=8),
410  ECAL_Dn = ExtVar(cms.InputTag("prefiringweight:nonPrefiringProbECALDown"), "float", doc = "ECAL L1 pre-firing event correction weight (1-probability), down var.", precision=8),
411  )
412 )
413 
414 l1bits=cms.EDProducer("L1TriggerResultsConverter",
415  src=cms.InputTag("gtStage2Digis"),
416  legacyL1=cms.bool(False),
417  storeUnprefireableBits=cms.bool(True),
418  src_ext=cms.InputTag("simGtExtUnprefireable"))
419 
420 triggerObjectTablesTask = cms.Task( unpackedPatTrigger,triggerObjectTable,l1bits)
421 
422 _run2_HLTconditions.toReplaceWith(
423  triggerObjectTablesTask, triggerObjectTablesTask.copyAndAdd(prefiringweight,l1PreFiringEventWeightTable)
424 )
def ExtVar(tag, valtype, doc=None, precision=-1)
Definition: common_cff.py:27
def chaintoken_(tokens, f, OR_or_AND=None)
def mksel(selection, doc=None, bit=None)
static std::string join(char **cmd)
Definition: RemoteFile.cc:19