8 from __future__
import print_function
10 from AthenaCommon
import CfgMgr
11 from AthenaCommon.AppMgr
import ServiceMgr
as svcMgr
12 from AthenaServices.AthenaServicesConf
import AthenaOutputStream
13 from AthenaServices.AthenaServicesConf
import AthenaOutputStreamTool
15 _trigNavThinningSvcs = {}
17 _trigNavThinningSvcs[streamName] = svc
21 eventInfoKey = "EventInfo", decisionFilter="",
22 trigNavThinningSvc = None ):
23 if trigNavThinningSvc
is None:
24 trigNavThinningSvc = _trigNavThinningSvcs.get (streamName,
None)
31 WritingTool = writingTool,
32 ItemList = [
"EventInfo#*" ]
34 outputStream.ExtraOutputs.add((
"DataHeader",
"StoreGateSvc+" + streamName))
36 outputStream.MetadataStore = svcMgr.MetaDataStore
37 outputStream.MetadataItemList = [
38 "EventStreamInfo#" + streamName,
39 "IOVMetaDataContainer#*",
43 from AthenaCommon.AlgSequence
import AlgSequence
45 from AthenaCommon.AlgSequence
import AthSequencer
52 outputStream.WritingTool.AttributeListKey=key
53 if (
'EventInfoTagBuilder/EventInfoTagBuilder' not in topSequence.getProperties()[
'Members']):
55 from .OutputStreamAthenaPoolConf
import EventInfoAttListTool, EventInfoTagBuilder
56 EventInfoTagBuilder =
EventInfoTagBuilder(AttributeList=key, EventInfoKey=eventInfoKey, FilterString=decisionFilter,
58 from AthenaCommon.GlobalFlags
import globalflags
59 if globalflags.InputFormat() ==
'bytestream':
61 EventInfoTagBuilder.PropagateInput=
False
62 topSequence += EventInfoTagBuilder
66 outSequence += outputStream
68 outSequence += outputStream
71 outputStream.OutputFile = fileName
72 from .OutputStreamAthenaPoolConf
import MakeEventStreamInfo
74 streamInfoTool.Key = streamName
75 streamInfoTool.EventInfoKey = eventInfoKey
78 event_format_key =
'EventFormat{}'.
format(streamName)
79 event_format_tool = CfgMgr.xAODMaker__EventFormatStreamHelperTool(
80 "{}_MakeEventFormat".
format(streamName),
83 outputStream.MetadataItemList += [
"xAOD::EventFormat#{}".
format(event_format_key)]
86 file_metadata_key =
"FileMetaData"
87 file_metadata_creator_tool = CfgMgr.xAODMaker__FileMetaDataCreatorTool(
88 "FileMetaDataCreatorTool",
89 OutputKey=file_metadata_key,
90 StreamName=streamName,
92 outputStream.MetadataItemList += [
93 "xAOD::FileMetaData#{}".
format(file_metadata_key),
94 "xAOD::FileMetaDataAuxInfo#{}Aux.".
format(file_metadata_key),
97 outputStream.HelperTools = [
100 file_metadata_creator_tool,
105 from AthenaServices.AthenaServicesConf
import Athena__ThinningCacheTool
106 tct = Athena__ThinningCacheTool (
'ThinningCacheTool_' + streamName,
107 StreamName = streamName)
108 if trigNavThinningSvc
is not None:
109 tct.TrigNavigationThinningSvc = trigNavThinningSvc
110 outputStream.HelperTools += [tct]
124 from RecExConfig.ObjKeyStore
import objKeyStore
125 for typ, klist
in objKeyStore[
'transient'].getProperties().
items():
127 tlist.append (typ +
'#' + k)
128 outputStream.TransientItems += tlist
135 from RegistrationServices.OutputConditionsAlg
import OutputConditionsAlg
138 outputFile = fileName,
141 return conditionStream
144 AthenaPoolOutputStream = createOutputStream
145 AthenaPoolOutputConditionStream = createOutputConditionStream