20def 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