Skip to content

Commit

Permalink
remove outdated trigger selection code
Browse files Browse the repository at this point in the history
  • Loading branch information
mafrahm committed Nov 11, 2024
1 parent 83a0a56 commit 1199614
Showing 1 changed file with 0 additions and 84 deletions.
84 changes: 0 additions & 84 deletions hbw/selection/dl_remastered.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,32 +153,6 @@ def dl_lepton_selection(
(ak.sum(electron.is_tight, axis=1) + ak.sum(muon.is_tight, axis=1) == 2)
)

# TODO: do some rough cross checks, then remove this code
for channel, trigger_columns in self.config_inst.x.trigger.items():
# apply the "or" of all triggers of this channel
if trigger_columns:
trigger_mask = ak_any([events.HLT[trigger_column] for trigger_column in trigger_columns], axis=0)
else:
# if no trigger is defined, we assume that the event passes the trigger
trigger_mask = np.ones(len(events), dtype=np.bool_)
lepton_results.steps[f"OldTrigger_{channel}"] = trigger_mask

# ensure that Lepton channel is in agreement with trigger
lepton_results.steps[f"OldTriggerAndLep_{channel}"] = (
lepton_results.steps[f"OldTrigger_{channel}"] & lepton_results.steps[f"Lep_{channel}"]
)

# combine results of each individual channel
lepton_results.steps["OldTrigger"] = ak_any([
lepton_results.steps[f"OldTrigger_{channel}"]
for channel in self.config_inst.x.trigger.keys()
], axis=0)

lepton_results.steps["OldTriggerAndLep"] = ak_any([
lepton_results.steps[f"OldTriggerAndLep_{channel}"]
for channel in self.config_inst.x.trigger.keys()
], axis=0)

return events, lepton_results


Expand Down Expand Up @@ -212,64 +186,6 @@ def dl_lepton_selection_init(self: Selector) -> None:
if self.task and self.task.task_family == "cf.SelectEvents":
self.produces.add("mll")

# TODO: remove all this config stuff
year = self.config_inst.campaign.x.year

if year == 2017:
self.config_inst.x.trigger = self.config_inst.x("trigger", {
"mm": [
"IsoMu27",
"Mu17_TrkIsoVVL_Mu8_TrkIsoVVL",
"Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ",
"Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_Mass3p8",
"Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_Mass8",
],
"ee": [
"Ele35_WPTight_Gsf",
"Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ",
],
"emu": [
"IsoMu27",
"Ele35_WPTight_Gsf",
"Mu8_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL",
"Mu8_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL_DZ",
],
"mue": [
"IsoMu27",
"Ele35_WPTight_Gsf",
"Mu23_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL",
"Mu23_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL",
],
})
elif year == 2022:
self.config_inst.x.trigger = self.config_inst.x("trigger", {
"mm": [
"IsoMu24",
"Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_Mass3p8",
],
"ee": [
"Ele30_WPTight_Gsf",
"Ele23_Ele12_CaloIdL_TrackIdL_IsoVL",
],
"emu": [
"IsoMu24",
"Ele30_WPTight_Gsf",
"Mu8_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL", # TODO: recommentations (unprescaled?)
],
"mue": [
"IsoMu24",
"Ele30_WPTight_Gsf",
"Mu23_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL", # TODO: recommentations (unprescaled?)
],
})
else:
raise Exception(f"Dilepton trigger not implemented for year {year}")

# add all required trigger to the uses
for trigger_columns in self.config_inst.x.trigger.values():
for column in trigger_columns:
self.uses.add(f"HLT.{column}")

return


Expand Down

0 comments on commit 1199614

Please sign in to comment.