1+ #!/usr/bin/env python3
12import argparse
23import fnmatch
34import 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):
5457parser .add_argument ("--parallelJobs" , type = int , default = 4 , help = "Number of parallel cmsRun HLT jobs" )
5558parser .add_argument ("--threads" , type = int , default = 1 , help = "Number of threads to use" )
5659parser .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
6063start_time = time .time ()
@@ -77,19 +80,23 @@ def run_command(command, log_file=None, workdir=None):
7780num_threads = args .threads
7881num_parallel_jobs = args .parallelJobs
7982restrict_paths_to = args .restrictPathsTo
83+ proc_modifiers = args .procModifiers # Store the procModifiers option
8084
8185# Print the values in a nice formatted manner
8286print (f"{ 'Configuration Summary' :^40} " )
8387print ("=" * 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
9195if 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 } " )
93100print ("=" * 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
115126base_config_file = os .path .join (output_dir , "Phase2_L1P2GT_HLT.py" )
116127dumped_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
280291if error_occurred :
292+ print ("-" * 40 )
281293 print ("One or more cmsRun jobs failed. Exiting with failure." )
294+ print ("-" * 40 )
282295 exit (1 )
283296
284297print ("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