diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py index 40450fa9998b3def017ca34a8cc045f310cb818d..43ec20c30fb5ffa9e840dd82a8b584ad1f46a390 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py @@ -206,6 +206,10 @@ def createTriggerFlags(): # name of the trigger menu flags.addFlag('Trigger.triggerMenuSetup', 'LS2_v1') + # modify the slection of chains that are run (default run all), see more in GenerateMenuMT_newJO + + flags.addFlag('Trigger.triggerMenuModifier', ['all']) + # name of the trigger menu flags.addFlag('Trigger.generateMenuDiagnostics', False) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py index 1ce863f74f56e8347093529a4d0ed8473d65ed26..d9622d9f6758f88d5dadf371cce7a3670b4474dc 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py @@ -35,11 +35,28 @@ def obtainChainsOfMenu(flags): return setupMenuModule.setupMenu(flags) +def acceptChain(chainDict, whichSignatures): + """ + Helper to accept chains to be part of the menu depending on their name or which signatures they belong to. + If the keyword "all" is present all chains that are in the menu are accepted. + If the keyword "emptyMenu" is present other keywords are checked. + They can be name of signature: e.g. Muon or name of chain(s) HLT_j50_L1J30 + Leaving the "emptyMenu" keyword only results in no chains that are configured. As a consequence would cause an issue somewhere downstream. + """ + if "all" in whichSignatures: + return True + if "emptyMenu" in whichSignatures: + if chainDict["chainName"] in whichSignatures: #explicit list of chains specified + return True + if all( [ sig in whichSignatures for sig in chainDict['signatures'] ]): # all signatures for the chain are mentioned + return True + return False def generateMenu(flags): """ Using flags generate appropriate Control Flow Graph wiht all HLT algorithms + """ # convert to chainDefs @@ -75,7 +92,8 @@ def generateMenu(flags): for chain in chains: # TODO topo threshold mainChainDict = dictFromChainName( chain ) - + if not acceptChain( mainChainDict, flags.Trigger.triggerMenuModifier ): + continue counter += 1 mainChainDict['chainCounter'] = counter