Skip to content
Snippets Groups Projects
Commit 64324e9f authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'trans-bs-ca' into 'master'

ComponentAccumulator configuration of transient ByteStream

See merge request !39213
parents 97d40bb5 1e8877f9
No related branches found
No related tags found
No related merge requests found
...@@ -157,6 +157,61 @@ def ByteStreamWriteCfg(flags, type_names=None): ...@@ -157,6 +157,61 @@ def ByteStreamWriteCfg(flags, type_names=None):
return result 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(): def main():
"""Run a functional test if module is executed""" """Run a functional test if module is executed"""
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # 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", def LArRawDataContByteStreamToolConfig (name="LArRawDataContByteStreamTool",
InitializeForWriting = False, InitializeForWriting = False,
stream=None, stream=None,
**kwargs): **kwargs):
tool = LArRawDataContByteStreamTool (name, **kwargs) tool = CompFactory.LArRawDataContByteStreamTool (name, **kwargs)
if InitializeForWriting: if InitializeForWriting:
from CaloTools.CaloNoiseCondAlg import CaloNoiseCondAlg
from LArCabling.LArCablingAccess import LArOnOffIdMapping, LArFebRodMapping from LArCabling.LArCablingAccess import LArOnOffIdMapping, LArFebRodMapping
noisealg = CaloNoiseCondAlg ('totalNoise') noisealg = CompFactory.CaloNoiseCondAlg ('totalNoise')
LArOnOffIdMapping() LArOnOffIdMapping()
LArFebRodMapping() LArFebRodMapping()
if stream: if stream:
......
# 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
...@@ -390,11 +390,6 @@ if ConfigFlags.Input.Format == 'POOL': ...@@ -390,11 +390,6 @@ if ConfigFlags.Input.Format == 'POOL':
import AthenaPoolCnvSvc.ReadAthenaPool # noqa import AthenaPoolCnvSvc.ReadAthenaPool # noqa
svcMgr.AthenaPoolCnvSvc.PoolAttributes = [ "DEFAULT_BUFFERSIZE = '2048'" ] svcMgr.AthenaPoolCnvSvc.PoolAttributes = [ "DEFAULT_BUFFERSIZE = '2048'" ]
svcMgr.PoolSvc.AttemptCatalogPatch=True 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 # ByteStream input
...@@ -469,6 +464,13 @@ if opt.doL1Sim: ...@@ -469,6 +464,13 @@ if opt.doL1Sim:
from TriggerJobOpts.Lvl1SimulationConfig import Lvl1SimulationSequence from TriggerJobOpts.Lvl1SimulationConfig import Lvl1SimulationSequence
hltBeginSeq += Lvl1SimulationSequence(ConfigFlags) 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 # HLT generation
......
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