ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Database
AthenaRoot
AthenaRootComps
python
RootWriteConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
4
from
AthenaConfiguration.ComponentFactory
import
CompFactory
5
6
7
def
RootWriteCfg
(flags):
8
"""Creates a ComponentAccumulator instance containing the
9
athena services required for ROOT file writing.
10
"""
11
12
cfg = ComponentAccumulator()
13
14
cfg.addService( CompFactory.Athena.RootSvc(
"AthenaRootSvc"
) )
15
cfg.addService( CompFactory.Athena.RootCnvSvc(
"AthenaRootCnvSvc"
) )
16
17
return
cfg
18
19
20
def
NtupleOutputStreamCfg
(flags, streamName, fileName, ItemList=None, tupleName="physics", forceRead=False):
21
"""Configure writing an Ntuple output stream."""
22
23
cfg =
RootWriteCfg
(flags)
24
25
writingTool = CompFactory.Athena.RootOutputStreamTool(
26
f
"{streamName}Tool"
,
27
TreeName = tupleName,
28
OutputFile = fileName )
29
30
outputStream = CompFactory.Athena.RootNtupleOutputStream(
31
streamName,
32
WritingTool = writingTool,
33
OutputFile = fileName,
34
ItemList = [
"RunNumber"
,
"EventNumber"
] + ([]
if
ItemList
is
None
else
ItemList),
35
ForceRead = forceRead )
36
37
cfg.addEventAlgo(outputStream, domain=
'IO'
)
38
return
cfg
RootWriteConfig.RootWriteCfg
RootWriteCfg(flags)
Definition
RootWriteConfig.py:7
RootWriteConfig.NtupleOutputStreamCfg
NtupleOutputStreamCfg(flags, streamName, fileName, ItemList=None, tupleName="physics", forceRead=False)
Definition
RootWriteConfig.py:20
Generated on
for ATLAS Offline Software by
1.17.0