ATLAS Offline Software
Loading...
Searching...
No Matches
AthenaPoolTestStep2Write.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.AllConfigFlags import initConfigFlags
4from AthenaConfiguration.ComponentFactory import CompFactory
5from AthenaCommon.Constants import DEBUG
6
7# Setup flags
8flags = initConfigFlags()
9flags.Common.MsgSuppression = False
10flags.Input.Files = ["myStream1.pool.root"]
11# to avoid input file peeking:
12flags.Input.RunNumbers = [1]
13flags.Input.ProcessingTags = []
14flags.Input.TypedCollections = []
15flags.lock()
16
17# Main services
18from AthenaConfiguration.MainServicesConfig import MainServicesCfg
19acc = MainServicesCfg(flags)
20
21# Pool reading and writing
22from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
23acc.merge( PoolReadCfg(flags) )
24
25from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
26acc.merge( PoolWriteCfg(flags) )
27
28acc.addEventAlgo( CompFactory.AthenaPoolTestDataWriter(OutputLevel = DEBUG,
29 PartialCreate = True,
30 ReadOtherHalf = True),
31 sequenceName = 'AthAlgSeq' )
32
33from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
34acc.merge( OutputStreamCfg(
35 flags,
36 streamName = "Stream4",
37 disableEventTag = True,
38 ItemList = ["EventInfo#*",
39 # Write out only a new set of cols 1,2,3, and matrix
40 "IAthenaPoolTestCollection#AthenaPoolTestCollection_1",
41 "IAthenaPoolTestCollection#AthenaPoolTestCollection_2",
42 "IAthenaPoolTestCollection#AthenaPoolTestCollection_3",
43 "AthenaPoolTestMatrix#*"]) )
44
45# Run
46import sys
47sc = acc.run(flags.Exec.MaxEvents)
48sys.exit(sc.isFailure())