Skip to content

Commit

Permalink
Merge pull request #1271 from yimuchen/ymc/treemaker_nested
Browse files Browse the repository at this point in the history
feat: allow TreeMakerSchema to handled more than doubly nested collections
  • Loading branch information
lgray authored Feb 16, 2025
2 parents aa1a35e + e0c9a33 commit b069891
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/coffea/nanoevents/schemas/treemaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,16 @@ def _build_collections(self, branch_forms):

# Generating collection from branch name
collections = [k for k in branch_forms if "_" in k and not k.startswith("n")]
collections = {
"_".join(k.split("_")[:-1])
for k in collections
if k.split("_")[-1] != "AK8"
# Excluding per-event variables with AK8 variants like Mjj and MT
}
collections = sorted(
{
"_".join(k.split("_")[:-1])
for k in collections
if k.split("_")[-1] != "AK8"
# Excluding per-event variables with AK8 variants like Mjj and MT
},
key=lambda colname: colname.count("_"),
reverse=True,
)

subcollections = []

Expand Down

0 comments on commit b069891

Please sign in to comment.