Skip to content

Commit

Permalink
add HT to list of variables
Browse files Browse the repository at this point in the history
  • Loading branch information
philippgadow committed Jan 24, 2025
1 parent 792a2d5 commit d2e4160
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hbt/config/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,17 @@ def add_variables(config: od.Config) -> None:
x_title="Number of HH b-tags",
discrete_x=True,
)
def build_ht(events):
objects = ak.concatenate([events.Electron * 1, events.Muon * 1, events.Tau * 1, events.Jet * 1], axis=1)[:, :]
objects_sum = objects.sum(axis=1)
return objects_sum.pt
build_ht.inputs = ["{Electron,Muon,Tau,Jet}.{pt,eta,phi,mass}"]

add_variable(
config,
name="ht",
expression=partial(build_ht),
aux={"inputs": build_ht.inputs},
binning=[0, 80, 120, 160, 200, 240, 280, 320, 400, 500, 600, 800],
unit="GeV",
x_title="HT",
Expand Down

0 comments on commit d2e4160

Please sign in to comment.