ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
xAOD
xAODEventFormatCnv
python
EventFormatTestConfig.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
import
AllConfigFlags, MainServicesConfig
4
from
AthenaConfiguration.ComponentFactory
import
CompFactory
5
from
OutputStreamAthenaPool.OutputStreamConfig
import
(
6
OutputStreamCfg,
7
addToMetaData,
8
outputStreamName,
9
)
10
11
12
def
EventFormatTestFlags
(eventsPerFile=5, inputFiles=None):
13
if
inputFiles
is
None
:
14
inputFiles = []
15
16
flags = AllConfigFlags.initConfigFlags()
17
flags.Input.Files = inputFiles
18
flags.Concurrency.NumThreads = 8
19
flags.Exec.MaxEvents = eventsPerFile
20
21
return
flags
22
23
24
def
EventFormatTestOutputCfg
(
25
flags,
26
streamName="Test",
27
numberOfStreams=5,
28
itemList=None,
29
):
30
if
itemList
is
None
:
31
itemList = []
32
33
acc = MainServicesConfig.MainServicesCfg(flags)
34
35
for
i
in
range(numberOfStreams):
36
acc.merge(
37
OutputStreamCfg(
38
flags,
39
streamName=f
"{streamName}{i}"
,
40
ItemList=itemList,
41
disableEventTag=
True
,
42
)
43
)
44
45
acc.merge(
46
addToMetaData(
47
flags,
48
streamName=f
"{streamName}{i}"
,
49
itemOrList=[
50
f
"xAOD::EventFormat#EventFormat{outputStreamName(streamName)}{i}"
,
51
"xAOD::FileMetaData#FileMetaData"
,
52
"xAOD::FileMetaDataAuxInfo#FileMetaDataAux."
,
53
],
54
HelperTools=[
55
CompFactory.xAODMaker.EventFormatStreamHelperTool(
56
f
"{outputStreamName(streamName)}{i}_EventFormatStreamHelperTool"
,
57
Key=f
"EventFormat{outputStreamName(streamName)}{i}"
,
58
DataHeaderKey=f
"{outputStreamName(streamName)}{i}"
,
59
TypeNames=[
".*xAODMakerTest::.*"
],
60
OutputLevel=1,
61
),
62
CompFactory.xAODMaker.FileMetaDataCreatorTool(
63
f
"{outputStreamName(streamName)}{i}_FileMetaDataCreatorTool"
,
64
OutputKey=
"FileMetaData"
,
65
StreamName=f
"{outputStreamName(streamName)}{i}"
,
66
),
67
],
68
)
69
)
70
71
return
acc
EventFormatTestConfig.EventFormatTestOutputCfg
EventFormatTestOutputCfg(flags, streamName="Test", numberOfStreams=5, itemList=None)
Definition
EventFormatTestConfig.py:29
EventFormatTestConfig.EventFormatTestFlags
EventFormatTestFlags(eventsPerFile=5, inputFiles=None)
Definition
EventFormatTestConfig.py:12
Generated on
for ATLAS Offline Software by
1.17.0