-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c92741
commit 605903c
Showing
10 changed files
with
210 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# coding: utf-8 | ||
""" | ||
defines categories based on the selection used for the trigger studies | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
import law | ||
|
||
from columnflow.util import maybe_import | ||
from columnflow.categorization import Categorizer, categorizer | ||
from columnflow.selection import SelectionResult | ||
|
||
np = maybe_import("numpy") | ||
ak = maybe_import("awkward") | ||
|
||
# categorizer muon channel | ||
@categorizer() | ||
def catid_trigger_mu( | ||
self: Categorizer, | ||
events: ak.Array, | ||
results: SelectionResult | None = None, | ||
**kwargs, | ||
) -> tuple[ak.Array, ak.Array]: | ||
if results: | ||
return events, results.steps.SR_mu | ||
else: | ||
raise NotImplementedError(f"Category didn't receive a SelectionResult") | ||
|
||
# categorizer electron channel | ||
@categorizer() | ||
def catid_trigger_ele( | ||
self: Categorizer, | ||
events: ak.Array, | ||
results: SelectionResult | None = None, | ||
**kwargs, | ||
) -> tuple[ak.Array, ak.Array]: | ||
if results: | ||
return events, results.steps.SR_ele | ||
else: | ||
raise NotImplementedError(f"Category didn't receive a SelectionResult") | ||
|
||
# categorizer for orthogonal measurement (muon channel) | ||
@categorizer() | ||
def catid_trigger_orth_mu( | ||
self: Categorizer, | ||
events: ak.Array, | ||
results: SelectionResult | None = None, | ||
**kwargs, | ||
) -> tuple[ak.Array, ak.Array]: | ||
if results: | ||
return events, ( results.steps.TrigEleMatch & results.steps.SR_mu & results.steps.ref_trigger_mu) | ||
else: | ||
raise NotImplementedError(f"Category didn't receive a SelectionResult") | ||
|
||
# categorizer for orthogonal measurement (electron channel) | ||
@categorizer() | ||
def catid_trigger_orth_ele( | ||
self: Categorizer, | ||
events: ak.Array, | ||
results: SelectionResult | None = None, | ||
**kwargs, | ||
) -> tuple[ak.Array, ak.Array]: | ||
if results: | ||
return events, ( results.steps.TrigMuMatch & results.steps.SR_ele & results.steps.ref_trigger_e) | ||
else: | ||
raise NotImplementedError(f"Category didn't receive a SelectionResult") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.