Skip to content

Commit

Permalink
Fix Sums in rate table
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhundhausen committed Mar 27, 2024
1 parent 8ca75f4 commit f013ba3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
30 changes: 15 additions & 15 deletions configs/V29/rate_table/v29_WITHMUONS_Final_clean_cfg.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# L1_PFHTT:
# cross_masks: []
# leg1:
# threshold_cut: offline_pt >= 450.0
# obj: seededConePuppiHT:default
# L1_PFMHTT:
# cross_masks: []
# leg1:
# threshold_cut: offline_pt >= 135.5
# obj: seededConePuppiMHT:default
# L1_PFMet:
# cross_masks: []
# leg1:
# threshold_cut: offline_pt >= 200.0
# obj: puppiMET:default
L1_PFHTT:
cross_masks: []
leg1:
threshold_cut: offline_pt >= 450.0
obj: seededConePuppiHT:default
L1_PFMHTT:
cross_masks: []
leg1:
threshold_cut: offline_pt >= 135.5
obj: seededConePuppiMHT:default
L1_PFMet:
cross_masks: []
leg1:
threshold_cut: offline_pt >= 200.0
obj: puppiMET:default
L1_DoubleTkMu4p5er2p0_SQ_OS_Mass7to18:
cross_masks:
- (((leg1+leg2).mass > 7.0) & (leg1.deltaR(leg2) > 0))
Expand Down
10 changes: 8 additions & 2 deletions menu_tools/rate_table/menu_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ def _load_cached_arrays(self, object_name: str) -> ak.Array:
# TODO: What is this? Is it needed?
# if "jagged0" in arr.fields:
# arr = arr["jagged0"]

# When loading sums (MET, HT, etc.) transfrom the array structure to
# mimic that of "normal" objects which have lists at the event level
# instead of a single number.
if isinstance(arr[0], ak.highlevel.Record):
arr = ak.zip({field: [[k] for k in arr[field]] for field in arr.fields})

arr = ak.with_name(arr, "Momentum4D")
return arr

Expand Down Expand Up @@ -294,8 +301,7 @@ def _prepare_masks(self) -> dict[str, np.ndarray]:

def print_table(self) -> None:
"""
TODO: This function should take all the printing stuff out of
`make_table`
Prints the rate table to stdout.
"""
print("===============")
print("=====TABLE=====")
Expand Down

0 comments on commit f013ba3

Please sign in to comment.