Skip to content

Commit 9b5a5ee

Browse files
committed
upgrades to hltPhase2UpgradeIntegrationTests
- use --prune for edmConfigDump - accept also DST_* and MC_* paths
1 parent 05ed86d commit 9b5a5ee

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

HLTrigger/Configuration/scripts/hltPhase2UpgradeIntegrationTests

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ subprocess.run(base_cmsdriver_command, shell=True, cwd=output_dir)
158158
# Step 2: Use edmConfigDump to dump the full configuration
159159
print(f"Dumping the full configuration using edmConfigDump to {dumped_config_file}")
160160
with open(dumped_config_file, "w") as dump_file, open(log_file, "w") as log:
161-
subprocess.run(f"edmConfigDump {base_config_file}", shell=True, stdout=dump_file, stderr=log)
161+
subprocess.run(f"edmConfigDump --prune {base_config_file}", shell=True, stdout=dump_file, stderr=log)
162162

163163
# Step 3: Extract the list of HLT paths from the dumped configuration
164164
print(f"Extracting HLT paths from {dumped_config_file}...")
@@ -168,7 +168,7 @@ with open(dumped_config_file, "r") as f:
168168
config_content = f.read()
169169

170170
# Use regex to find all HLT and L1T paths defined in process.schedule
171-
unsorted_hlt_paths = re.findall(r"process\.(HLT_[A-Za-z0-9_]+|L1T_[A-Za-z0-9_]+|DST_[A-Za-z0-9_]+)", config_content)
171+
unsorted_hlt_paths = re.findall(r"process\.(HLT_[A-Za-z0-9_]+|L1T_[A-Za-z0-9_]+|DST_[A-Za-z0-9_]+|MC_[A-Za-z0-9_]+)", config_content)
172172

173173
# Remove duplicates and sort alphabetically
174174
hlt_paths = sorted(set(unsorted_hlt_paths))
@@ -228,7 +228,7 @@ for path_name in hlt_paths:
228228
def replace_hlt_paths(match):
229229
all_paths = match.group(2).split(", ")
230230
# Keep non-HLT/L1T paths and include only the current HLT or L1T path
231-
filtered_paths = [path for path in all_paths if not re.match(r"process\.(HLT_|L1T_)", path) or f"process.{path_name}" in path]
231+
filtered_paths = [path for path in all_paths if not re.match(r"process\.(HLT_|L1T_|DST_|MC_)", path) or f"process.{path_name}" in path]
232232
return match.group(1) + ", ".join(filtered_paths) + match.group(3)
233233

234234
# Apply the regex to remove all HLT and L1T paths except the current one
@@ -332,7 +332,10 @@ print("All cmsRun jobs submitted.")
332332
# Step 9: Compare all HLT root files using hltDiff
333333
def compare_hlt_results(input_dir, num_events, max_workers=4):
334334
# List all root files starting with "HLT_" or "L1T_" in the output directory
335-
root_files = [f for f in os.listdir(input_dir) if f.endswith(".root") and (f.startswith("HLT_") or f.startswith("L1T_"))]
335+
root_files = [f for f in os.listdir(input_dir) if f.endswith(".root") and (f.startswith("HLT_") \
336+
or f.startswith("L1T_") \
337+
or f.startswith("DST_") \
338+
or f.startswith("MC_"))]
336339

337340
# Base file (hltrun output) to compare against
338341
base_root_file = os.path.join(input_dir, "hlt.root")

0 commit comments

Comments
 (0)