15from AthenaConfiguration.AllConfigFlags
import initConfigFlags
16from AthenaConfiguration.ComponentFactory
import CompFactory
18from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg, outputStreamName
20streamName =
"WritexAODElectrons"
21outputFileName =
"SimplePoolFile_xAOD.root"
24flags = initConfigFlags()
25flags.Input.Files = [
"SimplePoolFile3.root"]
26flags.addFlag(f
"Output.{streamName}FileName", outputFileName)
27flags.Exec.MaxEvents = -1
28flags.Common.MsgSuppression =
False
29flags.Exec.DebugMessageComponents = [outputStreamName(streamName),
30 "PoolSvc",
"AthenaPoolCnvSvc",
"AthenaPoolAddressProviderSvc",
"MetaDataSvc"]
33from AthenaConfiguration.TestDefaults
import defaultGeometryTags
34flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
39from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
40acc = MainServicesCfg( flags )
43from AthenaPoolExampleAlgorithms.AthenaPoolExampleConfig
import AthenaPoolExampleReadCfg, AthenaPoolExampleWriteCfg
44acc.merge( AthenaPoolExampleReadCfg(flags, readCatalogs = [
"file:Catalog1.xml"]) )
45acc.merge( AthenaPoolExampleWriteCfg( flags, streamName,
46 writeCatalog =
"file:Catalog1.xml") )
49acc.addEventAlgo( CompFactory.AthPoolEx.ReadData(
"ReadData", OutputLevel = DEBUG) )
50acc.addEventAlgo( CompFactory.AthPoolEx.WriteExampleElectron(
"WriteExampleElectron", OutputLevel = DEBUG) )
53streamCA = OutputStreamCfg( flags, streamName, disableEventTag =
True,
54 ItemList = [
"ExampleTrackContainer#MyTracks",
55 "xAOD::ExampleElectronContainer#TestContainer",
56 "xAOD::ExampleElectronAuxContainer#TestContainerAux.-decor2"] )
57stream = streamCA.getEventAlgo( outputStreamName( streamName ) )
63stream.WritingTool.OutputLevel = 3
64stream.HelperTools[0].OutputLevel = 3
68sc = acc.run(flags.Exec.MaxEvents)
69sys.exit(sc.isFailure())