Skip to content
Snippets Groups Projects
Commit 1ece9a75 authored by Walter Lampl's avatar Walter Lampl Committed by Adam Edward Barton
Browse files

Prototype of output configuration with ComponentAccumulator

Former-commit-id: 0be0dd1a
parent 45d33618
No related branches found
No related tags found
No related merge requests found
...@@ -112,21 +112,33 @@ if __name__=="__main__": ...@@ -112,21 +112,33 @@ if __name__=="__main__":
ConfigFlags.Input.isMC = False ConfigFlags.Input.isMC = False
ConfigFlags.Input.Files = ["myESD.pool.root"] ConfigFlags.Input.Files = ["myESD.pool.root"]
ConfigFlags.Output.ESDFileName="esdOut.pool.root"
ConfigFlags.lock() ConfigFlags.lock()
cfg=ComponentAccumulator() from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
#cfg=ComponentAccumulator()
cfg=MainServicesSerialCfg()
cfg.merge(PoolReadCfg(ConfigFlags)) cfg.merge(PoolReadCfg(ConfigFlags))
theKey="CaloCalTopoClustersNew"
topoAcc,topoAlg=CaloTopoClusterCfg(ConfigFlags) topoAcc,topoAlg=CaloTopoClusterCfg(ConfigFlags)
topoAlg.ClustersOutputName="CaloCalTopoClustersNew" topoAlg.ClustersOutputName=theKey
cfg.merge(topoAcc) cfg.merge(topoAcc)
cfg.addEventAlgo(topoAlg) cfg.addEventAlgo(topoAlg,sequenceName="AthAlgSeq")
from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
cfg.merge(OutputStreamCfg(ConfigFlags,"ESD", ItemList=["xAOD::CaloClusterContainer#"+theKey,
"xAOD::CaloClusterAuxContainer#"+theKey+"Aux.",
"CaloClusterCellLinkContainer#"+theKey+"_links"]))
cfg.getService("StoreGateSvc").Dump=True
f=open("CaloTopoCluster.pkl","w") cfg.run()
cfg.store(f) #f=open("CaloTopoCluster.pkl","w")
f.close() #cfg.store(f)
#f.close()
...@@ -27,8 +27,13 @@ def _createCfgFlags(): ...@@ -27,8 +27,13 @@ def _createCfgFlags():
acf.addFlag('Output.doESD', False) # produce ESD containers acf.addFlag('Output.doESD', False) # produce ESD containers
acf.addFlag('Output.writeESD', False) # configure ESD output writing
acf.addFlag('Output.HITFileName','myHIT.pool.root')
acf.addFlag('Output.RDOFileName','myROD.pool.root')
acf.addFlag('Output.ESDFileName','myESD.pool.root')
acf.addFlag('Output.AODFileName','myAOD.pool.root')
#Geo Model Flags: #Geo Model Flags:
acf.addFlag('GeoModel.Layout', 'atlas') # replaces global.GeoLayout acf.addFlag('GeoModel.Layout', 'atlas') # replaces global.GeoLayout
acf.addFlag("GeoModel.AtlasVersion", lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("Geometry","ATLAS-R2-2016-01-00-01")) # acf.addFlag("GeoModel.AtlasVersion", lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("Geometry","ATLAS-R2-2016-01-00-01")) #
......
...@@ -40,6 +40,7 @@ _propsToUnify={"GeoModelSvc.DetectorTools":unifySet, ...@@ -40,6 +40,7 @@ _propsToUnify={"GeoModelSvc.DetectorTools":unifySet,
"PoolSvc.ReadCatalog":unifySet, "PoolSvc.ReadCatalog":unifySet,
"ProxyProviderSvc.ProviderNames":unifySet, "ProxyProviderSvc.ProviderNames":unifySet,
"TagInfoMgr.ExtraTagValuePairs":unifySetOfPairs, "TagInfoMgr.ExtraTagValuePairs":unifySetOfPairs,
"AthenaOutputStream.ItemList":unifySet,
} }
......
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator, ConfigurationError
from AthenaCommon.Logging import logging
def OutputStreamCfg(configFlags, streamName, ItemList=[] ):
from OutputStreamAthenaPoolConf import MakeEventStreamInfo
from AthenaServices.AthenaServicesConf import AthenaOutputStream
from AthenaServices.AthenaServicesConf import AthenaOutputStreamTool
flagName="Output.%sFileName" % streamName
if configFlags.hasFlag(flagName):
fileName=configFlags._get(flagName)
else:
fileName="my%s.pool.root" % streamName
msg = logging.getLogger('OutputStreamCfg')
msg.info("No file name predefined for stream %s. Using %s" % (streamName, fileName))
if fileName in configFlags.Input.Files:
raise ConfigurationError("Same name for input and output file %s" % fileName)
outputAlgName="OutputStream"+streamName
result=ComponentAccumulator(sequenceName="AthOutSeq")
# define athena output stream
writingTool = AthenaOutputStreamTool( streamName + "Tool" )
streamInfoTool = MakeEventStreamInfo( streamName + "_MakeEventStreamInfo" )
streamInfoTool.Key = streamName
outputStream = AthenaOutputStream(
outputAlgName,
WritingTool = writingTool,
ItemList = [ "xAOD::EventInfo#*" ]+ItemList,
OutputFile = fileName,
HelperTools = [ streamInfoTool ],
)
#outputStream.MetadataStore = svcMgr.MetaDataStore
#outputStream.MetadataItemList = [ "EventStreamInfo#" + streamName, "IOVMetaDataContainer#*" ]
result.addEventAlgo(outputStream)
return result
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