Skip to content

Commit

Permalink
implement trigger matching and double counting removal in DL selector
Browse files Browse the repository at this point in the history
  • Loading branch information
mafrahm committed Sep 11, 2024
1 parent 2823c66 commit 3088043
Show file tree
Hide file tree
Showing 8 changed files with 850 additions and 48 deletions.
6 changes: 5 additions & 1 deletion hbw/columnflow_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,12 @@ def patch_csp_versioning():
"""
Patches the TaskArrayFunction to add the version to the string representation of the task.
"""

def TaskArrayFunction_str(self):
version_str = f"V{self.version}" if hasattr(self, "version") else ""
version = self.version() if callable(getattr(self, "version", None)) else getattr(self, "version", None)
if version and not isinstance(version, int):
raise Exception(f"version must be an integer, but is {version}")
version_str = f"V{version}" if version is not None else ""
return f"{self.cls_name}{version_str}"

TaskArrayFunction.__str__ = TaskArrayFunction_str
Expand Down
8 changes: 5 additions & 3 deletions hbw/config/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@


def hbw_dataset_names(config: od.Config, as_list: bool = False) -> DotDict[str: list[str]] | list[str]:
# define data streams based on the run
# NOTE: the order of the streams is important for data trigger filtering (removing double counting)
if config.campaign.x.run == 2:
data_streams = ["mu", "e"]
config.x.data_streams = ["mu", "e"]
elif config.campaign.x.run == 3:
data_streams = ["mu", "egamma", "muoneg"]
config.x.data_streams = ["mu", "egamma", "muoneg"]

data_eras = {
"2017": "cdef",
Expand All @@ -38,7 +40,7 @@ def hbw_dataset_names(config: od.Config, as_list: bool = False) -> DotDict[str:
f"data_{stream}_{era}"
for era in data_eras
]
for stream in data_streams
for stream in config.x.data_streams
}

dataset_names = DotDict.wrap({
Expand Down
Loading

0 comments on commit 3088043

Please sign in to comment.