Skip to content

Commit

Permalink
Add n_bjets and n_taus columns to preprocessing output
Browse files Browse the repository at this point in the history
  • Loading branch information
haddadanas committed Jan 23, 2025
1 parent ea8ec0e commit d649bba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion hbt/production/preprocessing/preprocess_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def pp_jets(self: Producer, events: ak.Array, **kwargs) -> ak.Array:
pp_jets, pp_leptons, pp_channel_id, hh_mass, normalization_weights, process_ids
},
produces={
pp_jets, pp_leptons, pp_channel_id, hh_mass, normalization_weights, process_ids
pp_jets, pp_leptons, pp_channel_id, hh_mass, normalization_weights, process_ids, "n_bjets", "n_taus"
},
)
def preprocess(self: Producer, events: ak.Array, **kwargs) -> ak.Array:
Expand All @@ -151,4 +151,10 @@ def preprocess(self: Producer, events: ak.Array, **kwargs) -> ak.Array:

events = self[pp_channel_id](events)

n_bjets = ak.num(events.HHBJet, axis=1)
n_taus = ak.num(events.Tau, axis=1)

events = set_ak_column_f32(events, "n_bjets", n_bjets)
events = set_ak_column_f32(events, "n_taus", n_taus)

return events

0 comments on commit d649bba

Please sign in to comment.