Skip to content

Commit

Permalink
Merge pull request #150 from ikrommyd/use-ak-any-in-trigger-match
Browse files Browse the repository at this point in the history
chore: use `ak.any` in `trigger_match`
  • Loading branch information
ikrommyd authored Feb 5, 2025
2 parents 47860bb + 9637269 commit 9ad39a3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/egamma_tnp/nanoaod_efficiency.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,7 @@ def _trigger_match(leptons, trigobjs, pdgid, pt, filterbit):
trigger_cands = trigobjs[pass_pt & pass_id & pass_filterbit]
delta_r = leptons.metric_table(trigger_cands, metric=custom_delta_r)
pass_delta_r = delta_r < 0.1
n_of_trigger_matches = dak.sum(pass_delta_r, axis=2)
trig_matched_locs = n_of_trigger_matches >= 1
trig_matched_locs = dak.any(pass_delta_r, axis=2)

return trig_matched_locs

Expand Down Expand Up @@ -641,8 +640,7 @@ def _trigger_match(leptons, trigobjs, pdgid, pt, filterbit):
trigger_cands = trigobjs[pass_pt & pass_id & pass_filterbit]
delta_r = leptons.metric_table(trigger_cands, metric=custom_delta_r)
pass_delta_r = delta_r < 0.1
n_of_trigger_matches = dak.sum(pass_delta_r, axis=2)
trig_matched_locs = n_of_trigger_matches >= 1
trig_matched_locs = dak.any(pass_delta_r, axis=2)

return trig_matched_locs

Expand Down

0 comments on commit 9ad39a3

Please sign in to comment.