Skip to content

Commit 852214b

Browse files
authored
Merge pull request #48664 from mmusich/mm_hltPhase2UpgradeIntegrationTests_diffMenus
allow the possibility to run different flavours of HLT menu in `hltPhase2UpgradeIntegrationTests`
2 parents 2b03173 + 5ede3eb commit 852214b

File tree

2 files changed

+24
-42
lines changed

2 files changed

+24
-42
lines changed

Configuration/HLT/python/autoHLT.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22
# cmsDriver.py hlt -s HLT:@relval
33

44
autoHLT = {
5-
'fake' : 'Fake',
6-
'fake1' : 'Fake1',
7-
'fake2' : 'Fake2',
8-
'relval50ns' : 'Fake',
9-
'relval25ns' : 'Fake1',
10-
'relval2016' : 'Fake2',
11-
'relval2017' : 'Fake2',
12-
'relval2018' : 'Fake2',
13-
'relval2022' : 'Fake2',
14-
'relval2023' : 'Fake2',
15-
'relval2024' : 'Fake2',
16-
'relval2025' : '2025v12',
17-
'relvalRun4' : '75e33',
18-
'test' : 'GRun',
5+
'fake' : 'Fake',
6+
'fake1' : 'Fake1',
7+
'fake2' : 'Fake2',
8+
'relval50ns' : 'Fake',
9+
'relval25ns' : 'Fake1',
10+
'relval2016' : 'Fake2',
11+
'relval2017' : 'Fake2',
12+
'relval2018' : 'Fake2',
13+
'relval2022' : 'Fake2',
14+
'relval2023' : 'Fake2',
15+
'relval2024' : 'Fake2',
16+
'relval2025' : '2025v12',
17+
'relvalRun4' : '75e33',
18+
'relvalRun4_timing' : '75e33_timing',
19+
'relvalRun4_scouting' : 'NGTScouting',
20+
'test' : 'GRun',
1921
}

HLTrigger/Configuration/scripts/hltPhase2UpgradeIntegrationTests

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,6 @@ _PH2_GEOMETRY = f"Extended{_settings.DEFAULT_VERSION}"
1818
# Get the actual era name from the version key
1919
_PH2_ERA_NAME = _settings.properties['Run4'][_settings.DEFAULT_VERSION]['Era']
2020

21-
# Function to display help information
22-
def print_help():
23-
help_text = """
24-
This script runs HLT test configurations for the CMS Phase2 upgrade.
25-
26-
Arguments:
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-
--parallelJobs : Number of parallel cmsRun and hltDiff executions (default: 4)
32-
--restrictPathsTo : Restrict paths to be run to a user defined subset (e.g. "HLT_Ele*")
33-
--procModifiers : Optionally use one (or more) cmssw processModifier
34-
--cachedInput : Optionally use an existing RAW data file (do not regenerate it from scratch)
35-
--dryRun : Optionally do not run any of the configuration created
36-
37-
Example usage:
38-
hltPhase2UpgradeIntegrationTests --globaltag auto:phase2_realistic_T33 --geometry Extended2026D110 --events 10 --threads 4
39-
"""
40-
print(help_text)
41-
4221
# Function to run a shell command and handle errors
4322
def run_command(command, log_file=None, workdir=None):
4423
try:
@@ -74,7 +53,10 @@ def compare_single_file(root_file, base_root_file, num_events, output_dir):
7453
return None # Return None if no issues are found
7554

7655
# Argument Parser for command-line configuration
56+
from Configuration.HLT.autoHLT import autoHLT
7757
parser = argparse.ArgumentParser(description="Run HLT Test Configurations")
58+
parser.add_argument("--menu", default="75e33_timing",
59+
choices=[v for k, v in autoHLT.items() if "Run4" in k], help="HLT menu to test")
7860
parser.add_argument("--globaltag", default=_PH2_GLOBAL_TAG, help="GlobalTag for the CMS conditions")
7961
parser.add_argument("--geometry", default=_PH2_GEOMETRY, help="Geometry setting for the CMS process") # Auto-generated geometry default
8062
parser.add_argument("--era", default=_PH2_ERA_NAME, help="Era setting for the CMS process") # Convert _PH2_ERA to string
@@ -94,12 +76,9 @@ print(f"Script started at {start_timestamp}")
9476
print("------------------------------------------------------------")
9577

9678
# Parse arguments
97-
try:
98-
args = parser.parse_args()
99-
except SystemExit:
100-
print_help()
101-
sys.exit(0)
79+
args = parser.parse_args()
10280

81+
menu = args.menu
10382
global_tag = args.globaltag
10483
era = args.era
10584
geometry = args.geometry
@@ -112,6 +91,7 @@ proc_modifiers = args.procModifiers # Store the procModifiers option
11291
# Print the values in a nice formatted manner
11392
print(f"{'Configuration Summary':^40}")
11493
print("=" * 40)
94+
print(f"HLT Menu: {menu}")
11595
print(f"Global Tag: {global_tag}")
11696
print(f"Geometry: {geometry}")
11797
print(f"Era: {era}")
@@ -143,7 +123,7 @@ os.makedirs(output_dir)
143123
# If cachedInput is provided, use it as the input for the base cmsDriver command
144124
if args.cachedInput:
145125
base_cmsdriver_command = (
146-
f"cmsDriver.py Phase2 -s L1P2GT,HLT:75e33_timing "
126+
f"cmsDriver.py Phase2 -s L1P2GT,HLT:{menu} "
147127
f"--conditions {global_tag} -n {num_events} --eventcontent FEVTDEBUGHLT "
148128
f"--geometry {geometry} --era {era} --filein {args.cachedInput} --fileout {output_dir}/hlt.root --no_exec "
149129
f"--mc --nThreads {num_threads} "
@@ -154,7 +134,7 @@ if args.cachedInput:
154134
)
155135
else:
156136
base_cmsdriver_command = (
157-
f"cmsDriver.py Phase2 -s L1P2GT,HLT:75e33_timing "
137+
f"cmsDriver.py Phase2 -s L1P2GT,HLT:{menu} "
158138
f"--conditions {global_tag} -n {num_events} --eventcontent FEVTDEBUGHLT "
159139
f"--geometry {geometry} --era {era} --filein file:{output_dir}/step1.root --fileout {output_dir}/hlt.root --no_exec "
160140
f"--nThreads {num_threads} "

0 commit comments

Comments
 (0)