diff --git a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py index 25492e1cc88b546fdee28cbd109645c6d3a66ea8..071a1deeb11a20ff803e76e7ae8db475305a6c1c 100644 --- a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py +++ b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py @@ -199,7 +199,7 @@ def make_all_hypo_algs(num_chains, concurrent=False): def configure_hlt_result(hypo_algs): from TrigOutputHandling.TrigOutputHandlingConf import StreamTagMakerTool, TriggerBitsMakerTool from TrigOutputHandling.TrigOutputHandlingConfig import TriggerEDMSerialiserToolCfg - from TriggerMenuMT.HLTMenuConfig.Menu.EventBuildingInfo import getFullHLTResultID + from TrigEDMConfig.DataScoutingInfo import getFullHLTResultID # Tool serialising EDM objects to fill the HLT result serialiser = TriggerEDMSerialiserToolCfg('Serialiser') diff --git a/Trigger/TrigAlgorithms/TrigPartialEventBuilding/python/TrigPartialEventBuildingConfig.py b/Trigger/TrigAlgorithms/TrigPartialEventBuilding/python/TrigPartialEventBuildingConfig.py index c61845124da1fcba577901eba81fa67c59ce5eb1..c09b919ba7edcd7155d39f78df99a267e7e1687d 100644 --- a/Trigger/TrigAlgorithms/TrigPartialEventBuilding/python/TrigPartialEventBuildingConfig.py +++ b/Trigger/TrigAlgorithms/TrigPartialEventBuilding/python/TrigPartialEventBuildingConfig.py @@ -3,7 +3,7 @@ # from TrigPartialEventBuilding.TrigPartialEventBuildingConf import StaticPEBInfoWriterTool, RoIPEBInfoWriterTool -from TriggerMenuMT.HLTMenuConfig.Menu.EventBuildingInfo import getFullHLTResultID +from TrigEDMConfig.DataScoutingInfo import getFullHLTResultID from libpyeformat_helper import SourceIdentifier, SubDetector diff --git a/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py b/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py index fce5de0c7d2713a70980cc5202527cf7e901ad7e..7cec3b8d5088c00a33b3343c7f78b67c0935f80e 100644 --- a/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py +++ b/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py @@ -48,7 +48,7 @@ def HLTResultMTMakerCfg(name="HLTResultMTMaker"): return m def TriggerEDMSerialiserToolCfg(name="TriggerEDMSerialiserTool"): - from TriggerMenuMT.HLTMenuConfig.Menu.EventBuildingInfo import getFullHLTResultID + from TrigEDMConfig.DataScoutingInfo import getFullHLTResultID # Configuration helper methods def addCollection(self, typeNameAux, moduleIds): @@ -93,7 +93,7 @@ def TriggerEDMSerialiserToolCfg(name="TriggerEDMSerialiserTool"): tpTool.TPMap = tpMap() serialiser.TPTool = tpTool - from TrigEDMConfig.TriggerEDMRun3 import TruncationThresholds as truncThresholds + from TrigEDMConfig.DataScoutingInfo import TruncationThresholds as truncThresholds serialiser.TruncationThresholds = truncThresholds # Configure monitoring histograms diff --git a/Trigger/TrigValidation/TrigP1Test/share/PEBDSTest.py b/Trigger/TrigValidation/TrigP1Test/share/PEBDSTest.py index 9079dbd6b734dc2f1da245446a770fd81ddcef1b..d1fb5984fa7dc7da03a6f9e98d276adeded82b3d 100644 --- a/Trigger/TrigValidation/TrigP1Test/share/PEBDSTest.py +++ b/Trigger/TrigValidation/TrigP1Test/share/PEBDSTest.py @@ -7,6 +7,7 @@ This test defines its own version of the LS2_v1 menu and the corresponding PEB/D and executes several chains testing various types of Partial Event Building and Data Scouting ''' +from TrigEDMConfig import DataScoutingInfo from TriggerMenuMT.HLTMenuConfig.Menu import LS2_v1, EventBuildingInfo, StreamInfo from TriggerMenuMT.HLTMenuConfig.Menu.ChainDefInMenu import ChainProp from TriggerMenuMT.HLTMenuConfig.Menu.GenerateMenuMT import GenerateMenuMT @@ -23,8 +24,8 @@ EventBuildingInfo.PartialEventBuildingIdentifiers.append('TestPEBOne') EventBuildingInfo.PartialEventBuildingIdentifiers.append('TestPEBTwo') EventBuildingInfo.PartialEventBuildingIdentifiers.append('TestPEBThree') EventBuildingInfo.PartialEventBuildingIdentifiers.append('TestPEBFour') -EventBuildingInfo.DataScoutingIdentifiers['ElectronDSTest'] = 3 -EventBuildingInfo.DataScoutingIdentifiers['ElectronDSPEBTest'] = 3 +DataScoutingInfo.DataScoutingIdentifiers['ElectronDSTest'] = 3 +DataScoutingInfo.DataScoutingIdentifiers['ElectronDSPEBTest'] = 3 # Override the setupMenu function from LS2_v1 def myMenu(): @@ -117,8 +118,8 @@ def myPebInfoWriterTool(name, eventBuildType): return None # Add Data Scouting HLT result ROB - if eventBuildType in EventBuildingInfo.getAllDataScoutingResultIDs(): - moduleId = EventBuildingInfo.getAllDataScoutingResultIDs()[eventBuildType] + if eventBuildType in DataScoutingInfo.getAllDataScoutingResultIDs(): + moduleId = DataScoutingInfo.getAllDataScoutingResultIDs()[eventBuildType] tool.addHLTResultToROBList(moduleId) return tool diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/DataScoutingInfo.py b/Trigger/TriggerCommon/TrigEDMConfig/python/DataScoutingInfo.py new file mode 100644 index 0000000000000000000000000000000000000000..d6d8ab96927224028180e578c6fb159d0627f3c8 --- /dev/null +++ b/Trigger/TriggerCommon/TrigEDMConfig/python/DataScoutingInfo.py @@ -0,0 +1,53 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +from AthenaCommon.Logging import logging +log = logging.getLogger( __name__ ) + +''' +This file defines the Data Scouting chain identifiers which serve also +as EDM target identifiers and their mapping to HLT Result module IDs. + +When adding new identifiers, please follow the naming convention SomeNameDS, +where SomeName is generally camel-case unless it's an acronym like LAr or MET. + +Possible examples: +CostMonDS, JetDS, PhotonDS +''' + + +# Data scouting identifiers and the corresponding HLT result ROBFragment module IDs +# WARNING: Never change the module IDs during data taking! +# WARNING: ID=0 is reserved for full HLT result +DataScoutingIdentifiers = { + 'CostMonDS': 1, + 'JetDS': 5 +} + + +# Truncation thresholds (in bytes) for each HLT result type +TruncationThresholds = { + 0: 5*(1024**2), # Main: 5 MB + 1: 1*(1024**2), # CostMonDS: 1 MB + 5: 1*(1024**2), # JetDS: 1 MB +} + + +def getDataScoutingResultID(name): + if name in DataScoutingIdentifiers: + return DataScoutingIdentifiers[name] + else: + log.error('Unknown name %s, cannot assign result ID', name) + + +def getAllDataScoutingResultIDs(): + return DataScoutingIdentifiers.values() + + +def getFullHLTResultID(): + # WARNING: Don't change this, it should always be zero. + # It's defined here to avoid using a magic number in other places + return 0 + + +def getAllDataScoutingIdentifiers(): + return list(DataScoutingIdentifiers.keys()) diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py index d2ac2a100031fae9d2cda71260e684842f685e2a..f97bf4f74d9d92a5950322fa88a40e80b9972b6e 100644 --- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py +++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py @@ -14,7 +14,7 @@ from AthenaCommon.Logging import logging __log = logging.getLogger('TriggerEDMRun3Config') -from TriggerMenuMT.HLTMenuConfig.Menu import EventBuildingInfo +import DataScoutingInfo def recordable( name ): """ @@ -53,7 +53,7 @@ def recordable( name ): # be stored in the specified format as well as the category # ------------------------------------------------------------ AllowedOutputFormats = ['BS', 'ESD', 'AODFULL', 'AODSLIM', 'AODVERYSLIM', 'AODBLSSLIM', 'AODLARGE', 'AODSMALL', ] -AllowedOutputFormats.extend(EventBuildingInfo.getAllDataScoutingIdentifiers()) +AllowedOutputFormats.extend(DataScoutingInfo.getAllDataScoutingIdentifiers()) JetVarsToKeep = ['ActiveArea', 'ActiveArea4vec_eta', 'ActiveArea4vec_m', 'ActiveArea4vec_phi', 'ActiveArea4vec_pt', 'AlgorithmType', @@ -402,16 +402,6 @@ EDMDetailsRun3[ "xAOD::JetEtRoIAuxInfo" ] = {'parent':"xAOD::JetEtRo EDMDetailsRun3[ "xAOD::CaloClusterTrigAuxContainer" ] = {'parent':"xAOD::CaloClusterContainer"} -#------------------------------------------------------------------------------- -# Truncation thresholds (in bytes) for each HLT result type -#------------------------------------------------------------------------------- -TruncationThresholds = { - 0: 5*(1024**2), # Main: 5 MB - 1: 1*(1024**2), # CostMonDS: 1 MB - 5: 1*(1024**2), # JetDS: 1 MB -} - - #------------------------------------------------------------------------------- # Helper functions #------------------------------------------------------------------------------- diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py index 82cae47f428f86123792d9ea1904f3ad480cad6b..aa9bb5f795c789c6987f0f3bf0f55f43f18a2668 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py @@ -294,16 +294,16 @@ def triggerBSOutputCfg(flags, decObj, decObjHypoOut, summaryAlg, offline=False): offline - if true CA contains algorithms that needs to be merged to output stream sequence, if false the CA contains a tool that needs to be added to HLT EventLoopMgr """ - from TriggerMenuMT.HLTMenuConfig.Menu import EventBuildingInfo + from TrigEDMConfig import DataScoutingInfo from TrigEDMConfig.TriggerEDM import getRun3BSList # handle the collectiosn defined in the EDM config - collectionsToBS = getRun3BSList( ["BS"]+ list(EventBuildingInfo.DataScoutingIdentifiers.keys()) ) + collectionsToBS = getRun3BSList( ["BS"]+ DataScoutingInfo.getAllDataScoutingIdentifiers() ) ItemModuleDict = OrderedDict() for typekey, bsfragments in collectionsToBS: # translate readable frament names like BS, CostMonDS names to ROB fragment IDs 0 - for the BS, 1,...- for DS fragments - moduleIDs = [ EventBuildingInfo.getFullHLTResultID() if f == 'BS' else EventBuildingInfo.getDataScoutingResultID(f) + moduleIDs = [ DataScoutingInfo.getFullHLTResultID() if f == 'BS' else DataScoutingInfo.getDataScoutingResultID(f) for f in bsfragments ] ItemModuleDict[typekey] = moduleIDs @@ -315,9 +315,9 @@ def triggerBSOutputCfg(flags, decObj, decObjHypoOut, summaryAlg, offline=False): typeName = 'xAOD::TrigCompositeContainer#{:s}'.format(item) typeNameAux = 'xAOD::TrigCompositeAuxContainer#{:s}Aux{:s}'.format(item, dynamic) if typeName not in list(ItemModuleDict.keys()): - ItemModuleDict[typeName] = [EventBuildingInfo.getFullHLTResultID()] + ItemModuleDict[typeName] = [DataScoutingInfo.getFullHLTResultID()] if typeNameAux not in list(ItemModuleDict.keys()): - ItemModuleDict[typeNameAux] = [EventBuildingInfo.getFullHLTResultID()] + ItemModuleDict[typeNameAux] = [DataScoutingInfo.getFullHLTResultID()] from TrigOutputHandling.TrigOutputHandlingConfig import TriggerEDMSerialiserToolCfg, StreamTagMakerToolCfg, TriggerBitsMakerToolCfg diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py index 87a1ed6851880ee18d4ff134674deb0c2b652fd9..a856ca83967518dd8adba7dd44813ce8b81d3c8e 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py @@ -2,6 +2,7 @@ # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # +from TrigEDMConfig import DataScoutingInfo from TriggerMenuMT.HLTMenuConfig.Menu import EventBuildingInfo from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import ChainStep, MenuSequence from TrigPartialEventBuilding.TrigPartialEventBuildingConf import PEBInfoWriterAlg @@ -73,10 +74,10 @@ def pebInfoWriterTool(name, eventBuildType): SubDetector.SCT_ENDCAP_A_SIDE, SubDetector.SCT_ENDCAP_C_SIDE ]) - elif eventBuildType in EventBuildingInfo.getAllDataScoutingIdentifiers(): + elif eventBuildType in DataScoutingInfo.getAllDataScoutingIdentifiers(): # Pure DataScouting configuration tool = StaticPEBInfoWriterToolCfg(name) - moduleId = EventBuildingInfo.getDataScoutingResultID(eventBuildType) + moduleId = DataScoutingInfo.getDataScoutingResultID(eventBuildType) tool.addHLTResultToROBList(moduleId) # Name not matched diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/EventBuildingInfo.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/EventBuildingInfo.py index c9b36efdf832a940e3657d9fc6b4ee7fc443b51d..14039de85bc55a3f9245e7718f1d190d1a16d6e1 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/EventBuildingInfo.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/EventBuildingInfo.py @@ -1,11 +1,18 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +from TrigEDMConfig import DataScoutingInfo from AthenaCommon.Logging import logging log = logging.getLogger( __name__ ) ''' This file defines Event Building identifiers which can be used in chain names. -Please follow the naming convention SomeNamePEBVariant or SomeNameDSVariant, +To avoid circular dependency between TrigEDMConfig and Menu, the Data Scouting +identifiers are moved to TrigEDMConfig.DataScoutingInfo. Nevertheless, Data +Scouting is just a special case of Partial Event Building. + +When adding new identifiers, please follow the naming convention + SomeNamePEBVariant for Partial Event Building (here) or + SomeNameDSVariant for Data Scouting (in DataScoutingInfo), where SomeName and Variant are generally camel-case unless they're acronyms like LAr or RPC. Variant is normally empty unless there are several variants like RPCPEB and RPCPEBSecondaryReadout. @@ -14,47 +21,19 @@ Possible examples: LArPEB, LumiPEB, RPCPEB, RPCPEBSecondaryReadout, TrkPEB, JetDS, PhotonDS ''' + # PEB identifiers PartialEventBuildingIdentifiers = [ - 'BeamSpotPEB', - 'LArPEB', - 'RPCPEBSecondaryReadout', - 'SCTPEB' + 'BeamSpotPEB', + 'LArPEB', + 'RPCPEBSecondaryReadout', + 'SCTPEB' ] -# Data scouting identifiers and the corresponding HLT result ROBFragment module IDs -# WARNING: Never change the module IDs during data taking! -# WARNING: ID=0 is reserved for full HLT result -DataScoutingIdentifiers = { - 'CostMonDS': 1, - 'JetDS': 5 -} - - -def getDataScoutingResultID(name): - if name in DataScoutingIdentifiers: - return DataScoutingIdentifiers[name] - else: - log.error('Unknown name %s, cannot assign result ID', name) - - -def getAllDataScoutingResultIDs(): - return DataScoutingIdentifiers.values() - - -def getFullHLTResultID(): - # WARNING: Don't change this, it should always be zero. - # It's defined here to avoid using a magic number in other places - return 0 - - -def getAllDataScoutingIdentifiers(): - return list(DataScoutingIdentifiers.keys()) - def getAllPartialEventBuildingIdentifiers(): return PartialEventBuildingIdentifiers def getAllEventBuildingIdentifiers(): - return PartialEventBuildingIdentifiers + list(DataScoutingIdentifiers.keys()) + return PartialEventBuildingIdentifiers + DataScoutingInfo.getAllDataScoutingIdentifiers()