diff --git a/Event/ByteStreamCnvSvc/python/ByteStreamConfig.py b/Event/ByteStreamCnvSvc/python/ByteStreamConfig.py index beac64668773fe63b08f5d79e7e313a9f3f6e1ba..ec40719560ee102d66e9811d487607451ac38d21 100644 --- a/Event/ByteStreamCnvSvc/python/ByteStreamConfig.py +++ b/Event/ByteStreamCnvSvc/python/ByteStreamConfig.py @@ -157,6 +157,61 @@ def ByteStreamWriteCfg(flags, type_names=None): return result +def TransientByteStreamCfg(flags, item_list=None, type_names=None, extra_inputs=None): + """Set up transient ByteStream output stream + + Configure components responsible for writing bytestream format. Write the + specified objects to ByteStream into the cache of the ROBDataProviderSvc. + The data can then be read downstream as if they were coming from a BS file. + + Args: + flags: Job configuration, usually derived from ConfigFlags + item_list: (optional) List of objects to be written to transient ByteStream + type_names: (optional) List of types/names to register in BS conversion service + as available to be read from (transient) ByteStream + extra_inputs: (optional) List of objects which need to be produced before transient + ByteStream streaming is scheduled - ensures correct scheduling + + Returns: + A component accumulator fragment containing the components required to + write transient bytestream. Should be merged into main job configuration. + """ + + result = ComponentAccumulator() + comp_factory = AthenaConfiguration.ComponentFactory.CompFactory + + rdp = comp_factory.ROBDataProviderSvc() + result.addService(rdp) + + rdp_output = comp_factory.ByteStreamRDP_OutputSvc() + result.addService(rdp_output) + + bytestream_conversion = comp_factory.ByteStreamCnvSvc( + name="ByteStreamCnvSvc", + ByteStreamOutputSvcList=[rdp_output.getName()], + ) + result.addService(bytestream_conversion) + + output_stream = comp_factory.AthenaOutputStream( + name="TransBSStreamAlg", + EvtConversionSvc=bytestream_conversion.name, + OutputFile="ByteStreamRDP_OutputSvc", + ItemList=item_list if item_list else list(), + ExtraInputs=extra_inputs if extra_inputs else list(), + ) + result.addEventAlgo(output_stream, primary=True) + + address_provider = comp_factory.ByteStreamAddressProviderSvc( + TypeNames=type_names if type_names else list(), + ) + result.addService(address_provider) + + proxy = comp_factory.ProxyProviderSvc() + proxy.ProviderNames += [address_provider.name] + result.addService(proxy) + + return result + def main(): """Run a functional test if module is executed""" diff --git a/LArCalorimeter/LArCnv/LArByteStream/python/LArByteStreamConfig.py b/LArCalorimeter/LArCnv/LArByteStream/python/LArByteStreamConfig.py index cad5f10f176985535d9ba709db2b004cfd639c1f..6ffba323d0f120218fb29d36c4e608d16d7da914 100644 --- a/LArCalorimeter/LArCnv/LArByteStream/python/LArByteStreamConfig.py +++ b/LArCalorimeter/LArCnv/LArByteStream/python/LArByteStreamConfig.py @@ -1,19 +1,17 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -from LArByteStream.LArByteStreamConf import LArRawDataContByteStreamTool - +from AthenaConfiguration.ComponentFactory import CompFactory def LArRawDataContByteStreamToolConfig (name="LArRawDataContByteStreamTool", InitializeForWriting = False, stream=None, **kwargs): - tool = LArRawDataContByteStreamTool (name, **kwargs) + tool = CompFactory.LArRawDataContByteStreamTool (name, **kwargs) if InitializeForWriting: - from CaloTools.CaloNoiseCondAlg import CaloNoiseCondAlg from LArCabling.LArCablingAccess import LArOnOffIdMapping, LArFebRodMapping - noisealg = CaloNoiseCondAlg ('totalNoise') + noisealg = CompFactory.CaloNoiseCondAlg ('totalNoise') LArOnOffIdMapping() LArFebRodMapping() if stream: diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerTransBSConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerTransBSConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..2e932fa4a03c7ff108777f7f516420c0635432cc --- /dev/null +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerTransBSConfig.py @@ -0,0 +1,100 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +''' +ComponentAccumulator configuration for producing transient ByteStream, +which is required when running HLT selection algorithms on MC RDO inputs +''' + + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from ByteStreamCnvSvc.ByteStreamConfig import TransientByteStreamCfg + +def triggerTransBSCfg(flags, seqName="AthAlgSeq"): + acc = ComponentAccumulator(seqName) + + itemList = [] # Objects to be written to transient BS + typeNames = [] # Objects to be read from transient BS + extraInputs = [] # Objects to be produced before writing transient BS (scheduler dependency) + + # -------------------------------------------------- + # Level-1 Trigger + # -------------------------------------------------- + from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1TriggerByteStreamEncoderCfg + acc.merge(L1TriggerByteStreamEncoderCfg(flags)) + + if flags.Trigger.enableL1CaloLegacy or not flags.Trigger.enableL1Phase1: + itemList += ["ROIB::RoIBResult#RoIBResult"] + typeNames += ["MuCTPI_RDO/MUCTPI_RDO"] + extraInputs += [('ROIB::RoIBResult', 'StoreGateSvc+RoIBResult')] + + if flags.Trigger.enableL1Phase1: + itemList += ["xAOD::TrigCompositeContainer#L1TriggerResult", + "xAOD::TrigCompositeAuxContainer#L1TriggerResultAux."] + extraInputs += [('xAOD::TrigCompositeContainer', 'StoreGateSvc+L1TriggerResult')] + + # -------------------------------------------------- + # ID + # -------------------------------------------------- + if flags.Trigger.doID: + # Pixel + itemList += ["PixelRDO_Container#*"] + typeNames += ["InDet::PixelClusterContainer/PixelOnlineClusters"] + extraInputs += [('PixelHitDiscCnfgData','ConditionStore+PixelHitDiscCnfgData')] + extraInputs += [('PixelCablingCondData','ConditionStore+PixelCablingCondData')] + # SCT + itemList += ["SCT_RDO_Container#*"] + typeNames += ["InDet::SCT_ClusterContainer/SCT_OnlineClusters"] + extraInputs += [('SCT_CablingData','ConditionStore+SCT_CablingData')] + # TRT + itemList += ["TRT_RDO_Container#*"] + typeNames += ["InDet::TRT_DriftCircleContainer/TRT_DriftCircle"] + + # -------------------------------------------------- + # Calo + # -------------------------------------------------- + if flags.Trigger.doCalo: + # LAr + from LArByteStream.LArByteStreamConfig import LArRawDataContByteStreamToolConfig + lar_tool = LArRawDataContByteStreamToolConfig(InitializeForWriting=True) + acc.addPublicTool(lar_tool) + itemList += ["LArRawChannelContainer#*"] + extraInputs += [('CaloNoise', 'ConditionStore+totalNoise'), + ('LArOnOffIdMapping', 'ConditionStore+LArOnOffIdMap'), + ('LArFebRodMapping', 'ConditionStore+LArFebRodMap')] + # Tile + itemList += ["TileRawChannelContainer#*"] + typeNames += ["TileCellIDC/TileCellIDC"] + extraInputs += [('TileBadChannels','ConditionStore+TileBadChannels')] + + # -------------------------------------------------- + # Muon + # -------------------------------------------------- + if flags.Trigger.doMuon: + # MDT + itemList += ["MdtCsmContainer#*"] + typeNames += ["MdtDigitContainer/MDT_DIGITS", + "MdtCsmContainer/MDTCSM"] + extraInputs += [('MuonMDT_CablingMap','ConditionStore+MuonMDT_CablingMap')] + # RPC + itemList += ["RpcPadContainer#*"] + typeNames += ["RpcDigitContainer/RPC_DIGITS", + "RpcPadContainer/RPCPAD"] + # TGC + itemList += ["TgcRdoContainer#*"] + typeNames += ["TgcDigitContainer/TGC_DIGITS", + "TgcRdoContainer/TGCRDO"] + # CSC + itemList += ["CscRawDataContainer#*"] + typeNames += ["CscDigitContainer/CSC_DIGITS", + "CscRawDataContainer/CSCRDO"] + + # -------------------------------------------------- + # Final configuration + # -------------------------------------------------- + transBSCfg = TransientByteStreamCfg( + flags, + item_list=itemList, + type_names=typeNames, + extra_inputs=extraInputs) + acc.merge(transBSCfg, sequenceName=seqName) + + return acc diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py index 3ea6726e9574e337e36ffe3e2db53ac1eb777cb3..a4c83476b215aea8ed869386404470a00cae023e 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py @@ -390,11 +390,6 @@ if ConfigFlags.Input.Format == 'POOL': import AthenaPoolCnvSvc.ReadAthenaPool # noqa svcMgr.AthenaPoolCnvSvc.PoolAttributes = [ "DEFAULT_BUFFERSIZE = '2048'" ] svcMgr.PoolSvc.AttemptCatalogPatch=True - # enable transient BS - if ConfigFlags.Trigger.doTransientByteStream: - log.info("setting up transient BS") - include( "TriggerJobOpts/jobOfragment_TransBS_standalone.py" ) - # ---------------------------------------------------------------- # ByteStream input @@ -469,6 +464,13 @@ if opt.doL1Sim: from TriggerJobOpts.Lvl1SimulationConfig import Lvl1SimulationSequence hltBeginSeq += Lvl1SimulationSequence(ConfigFlags) +# --------------------------------------------------------------- +# Transient ByteStream +# --------------------------------------------------------------- +if ConfigFlags.Trigger.doTransientByteStream: + log.info("Configuring transient ByteStream") + from TriggerJobOpts.TriggerTransBSConfig import triggerTransBSCfg + CAtoGlobalWrapper(triggerTransBSCfg, ConfigFlags, seqName="HLTBeginSeq") # --------------------------------------------------------------- # HLT generation