ATLAS Offline Software
TestReadEventFormat.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 import sys
3 
4 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
5 from AthenaConfiguration.ComponentFactory import CompFactory
6 from AthenaConfiguration import MainServicesConfig
7 from AthenaServices.MetaDataSvcConfig import MetaDataSvcCfg
8 from xAODEventFormatCnv.EventFormatTestConfig import EventFormatTestFlags
9 
10 
11 def main():
12  flags = EventFormatTestFlags(
13  inputFiles=["Test0.pool.root"],
14  eventsPerFile=1,
15  )
16 
17  flags.lock()
18 
19  acc = MainServicesConfig.MainServicesCfg(flags)
20  acc.merge(PoolReadCfg(flags))
21  acc.addEventAlgo(CompFactory.xAODMakerTest.EventFormatPrinterAlg())
22 
23  acc.merge(
25  flags,
26  tools=[
27  CompFactory.xAODMaker.EventFormatMetaDataTool(
28  "EventFormatMetaDataTool",
29  OutputLevel=1,
30  Keys=[
31  "EventFormatStreamTest0",
32  "EventFormatAOD",
33  "SomeNotExistentKey",
34  ],
35  ),
36  CompFactory.xAODMaker.FileMetaDataTool(
37  "FileMetaDataTool",
38  OutputLevel=3,
39  ),
40  ],
41  )
42  )
43 
44  acc.run(flags.Exec.MaxEvents)
45 
46 
47 if __name__ == "__main__":
48  sys.exit(main())
EventFormatTestConfig.EventFormatTestFlags
def EventFormatTestFlags(eventsPerFile=5, inputFiles=None)
Definition: EventFormatTestConfig.py:12
TestReadEventFormat.main
def main()
Definition: TestReadEventFormat.py:11
python.MetaDataSvcConfig.MetaDataSvcCfg
def MetaDataSvcCfg(flags, toolNames=[], tools=[])
Definition: MetaDataSvcConfig.py:6
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69