Skip to content

Commit dbf601e

Browse files
committed
Remove references to cms.FinalPath from HLT tools
1 parent e175131 commit dbf601e

File tree

2 files changed

+31
-43
lines changed

2 files changed

+31
-43
lines changed

HLTrigger/Configuration/scripts/hltDumpStream

+25-27
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def getStreamsInfoFromProcess(process, prescaleValues, numberOfPrescaleColumns):
8989
9090
each stream dict contains the following entries (key: value)
9191
- name: name of the stream
92-
- path: cms.EndPath/FinalPath associated to the stream
93-
- prescales: list of prescale values (1 per PS column) applied to the EndPath/FinalPath associated to the stream
92+
- path: cms.EndPath associated to the stream
93+
- prescales: list of prescale values (1 per PS column) applied to the EndPath associated to the stream
9494
- smartPrescales: dictionary (path:ps) of smart-prescales applied at stream level
9595
- datasets: list of dataset dictionaries (see below)
9696
@@ -123,9 +123,9 @@ def getStreamsInfoFromProcess(process, prescaleValues, numberOfPrescaleColumns):
123123
raise RuntimeError('ERROR -- the process holds multiple partial schedules: '+str(process._Process__partialschedules))
124124

125125
# find list of streams:
126-
# - stream XYZ exists if the configuration contains a EndPath/FinalPath that contains an OutputModule named hltOutputXYZ
127-
# - if more than one such EndPath/FinalPath exists, it is an error (unsupported configuration)
128-
# - if the configuration contains a cms.Schedule, the EndPath/FinalPath is required to be part of the cms.Schedule
126+
# - stream XYZ exists if the configuration contains a EndPath that contains an OutputModule named hltOutputXYZ
127+
# - if more than one such EndPath exists, it is an error (unsupported configuration)
128+
# - if the configuration contains a cms.Schedule, the EndPath is required to be part of the cms.Schedule
129129
# - reliance on the PSet "streams" is minimised:
130130
# - the latter PSet, if present, should be a superset of the streams found in the configuration
131131
# (this is the case for HLT configs containing only a subset of the triggers of a menu, e.g. "hltGetConfiguration --paths [..]")
@@ -141,27 +141,26 @@ def getStreamsInfoFromProcess(process, prescaleValues, numberOfPrescaleColumns):
141141
continue
142142
streamName = outModName[len('hltOutput'):]
143143

144-
# find EndPath/FinalPath containing stream OutputModule
144+
# find EndPath containing stream OutputModule
145145
streamPath = None
146146
outputModule = process.outputModules_()[outModName]
147-
for efPaths in [process.endpaths_().values(), process.finalpaths_().values()]:
148-
for efPath in efPaths:
149-
if procSchedule != None:
150-
# skip EndPath/FinalPath if not included in the schedule
151-
# (schedule.contains does not seem to be enough, so the index of the EndPath/FinalPath in the schedule is searched;
152-
# if the EndPath/FinalPath is not in the schedule, this search leads to a runtime-error)
153-
try: procSchedule.index(efPath)
154-
except: continue
155-
if efPath.contains(outputModule):
156-
# if streamPath is already set, throw a runtime error:
157-
# no more than one EndPath/FinalPath can hold a given OutputModule in valid HLT configurations
158-
if streamPath != None:
159-
errMsg = 'ERROR -- output module "'+outModName+'" is associated to'
160-
errMsg += ' more than one EndPath/FinalPath: '+str([streamPath.label(), efPath.label()])
161-
raise RuntimeError(errMsg)
162-
streamPath = efPath
163-
164-
# OutputModule not included in any active EndPath/FinalPath
147+
for efPath in process.endpaths_().values():
148+
if procSchedule != None:
149+
# skip EndPath if not included in the schedule
150+
# (schedule.contains does not seem to be enough, so the index of the EndPath in the schedule is searched;
151+
# if the EndPath is not in the schedule, this search leads to a runtime-error)
152+
try: procSchedule.index(efPath)
153+
except: continue
154+
if efPath.contains(outputModule):
155+
# if streamPath is already set, throw a runtime error:
156+
# no more than one EndPath can hold a given OutputModule in valid HLT configurations
157+
if streamPath != None:
158+
errMsg = 'ERROR -- output module "'+outModName+'" is associated to'
159+
errMsg += ' more than one EndPath: '+str([streamPath.label(), efPath.label()])
160+
raise RuntimeError(errMsg)
161+
streamPath = efPath
162+
163+
# OutputModule not included in any active EndPath
165164
if streamPath == None:
166165
continue
167166

