ATLAS Offline Software
AthenaPoolTestStep2Write.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.AllConfigFlags import initConfigFlags
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from AthenaCommon.Constants import DEBUG
6 
7 # Setup flags
8 flags = initConfigFlags()
9 flags.Common.MsgSuppression = False
10 flags.Input.Files = ["myStream1.pool.root"]
11 # to avoid input file peeking:
12 flags.Input.RunNumbers = [1]
13 flags.Input.ProcessingTags = []
14 flags.Input.TypedCollections = []
15 flags.lock()
16 
17 # Main services
18 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
19 acc = MainServicesCfg(flags)
20 
21 # Pool reading and writing
22 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
23 acc.merge( PoolReadCfg(flags) )
24 
25 from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
26 acc.merge( PoolWriteCfg(flags) )
27 
28 acc.addEventAlgo( CompFactory.AthenaPoolTestDataWriter(OutputLevel = DEBUG,
29  PartialCreate = True,
30  ReadOtherHalf = True),
31  sequenceName = 'AthAlgSeq' )
32 
33 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
34 acc.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
46 import sys
47 sc = acc.run(flags.Exec.MaxEvents)
48 sys.exit(sc.isFailure())
python.PoolWriteConfig.PoolWriteCfg
def PoolWriteCfg(flags)
Definition: PoolWriteConfig.py:41
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:12
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69