diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py index ce120c44cc7bbf65c5b031af4ba5c991d406c199..c744bd8e0061f33612107e0cfd3ccc34a0facf83 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py @@ -124,6 +124,9 @@ def createTriggerFlags(): # partition name used to determine online vs offline BS result writing import os flags.addFlag('Trigger.Online.partitionName', os.getenv('TDAQ_PARTITION') or '') + + # shortcut to check if job is running in a partition (i.e. partition name is not empty) + flags.addFlag('Trigger.Online.isPartition', lambda prevFlags: len(prevFlags.Trigger.Online.partitionName)>0) # write BS output file flags.addFlag('Trigger.writeBS', False) diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/decodeBS.py b/Trigger/TriggerCommon/TriggerJobOpts/share/decodeBS.py index c3cab9eb37cfabfb44b6f31b91c60fc0959fa3bf..1478eb45848f6df0ba64b2fb74c0582fab9bb515 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/share/decodeBS.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/share/decodeBS.py @@ -33,16 +33,9 @@ from AthenaConfiguration.AllConfigFlags import ConfigFlags ConfigFlags.Input.Files = athenaCommonFlags.FilesInput() # Use new-style config of ByteStream reading and import here into old-style JO -# --- COMMENTED OUT BECAUSE OF ATR-21307 --- -# from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper -# from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg -# CAtoGlobalWrapper(ByteStreamReadCfg,ConfigFlags) - -# --- OLD-STYLE REPLACEMENT OF THE ABOVE BECAUSE OF ATR-21307 --- -from ByteStreamCnvSvc import ReadByteStream # noqa F401 -from AthenaCommon.AppMgr import ServiceMgr as svcMgr -svcMgr.ByteStreamInputSvc.FullFileName=athenaCommonFlags.FilesInput() -# --- END OF ATR-21307 WORKAROUND --- +from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper +from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg +CAtoGlobalWrapper(ByteStreamReadCfg,ConfigFlags) # Define the decoding sequence from TrigHLTResultByteStream.TrigHLTResultByteStreamConf import HLTResultMTByteStreamDecoderAlg diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py index ab2341ea4be840eb4324dd16ebd38aff550d541d..91418556586cc5423ad802f77e8f47b071018b2d 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py @@ -66,6 +66,8 @@ class opt: # ################################################################################ from TriggerJobOpts.TriggerFlags import TriggerFlags +from AthenaConfiguration.AllConfigFlags import ConfigFlags +from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper, conf2toConfigurable from AthenaCommon.AppMgr import theApp, ServiceMgr as svcMgr from AthenaCommon.Logging import logging log = logging.getLogger('runHLT_standalone.py') @@ -122,6 +124,7 @@ import TriggerJobOpts.Modifiers # Auto-configuration for athena if len(athenaCommonFlags.FilesInput())>0: + ConfigFlags.Input.Files = athenaCommonFlags.FilesInput() import PyUtils.AthFile as athFile af = athFile.fopen(athenaCommonFlags.FilesInput()[0]) globalflags.InputFormat = 'bytestream' if af.fileinfos['file_type']=='bs' else 'pool' @@ -384,6 +387,8 @@ if TriggerFlags.doID: +isPartition = len(ConfigFlags.Trigger.Online.partitionName) > 0 + # ---------------------------------------------------------------- # Pool input # ---------------------------------------------------------------- @@ -400,15 +405,14 @@ if globalflags.InputFormat.is_pool(): # ---------------------------------------------------------------- # ByteStream input # ---------------------------------------------------------------- -elif globalflags.InputFormat.is_bytestream(): - - # This is only needed running athena (as opposed to athenaHLT) - if not hasattr(svcMgr,"ByteStreamCnvSvc"): - from ByteStreamCnvSvc import ReadByteStream # noqa - # Define the input - svcMgr.ByteStreamInputSvc.FullFileName = athenaCommonFlags.FilesInput() - theApp.ExtSvc += [ "ByteStreamCnvSvc"] - +elif globalflags.InputFormat.is_bytestream() and not ConfigFlags.Trigger.Online.isPartition: + if hasattr(svcMgr, "MetaDataSvc"): + # Need to set this property to ensure correct merging with MetaDataSvc from AthenaPoolCnvSvc/AthenaPool.py + # May be removed when the merging is fixed (or AthenaPool.py sets this property) + svcMgr.MetaDataSvc.MetaDataContainer = "MetaDataHdr" + # Set up ByteStream reading services + from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg + CAtoGlobalWrapper(ByteStreamReadCfg, ConfigFlags) # --------------------------------------------------------------- # Trigger config @@ -422,7 +426,6 @@ generateL1Menu() createL1PrescalesFileFromMenu() from TrigConfigSvc.TrigConfigSvcCfg import getL1ConfigSvc,L1ConfigSvcCfg -from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper, conf2toConfigurable CAtoGlobalWrapper(L1ConfigSvcCfg,None) #svcMgr += getL1ConfigSvc() @@ -542,10 +545,8 @@ if svcMgr.MessageSvc.OutputLevel<INFO: # Use parts of NewJO #------------------------------------------------------------- from AthenaCommon.Configurable import Configurable -from AthenaConfiguration.AllConfigFlags import ConfigFlags # Output flags -isPartition = len(ConfigFlags.Trigger.Online.partitionName) > 0 if opt.doWriteRDOTrigger: if isPartition: log.error('Cannot use doWriteRDOTrigger in athenaHLT or partition')