Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLT menu development for 14_0_X (3/N) #44303

Merged
merged 6 commits into from
Mar 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update of hltPathOwners.json
missirol authored and mmusich committed Mar 4, 2024
commit 7c4ff53763f583af30391263d4311b3dfa50e9b9
35 changes: 24 additions & 11 deletions HLTrigger/Configuration/scripts/utils/hltListPathsWithoutOwners
Original file line number Diff line number Diff line change
@@ -9,16 +9,16 @@ import FWCore.ParameterSet.Config as cms
import HLTrigger.Configuration.Tools.options as options
from HLTrigger.Configuration.extend_argparse import *

def getHLTProcess(config):
if config.menu.run:
configline = f'--runNumber {config.menu.run}'
def getHLTProcess(args):
if args.menu.run:
configline = f'--runNumber {args.menu.run}'
else:
configline = f'--{config.menu.database} --{config.menu.version} --configName {config.menu.name}'
configline = f'--{args.menu.database} --{args.menu.version} --configName {args.menu.name}'

# cmd to download HLT configuration
cmdline = f'hltConfigFromDB {configline} --noedsources --noes --nooutput'
if config.proxy:
cmdline += f' --dbproxy --dbproxyhost {config.proxy_host} --dbproxyport {config.proxy_port}'
if args.proxy:
cmdline += f' --dbproxy --dbproxyhost {args.proxy_host} --dbproxyport {args.proxy_port}'

# download HLT configuration
proc = subprocess.Popen(cmdline, shell = True, stdin = None, stdout = subprocess.PIPE, stderr = None)
@@ -88,27 +88,40 @@ def main():
default = 'hltPathOwners.json',
help = 'Path to .json file with metadata on HLT Paths (online?, group-owners)' )

parser.add_argument('-o', '--output-json',
dest = 'output_json',
action = 'store',
default = None,
help = 'Path to name of new .json file (without triggers missing in MENU)' )

# redefine "--help" to be the last option, and use a customized message
parser.add_argument('-h', '--help',
action = 'help',
help = 'Show this help message and exit' )

# parse command line arguments and options
config = parser.parse_args()
args = parser.parse_args()

if not os.path.isfile(config.metadata_json):
raise RuntimeError(f'invalid path to metadata JSON file [--metadata-json]: {config.metadata_json}')
if not os.path.isfile(args.metadata_json):
raise RuntimeError(f'invalid path to metadata JSON file [--metadata-json]: {args.metadata_json}')

metadataDict = json.load(open(config.metadata_json))
metadataDict = json.load(open(args.metadata_json))

process = getHLTProcess(config)
process = getHLTProcess(args)

pathNames = sorted([pathName if '_v' not in pathName else pathName[:pathName.rfind('_v')]+'_v' for pathName, path in process.paths_().items() if not pathName.startswith('Dataset_')])

for pathName in pathNames:
if pathName not in metadataDict:
print(pathName)

if args.output_json != None:
metadataDict_out = {}
for pathName in metadataDict:
if pathName in pathNames:
metadataDict_out[pathName] = metadataDict[pathName]
json.dump(metadataDict_out, open(args.output_json, 'w'), sort_keys = True, indent = 2)

###
### main
###
6,228 changes: 1,964 additions & 4,264 deletions HLTrigger/Configuration/scripts/utils/hltPathOwners.json

Large diffs are not rendered by default.