ATLAS Offline Software
TestWriteEventFormat.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 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.lock()
24 
26  flags,
27  itemList=[
28  "xAODMakerTest::AVec#TestObject",
29  "xAODMakerTest::AAuxContainer#TestObjectAux.",
30  "xAOD::EventInfo#EventInfo",
31  "xAOD::EventAuxInfo#EventInfoAux.",
32  ],
33  )
34  acc.addEventAlgo(
35  CompFactory.xAODMakerTest.ACreatorAlg("ACreator", OutputKey="TestObject"),
36  sequenceName="AthAlgSeq",
37  )
38  acc.merge(EventInfoCnvAlgCfg(flags, disableBeamSpot=True))
39  acc.merge(
41  flags,
42  toolNames=[
43  "xAODMaker::EventFormatMetaDataTool",
44  "xAODMaker::FileMetaDataTool",
45  ],
46  )
47  )
48  acc.run(flags.Exec.MaxEvents)
49 
50 
51 if __name__ == "__main__":
52  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