@@ -290,9 +289,8 @@ def getStreamsInfoFromProcess(process, prescaleValues, numberOfPrescaleColumns):
290289

291290
# fill smart-PS applied at stream level
292291
# (in Run-2 HLT menus, smart-PSs are applied to standard Paths in the stream EndPath)
293-
# (in Run-3 HLT menus, prescales at stream level have not been used yet, plus they cannot be applied inside FinalPaths)
294292
streamSmartPrescales = {} # dictionary of smart-PSs applied at stream level
295-
smartPSModuleName = None # smart-PS module in the stream EndPath/FinalPath
293+
smartPSModuleName = None # smart-PS module in the stream EndPath
296294

297295
# build list of Paths that can have a smart-PS at stream level:
298296
# this includes the Paths of all datasets in the stream, and the DatasetPaths (if present)
@@ -307,7 +305,7 @@ def getStreamsInfoFromProcess(process, prescaleValues, numberOfPrescaleColumns):
307305
for foo in pathNamesForStreamSmartPS:
308306
streamSmartPrescales[foo] = 1
309307

310-
# loop on modules preceding the OutputModule in the EndPath/FinalPath
308+
# loop on modules preceding the OutputModule in the EndPath
311309
# to extract smart prescales at stream level, requiring no more than one smart-PS module
312310
streamPathExpanded = streamPath.expandAndClone()
313311
for modIdx in range(streamPathExpanded.index(outputModule)):

HLTrigger/Configuration/scripts/hltListPaths

+6-16
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def getPathList(args):
3737
if not isinstance(process, cms.Process):
3838
raise Exception(f'query did not return a valid HLT menu:\n query="{cmdline}"')
3939

40-
usePaths, useEndPaths, useFinalPaths = False, False, False
40+
usePaths, useEndPaths = False, False
4141

4242
# Paths only
4343
if args.selection == 'paths':
@@ -47,17 +47,13 @@ def getPathList(args):
4747
elif args.selection == 'endpaths':
4848
useEndPaths = True
4949

50-
# FinalPaths only
51-
elif args.selection == 'finalpaths':
52-
useFinalPaths = True
53-
54-
# Paths, EndPaths, and FinalPaths ('all')
50+
# Paths and EndPaths ('all')
5551
elif args.selection == 'all':
56-
usePaths, useEndPaths, useFinalPaths = True, True, True
52+
usePaths, useEndPaths = True, True
5753

5854
# invalid value
5955
else:
60-
raise RuntimeError(f'ERROR: invalid value for option "--selection" (must be "paths", "endpaths", "finalpaths", or "all"): {args.selection}')
56+
raise RuntimeError(f'ERROR: invalid value for option "--selection" (must be "paths", "endpaths", or "all"): {args.selection}')
6157

6258
path_keep_rules = []
6359
for path_keep_rule in args.path_keep_rules.split(','):
@@ -72,7 +68,6 @@ def getPathList(args):
7268
for pathDict in [
7369
process.paths_() if usePaths else None,
7470
process.endpaths_() if useEndPaths else None,
75-
process.finalpaths_() if useFinalPaths else None,
7671
]:
7772
if pathDict == None:
7873
continue
@@ -145,7 +140,7 @@ def hltMenu(name):
145140
return name if os.path.isfile(name) else options.ConnectionHLTMenu(name)
146141

147142
parser = argparse.ArgumentParser(
148-
description = 'List all the Paths, EndPaths and FinalPaths of an HLT configuration.',
143+
description = 'List all the Paths and EndPaths of an HLT configuration.',
149144
argument_default = argparse.SUPPRESS,
150145
formatter_class = formatter,
151146
add_help = False )
@@ -187,17 +182,12 @@ group.add_argument('-e', '--only-endpaths',
187182
action = 'store_const',
188183
const = 'endpaths',
189184
help = 'List only EndPaths' )
190-
group.add_argument('-f', '--only-finalpaths',
191-
dest = 'selection',
192-
action = 'store_const',
193-
const = 'finalpaths',
194-
help = 'List only FinalPaths' )
195185
group.add_argument('-a', '--all',
196186
dest = 'selection',
197187
action = 'store_const',
198188
const = 'all',
199189
default = 'all',
200-
help = 'List Paths, EndPaths and FinalPaths (default)' )
190+
help = 'List Paths and EndPaths (default)' )
201191

202192
parser.add_argument('--no-dependent-paths',
203193
dest = 'no_dependent_paths',

0 commit comments

Comments
 (0)