|
13 | 13 | from columnflow.selection import SelectionResult
|
14 | 14 | from columnflow.columnar_util import has_ak_column, optional_column
|
15 | 15 |
|
16 |
| -from hbw.util import MET_COLUMN |
| 16 | +from hbw.util import MET_COLUMN, BTAG_COLUMN |
17 | 17 |
|
18 | 18 | np = maybe_import("numpy")
|
19 | 19 | ak = maybe_import("awkward")
|
@@ -125,6 +125,23 @@ def catid_lep(
|
125 | 125 | catid_emu = catid_lep.derive("catid_emu", cls_dict={"n_electron": 1, "n_muon": 1})
|
126 | 126 |
|
127 | 127 |
|
| 128 | +@categorizer( |
| 129 | + uses={"{Muon,Electron}.pt"}, |
| 130 | +) |
| 131 | +def catid_ge3lep( |
| 132 | + self: Categorizer, events: ak.Array, results: SelectionResult | None = None, **kwargs, |
| 133 | +) -> tuple[ak.Array, ak.Array]: |
| 134 | + if results: |
| 135 | + electron = events.Electron[results.objects.Electron.Electron] |
| 136 | + muon = events.Muon[results.objects.Muon.Muon] |
| 137 | + else: |
| 138 | + electron = events.Electron |
| 139 | + muon = events.Muon |
| 140 | + |
| 141 | + mask = ak.sum(electron.pt > 0, axis=-1) + ak.sum(muon.pt > 0, axis=-1) >= 3 |
| 142 | + return events, mask |
| 143 | + |
| 144 | + |
128 | 145 | #
|
129 | 146 | # Categorizer for ABCD (either during cf.SelectEvents or cf.ProduceColumns)
|
130 | 147 | #
|
@@ -246,9 +263,6 @@ def catid_njet3(
|
246 | 263 | return events, mask
|
247 | 264 |
|
248 | 265 |
|
249 |
| -from hbw.util import BTAG_COLUMN |
250 |
| - |
251 |
| - |
252 | 266 | @categorizer(uses={BTAG_COLUMN("Jet")})
|
253 | 267 | def catid_1b(self: Categorizer, events: ak.Array, **kwargs) -> tuple[ak.Array, ak.Array]:
|
254 | 268 | btag_column = self.config_inst.x.btag_column
|
|
0 commit comments