Skip to content

Commit a14c658

Browse files
committed
remove outdated trigger selection code
1 parent 83a0a56 commit a14c658

File tree

1 file changed

+1
-87
lines changed

1 file changed

+1
-87
lines changed

hbw/selection/dl_remastered.py

Lines changed: 1 addition & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
from hbw.selection.trigger import hbw_trigger_selection
2121
from hbw.production.weights import event_weights_to_normalize
2222

23-
from hbw.util import ak_any
24-
2523
np = maybe_import("numpy")
2624
ak = maybe_import("awkward")
2725

@@ -153,32 +151,6 @@ def dl_lepton_selection(
153151
(ak.sum(electron.is_tight, axis=1) + ak.sum(muon.is_tight, axis=1) == 2)
154152
)
155153

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-
182154
return events, lepton_results
183155

184156

@@ -212,64 +184,6 @@ def dl_lepton_selection_init(self: Selector) -> None:
212184
if self.task and self.task.task_family == "cf.SelectEvents":
213185
self.produces.add("mll")
214186

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-
273187
return
274188

275189

@@ -289,7 +203,7 @@ def dl_lepton_selection_init(self: Selector) -> None:
289203
b_tagger=None,
290204
btag_wp=None,
291205
n_btag=None,
292-
version=2,
206+
version=3,
293207
)
294208
def dl1(
295209
self: Selector,

0 commit comments

Comments
 (0)