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