20
20
from hbw .selection .trigger import hbw_trigger_selection
21
21
from hbw .production .weights import event_weights_to_normalize
22
22
23
- from hbw .util import ak_any
24
-
25
23
np = maybe_import ("numpy" )
26
24
ak = maybe_import ("awkward" )
27
25
@@ -153,32 +151,6 @@ def dl_lepton_selection(
153
151
(ak .sum (electron .is_tight , axis = 1 ) + ak .sum (muon .is_tight , axis = 1 ) == 2 )
154
152
)
155
153
156
- # TODO: do some rough cross checks, then remove this code
157
- for channel , trigger_columns in self .config_inst .x .trigger .items ():
158
- # apply the "or" of all triggers of this channel
159
- if trigger_columns :
160
- trigger_mask = ak_any ([events .HLT [trigger_column ] for trigger_column in trigger_columns ], axis = 0 )
161
- else :
162
- # if no trigger is defined, we assume that the event passes the trigger
163
- trigger_mask = np .ones (len (events ), dtype = np .bool_ )
164
- lepton_results .steps [f"OldTrigger_{ channel } " ] = trigger_mask
165
-
166
- # ensure that Lepton channel is in agreement with trigger
167
- lepton_results .steps [f"OldTriggerAndLep_{ channel } " ] = (
168
- lepton_results .steps [f"OldTrigger_{ channel } " ] & lepton_results .steps [f"Lep_{ channel } " ]
169
- )
170
-
171
- # combine results of each individual channel
172
- lepton_results .steps ["OldTrigger" ] = ak_any ([
173
- lepton_results .steps [f"OldTrigger_{ channel } " ]
174
- for channel in self .config_inst .x .trigger .keys ()
175
- ], axis = 0 )
176
-
177
- lepton_results .steps ["OldTriggerAndLep" ] = ak_any ([
178
- lepton_results .steps [f"OldTriggerAndLep_{ channel } " ]
179
- for channel in self .config_inst .x .trigger .keys ()
180
- ], axis = 0 )
181
-
182
154
return events , lepton_results
183
155
184
156
@@ -212,64 +184,6 @@ def dl_lepton_selection_init(self: Selector) -> None:
212
184
if self .task and self .task .task_family == "cf.SelectEvents" :
213
185
self .produces .add ("mll" )
214
186
215
- # TODO: remove all this config stuff
216
- year = self .config_inst .campaign .x .year
217
-
218
- if year == 2017 :
219
- self .config_inst .x .trigger = self .config_inst .x ("trigger" , {
220
- "mm" : [
221
- "IsoMu27" ,
222
- "Mu17_TrkIsoVVL_Mu8_TrkIsoVVL" ,
223
- "Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ" ,
224
- "Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_Mass3p8" ,
225
- "Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_Mass8" ,
226
- ],
227
- "ee" : [
228
- "Ele35_WPTight_Gsf" ,
229
- "Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ" ,
230
- ],
231
- "emu" : [
232
- "IsoMu27" ,
233
- "Ele35_WPTight_Gsf" ,
234
- "Mu8_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL" ,
235
- "Mu8_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL_DZ" ,
236
- ],
237
- "mue" : [
238
- "IsoMu27" ,
239
- "Ele35_WPTight_Gsf" ,
240
- "Mu23_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL" ,
241
- "Mu23_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL" ,
242
- ],
243
- })
244
- elif year == 2022 :
245
- self .config_inst .x .trigger = self .config_inst .x ("trigger" , {
246
- "mm" : [
247
- "IsoMu24" ,
248
- "Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_Mass3p8" ,
249
- ],
250
- "ee" : [
251
- "Ele30_WPTight_Gsf" ,
252
- "Ele23_Ele12_CaloIdL_TrackIdL_IsoVL" ,
253
- ],
254
- "emu" : [
255
- "IsoMu24" ,
256
- "Ele30_WPTight_Gsf" ,
257
- "Mu8_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL" , # TODO: recommentations (unprescaled?)
258
- ],
259
- "mue" : [
260
- "IsoMu24" ,
261
- "Ele30_WPTight_Gsf" ,
262
- "Mu23_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL" , # TODO: recommentations (unprescaled?)
263
- ],
264
- })
265
- else :
266
- raise Exception (f"Dilepton trigger not implemented for year { year } " )
267
-
268
- # add all required trigger to the uses
269
- for trigger_columns in self .config_inst .x .trigger .values ():
270
- for column in trigger_columns :
271
- self .uses .add (f"HLT.{ column } " )
272
-
273
187
return
274
188
275
189
@@ -289,7 +203,7 @@ def dl_lepton_selection_init(self: Selector) -> None:
289
203
b_tagger = None ,
290
204
btag_wp = None ,
291
205
n_btag = None ,
292
- version = 2 ,
206
+ version = 3 ,
293
207
)
294
208
def dl1 (
295
209
self : Selector ,
0 commit comments