Skip to content

Commit

Permalink
prevent throwout of trigger coulmns for empty selector
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan-Wiederspan committed Dec 19, 2024
1 parent a20ac2c commit e6c5572
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hbt/selection/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def empty_init(self: Selector) -> None:

# add custom columns
self.uses.add("Jet.phi") # needed by vector behavior for accessing pt in btag_weights
self.produces |= {"channel_id", "leptons_os", "tau2_isolated"}
self.produces |= {"channel_id", "leptons_os", "tau2_isolated", "{single,cross}_triggered"}


@empty.call
Expand Down Expand Up @@ -273,6 +273,8 @@ def empty_call(
events = set_ak_column(events, "channel_id", np.zeros(len(events), dtype=np.uint8))
events = set_ak_column(events, "leptons_os", np.zeros(len(events), dtype=bool))
events = set_ak_column(events, "tau2_isolated", np.zeros(len(events), dtype=bool))
events = set_ak_column(events, "cross_triggered", np.zeros(len(events), dtype=bool))
events = set_ak_column(events, "single_triggered", np.zeros(len(events), dtype=bool))

# trivial selection mask capturing all events
results.event = np.ones(len(events), dtype=bool)
Expand Down

0 comments on commit e6c5572

Please sign in to comment.