Skip to content
Snippets Groups Projects
Commit 31f4e543 authored by Rafal Bielski's avatar Rafal Bielski :wave:
Browse files

TriggerJobOpts: Use ByteStreamReadCfg to configure BS reading

parent c904c166
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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
......
......@@ -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')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment