diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py index ba04783d7f8be88c7a3a2e109f9d25280ccafac8..67b24ec53b0123238d9ad714f2302e456498b038 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py @@ -69,6 +69,7 @@ class opt: enabledSignatures = [] disabledSignatures = [] selectChains = [] + disableChains = [] # @@ -508,6 +509,8 @@ if not opt.createHLTMenuExternally: if (opt.selectChains): menu.selectChainsForTesting = opt.selectChains + elif (opt.disableChains): + menu.disableChains = opt.disableChains # generating the HLT structure requires # the HLTSeeding to be defined in the topSequence diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py index 7387a2487f987f56c2c210c7ba52d1af7a8ebd71..6f9bc3ca904f91769fe2825fdfcee097d0559f08 100755 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py @@ -54,6 +54,7 @@ class GenerateMenuMT(object, metaclass=Singleton): self.chainsInMenu = [] self.listOfErrorChainDefs = [] self.selectChainsForTesting = [] + self.disableChains = [] self.allChainsForAlignment = [] self.chainDicts = [] @@ -359,6 +360,18 @@ class GenerateMenuMT(object, metaclass=Singleton): raise Exception("[getChainsFromMenu] Cannot test one or more requested chains, exiting.") chains = selectedChains + if self.disableChains: + if self.selectChainsForTesting: + log.error("Either select chains or disable chains, not both. Will not proceed.") + raise Exception("[getChainsFromMenu] Both selectChains and disableChains options provided -- potential conflict!") + log.info("Eliminating chains from the menu") + chainNames = [ch.name for ch in chains] + missingNames = [ch for ch in self.disableChains if ch not in chainNames] + if missingNames: + log.warning("The following chains were specified in disableChains but were not found in the menu: %s", str(missingNames)) + selectedChains = [ch for ch in chains if ch.name not in self.disableChains] + chains = selectedChains + if len(chains) == 0: log.warning("There seem to be no chains in the menu - please check") else: