Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TestWriteEventFormat.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 import sys
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
5 from xAODEventFormatCnv.EventFormatTestConfig import (
6  EventFormatTestFlags,
7  EventFormatTestOutputCfg,
8 )
9 from AthenaServices.MetaDataSvcConfig import MetaDataSvcCfg
10 
11 
12 def main():
13  numberOfStreams = 5
14  streamName = "Test"
15  flags = EventFormatTestFlags(eventsPerFile=5)
16  for i in range(numberOfStreams):
17  flags.addFlag(
18  f"Output.{streamName}{i}FileName",
19  f"{streamName}{i}.pool.root",
20  )
21  flags.addFlag(f"Output.doWrite{streamName}{i}", True)
22 
23  flags.fillFromArgs()
24  flags.lock()
25 
27  flags,
28  itemList=[
29  "xAODMakerTest::AVec#TestObject",
30  "xAODMakerTest::AAuxContainer#TestObjectAux.",
31  "xAOD::EventInfo#EventInfo",
32  "xAOD::EventAuxInfo#EventInfoAux.",
33  ],
34  )
35  acc.addEventAlgo(
36  CompFactory.xAODMakerTest.ACreatorAlg("ACreator", OutputKey="TestObject"),
37  sequenceName="AthAlgSeq",
38  )
39  acc.merge(EventInfoCnvAlgCfg(flags, disableBeamSpot=True))
40  acc.merge(
42  flags,
43  toolNames=[
44  "xAODMaker::EventFormatMetaDataTool",
45  "xAODMaker::FileMetaDataTool",
46  ],
47  )
48  )
49  acc.run(flags.Exec.MaxEvents)
50 
51 
52 if __name__ == "__main__":
53  sys.exit(main())
TestWriteEventFormat.main
def main()
Definition: TestWriteEventFormat.py:12
EventFormatTestConfig.EventFormatTestFlags
def EventFormatTestFlags(eventsPerFile=5, inputFiles=None)
Definition: EventFormatTestConfig.py:12
EventFormatTestConfig.EventFormatTestOutputCfg
def EventFormatTestOutputCfg(flags, streamName="Test", numberOfStreams=5, itemList=None)
Definition: EventFormatTestConfig.py:24
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
python.MetaDataSvcConfig.MetaDataSvcCfg
def MetaDataSvcCfg(flags, toolNames=[], tools=[])
Definition: MetaDataSvcConfig.py:6
python.xAODEventInfoCnvConfig.EventInfoCnvAlgCfg
def EventInfoCnvAlgCfg(flags, name="EventInfoCnvAlg", inputKey="McEventInfo", outputKey="EventInfo", disableBeamSpot=False, **kwargs)
Definition: xAODEventInfoCnvConfig.py:11