Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AnalysisQC] Make common args better adjustable #1514

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion MC/analysis_testing/o2dpg_analysis_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def full_ana_name(raw_ana_name):
return f"{ANALYSIS_LABEL}_{raw_ana_name}"


def get_common_args_as_string(analysis_name, all_common_args):
def get_common_args_as_string(ana, all_common_args):
"""
all_common_args is of the form
[<ana_name1>-shm-segment-size <value>, <ana_name2>-readers <value>, ...]
Expand All @@ -88,6 +88,11 @@ def make_args_string(args_map_in):
"readers": 1,
"aod-memory-rate-limit": 500000000}

# get common args from analysis configuration and add to args_map
common_args_from_config = ana.get("common_args", {})
for key, value in common_args_from_config.items():
args_map[key] = value

# arguments dedicated for this analysis
args_map_overwrite = {}

Expand All @@ -98,6 +103,8 @@ def make_args_string(args_map_in):
print("ERROR: Cannot digest common args.")
return None

analysis_name = ana["name"]

for i in range(0, len(all_common_args), 2):
tokens = all_common_args[i].split("-")
key = "-".join(tokens[1:])
Expand Down
2 changes: 1 addition & 1 deletion MC/analysis_testing/o2dpg_analysis_test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def add_analysis_tasks(workflow, input_aod="./AO2D.root", output_dir="./Analysis
continue
print(f"INFO: Analysis {ana['name']} uses configuration {configuration}")

add_common_args_ana = get_common_args_as_string(ana["name"], add_common_args)
add_common_args_ana = get_common_args_as_string(ana, add_common_args)
if not add_common_args_ana:
print(f"ERROR: Cannot parse common args for analysis {ana['name']}")
continue
Expand Down
3 changes: 3 additions & 0 deletions MC/config/analysis_testing/json/analyses_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@
"expected_output": ["AnalysisResults.root"],
"valid_mc": true,
"valid_data": true,
"common_args": {
"shm-segment-size": 2500000000
},
"tasks": ["o2-analysis-je-emc-eventselection-qa",
"o2-analysis-je-emc-cellmonitor",
"o2-analysis-je-emcal-correction-task",
Expand Down