Skip to content

Commit 8955c1f

Browse files
authored
Merge pull request #46148 from mmusich/mm_dev_phase2IntegrationTests
improvements to `hltPhase2UpgradeIntegrationTests`
2 parents ac55036 + 8b408fe commit 8955c1f

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

HLTrigger/Configuration/python/HLT_75e33/test/hltPhase2UpgradeIntegrationTests.py renamed to HLTrigger/Configuration/scripts/hltPhase2UpgradeIntegrationTests

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
import argparse
23
import fnmatch
34
import os
@@ -23,13 +24,15 @@ def print_help():
2324
This script runs HLT test configurations for the CMS Phase2 upgrade.
2425
2526
Arguments:
26-
--globaltag : GlobalTag for the CMS conditions (required)
27-
--geometry : Geometry setting for the CMS process (required)
28-
--events : Number of events to process (default: 1)
29-
--threads : Number of threads to use (default: 1)
27+
--globaltag : GlobalTag for the CMS conditions (required)
28+
--geometry : Geometry setting for the CMS process (required)
29+
--events : Number of events to process (default: 1)
30+
--threads : Number of threads to use (default: 1)
31+
--restrictPathsTo : Restrict paths to be run to a user defined subset (e.g. "HLT_Ele*")
32+
--procModifiers : Optionally use one (or more) cmssw processModifier
3033
3134
Example usage:
32-
python script.py --globaltag auto:phase2_realistic_T33 --geometry Extended2026D110 --events 10 --threads 4
35+
hltPhase2UpgradeIntegrationTests --globaltag auto:phase2_realistic_T33 --geometry Extended2026D110 --events 10 --threads 4
3336
"""
3437
print(help_text)
3538

@@ -54,7 +57,7 @@ def run_command(command, log_file=None, workdir=None):
5457
parser.add_argument("--parallelJobs", type=int, default=4, help="Number of parallel cmsRun HLT jobs")
5558
parser.add_argument("--threads", type=int, default=1, help="Number of threads to use")
5659
parser.add_argument("--restrictPathsTo", nargs='+', default=[], help="List of HLT paths to restrict to")
57-
60+
parser.add_argument("--procModifiers", default=None, help="Optional process modifier for cmsDriver") # New argument for procModifiers
5861

5962
# Step 0: Capture the start time and print the start timestamp
6063
start_time = time.time()
@@ -77,19 +80,23 @@ def run_command(command, log_file=None, workdir=None):
7780
num_threads = args.threads
7881
num_parallel_jobs = args.parallelJobs
7982
restrict_paths_to = args.restrictPathsTo
83+
proc_modifiers = args.procModifiers # Store the procModifiers option
8084

8185
# Print the values in a nice formatted manner
8286
print(f"{'Configuration Summary':^40}")
8387
print("=" * 40)
84-
print(f"Global Tag: {global_tag}")
85-
print(f"Geometry: {geometry}")
86-
print(f"Era: {era}")
87-
print(f"Num Events: {num_events}")
88-
print(f"Num Threads: {num_threads}")
89-
print(f"Num Par. Jobs: {num_parallel_jobs}")
88+
print(f"Global Tag: {global_tag}")
89+
print(f"Geometry: {geometry}")
90+
print(f"Era: {era}")
91+
print(f"Num Events: {num_events}")
92+
print(f"Num Threads: {num_threads}")
93+
print(f"Num Parallel Jobs: {num_parallel_jobs}")
9094
# Print restrictPathsTo if provided
9195
if restrict_paths_to:
9296
print(f"Restricting paths to: {', '.join(restrict_paths_to)}")
97+
# Print procModifiers if provided
98+
if proc_modifiers:
99+
print(f"Proc Modifiers: {proc_modifiers}")
93100
print("=" * 40)
94101

95102
# Directory where all test configurations will be stored
@@ -111,6 +118,10 @@ def run_command(command, log_file=None, workdir=None):
111118
f'--customise_commands "process.options.wantSummary=True"'
112119
)
113120

121+
# Add procModifiers if provided
122+
if proc_modifiers:
123+
base_cmsdriver_command += f" --procModifiers {proc_modifiers}"
124+
114125
# The base configuration file and the dumped configuration file
115126
base_config_file = os.path.join(output_dir, "Phase2_L1P2GT_HLT.py")
116127
dumped_config_file = os.path.join(output_dir, "Phase2_dump.py")
@@ -278,7 +289,9 @@ def run_cmsrun(config_file):
278289
print(f"cmsRun for {config_file} generated an exception: {exc}")
279290

280291
if error_occurred:
292+
print("-" * 40)
281293
print("One or more cmsRun jobs failed. Exiting with failure.")
294+
print("-" * 40)
282295
exit(1)
283296

284297
print("All cmsRun jobs submitted.")
@@ -314,7 +327,9 @@ def compare_hlt_results():
314327

315328
# Check if the output contains the expected match string
316329
if expected_match_string not in output:
330+
print("-" * 40)
317331
print(f"Error: {root_file} has different HLT results!")
332+
print("-" * 40)
318333
exit(1) # Exit with failure if differences are found
319334

320335
print("All HLT comparisons passed with no differences.")

0 commit comments

Comments
 (0)