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"]
34from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
35acc = MainServicesCfg( flags )
38from AthenaPoolExampleAlgorithms.AthenaPoolExampleConfig
import AthenaPoolExampleReadCfg, AthenaPoolExampleWriteCfg
39acc.merge( AthenaPoolExampleReadCfg(flags, readCatalogs = [
"file:Catalog1.xml"]) )
40acc.merge( AthenaPoolExampleWriteCfg( flags, streamName,
41 writeCatalog =
"file:Catalog1.xml") )
44acc.addEventAlgo( CompFactory.AthPoolEx.ReadData(
"ReadData", OutputLevel = DEBUG) )
45acc.addEventAlgo( CompFactory.AthPoolEx.WriteExampleElectron(
"WriteExampleElectron", OutputLevel = DEBUG) )
48streamCA = OutputStreamCfg( flags, streamName, disableEventTag =
True,
49 ItemList = [
"ExampleTrackContainer#MyTracks",
50 "xAOD::ExampleElectronContainer#TestContainer",
51 "xAOD::ExampleElectronAuxContainer#TestContainerAux.-decor2"] )
52stream = streamCA.getEventAlgo( outputStreamName( streamName ) )
58stream.WritingTool.OutputLevel = 3
59stream.HelperTools[0].OutputLevel = 3
63sc = acc.run(flags.Exec.MaxEvents)
64sys.exit(sc.isFailure())