Skip to content

Commit

Permalink
update analysis and cf
Browse files Browse the repository at this point in the history
  • Loading branch information
BalduinLetzer committed Jul 29, 2024
1 parent 9d98b8f commit 7c92741
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
6 changes: 6 additions & 0 deletions hbw/config/categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ def add_trigger_categories(config: od.Config) -> None:
selection="catid_trigger_orth_ele",
label="Electron\northogonal\nmeasurement",
)
cat_trig_ele_orth_nomatch = config.add_category( # noqa
name="trig_ele_orth_nomatch",
id=5000,
selection="catid_trigger_orth_e_no_match",
label="Electron\northogonal\nmeasurement\nno match",
)

@call_once_on_config()
def add_categories_selection(config: od.Config) -> None:
Expand Down
2 changes: 1 addition & 1 deletion hbw/plotting/plot_efficiencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def plot_efficiencies(
default_style_config = prepare_style_config(
config_inst, category_inst, variable_inst, density, shape_norm, yscale,
)
from hbw.util import debugger; debugger()

# loop over processes
for proc_inst, myhist in hists.items():

Expand Down
3 changes: 3 additions & 0 deletions hbw/production/weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
# helper
set_ak_column_f32 = functools.partial(set_ak_column, value_type=np.float32)

stitched_normalization_weights.weight_name = "stitched_normalization_weight"
stitched_normalization_weights_brs_from_processes.weight_name = "stitched_normalization_weight_brs_from_processes"


@producer(
uses={gen_parton_top, gen_v_boson, pu_weight},
Expand Down
13 changes: 13 additions & 0 deletions hbw/selection/categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,16 @@ def catid_trigger_orth_ele(
return events, ( results.steps.TrigMuMatch & results.steps.SR_ele & results.steps.ref_trigger_e)
else:
raise NotImplementedError(f"Category didn't receive a SelectionResult")

# test categorizer without matching of trigger and offline object
@categorizer()
def catid_trigger_orth_e_no_match(
self: Categorizer,
events: ak.Array,
results: SelectionResult | None = None,
**kwargs,
) -> tuple[ak.Array, ak.Array]:
if results:
return events, ( results.steps.SR_ele & results.steps.ref_trigger_e)
else:
raise NotImplementedError(f"Category didn't receive a SelectionResult")

0 comments on commit 7c92741

Please sign in to comment.