From b5df324c49657577423fa21a24df428d7b034d09 Mon Sep 17 00:00:00 2001 From: Anas <103462379+haddadanas@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:35:14 +0200 Subject: [PATCH] Small improvements in the jet selection Remove double slicing + added one comment --- hbt/selection/jet.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hbt/selection/jet.py b/hbt/selection/jet.py index 8fa9ed4d..0317723a 100644 --- a/hbt/selection/jet.py +++ b/hbt/selection/jet.py @@ -82,7 +82,7 @@ def jet_selection( hhbtag_scores = self[hhbtag](events, default_mask, lepton_results.x.lepton_pair, **kwargs) score_indices = ak.argsort(hhbtag_scores, axis=1, ascending=False) # pad the indices to simplify creating the hhbjet mask - padded_hhbjet_indices = ak.pad_none(score_indices, 2, axis=1)[..., :2][..., :2] + padded_hhbjet_indices = ak.pad_none(score_indices, 2, axis=1)[..., :2] hhbjet_mask = ((li == padded_hhbjet_indices[..., [0]]) | (li == padded_hhbjet_indices[..., [1]])) # get indices for actual book keeping only for events with both lepton candidates and where at # least two jets pass the default mask (bjet candidates) @@ -116,6 +116,7 @@ def jet_selection( cross_vbf_mask = ak.full_like(1 * events.event, False, dtype=bool) else: cross_vbf_masks = [events.trigger_ids == tid for tid in cross_vbf_ids] + # This combines "at least one cross trigger is fired" and "no other triggers are fired" cross_vbf_mask = ak.all(reduce(or_, cross_vbf_masks), axis=1) vbf_pair_mask = vbf_pair_mask & ( (~cross_vbf_mask) | (