Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Functions | Variables
python.CreateOutputStreams Namespace Reference

Functions

def registerTrigNavThinningSvc (streamName, svc)
 
def createOutputStream (streamName, fileName="", asAlg=False, noTag=False, eventInfoKey="EventInfo", decisionFilter="", trigNavThinningSvc=None)
 
def createOutputConditionStream (streamName, fileName="")
 

Variables

dictionary _trigNavThinningSvcs = {}
 
def AthenaPoolOutputStream = createOutputStream
 backward compat More...
 
def AthenaPoolOutputConditionStream = createOutputConditionStream
 

Function Documentation

◆ createOutputConditionStream()

def python.CreateOutputStreams.createOutputConditionStream (   streamName,
  fileName = "" 
)

Definition at line 134 of file CreateOutputStreams.py.

134 def createOutputConditionStream( streamName, fileName = "" ):
135  from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg
136  conditionStream = OutputConditionsAlg(
137  streamName,
138  outputFile = fileName,
139  WriteIOV = False
140  )
141  return conditionStream
142 

◆ createOutputStream()

def python.CreateOutputStreams.createOutputStream (   streamName,
  fileName = "",
  asAlg = False,
  noTag = False,
  eventInfoKey = "EventInfo",
  decisionFilter = "",
  trigNavThinningSvc = None 
)

Definition at line 20 of file CreateOutputStreams.py.

20 def createOutputStream( streamName, fileName = "", asAlg = False, noTag = False,
21  eventInfoKey = "EventInfo", decisionFilter="",
22  trigNavThinningSvc = None ):
23  if trigNavThinningSvc is None:
24  trigNavThinningSvc = _trigNavThinningSvcs.get (streamName, None)
25 
26 
27  # define athena output stream
28  writingTool = AthenaOutputStreamTool( streamName + "Tool" )
29  outputStream = AthenaOutputStream(
30  streamName,
31  WritingTool = writingTool,
32  ItemList = [ "EventInfo#*" ]
33  )
34  outputStream.ExtraOutputs.add(("DataHeader", "StoreGateSvc+" + streamName))
35  #outputStream.ItemList += [ "xAOD::EventInfo#*" ]
36  outputStream.MetadataStore = svcMgr.MetaDataStore
37  outputStream.MetadataItemList = [
38  "EventStreamInfo#" + streamName,
39  "IOVMetaDataContainer#*",
40  ]
41 
42 
43  from AthenaCommon.AlgSequence import AlgSequence
44  topSequence = AlgSequence()
45  from AthenaCommon.AlgSequence import AthSequencer
46  outSequence = AthSequencer("AthOutSeq")
47 
48  doTag = not noTag
49  if doTag:
50  key = "SimpleTag"
51  # Tell tool to pick it up
52  outputStream.WritingTool.AttributeListKey=key
53  if ('EventInfoTagBuilder/EventInfoTagBuilder' not in topSequence.getProperties()['Members']):
54  # build eventinfo attribute list
55  from .OutputStreamAthenaPoolConf import EventInfoAttListTool, EventInfoTagBuilder
56  EventInfoTagBuilder = EventInfoTagBuilder(AttributeList=key, EventInfoKey=eventInfoKey, FilterString=decisionFilter,
57  Tool=EventInfoAttListTool())
58  from AthenaCommon.GlobalFlags import globalflags
59  if globalflags.InputFormat() == 'bytestream':
60  #No event-tag input in bytestream
61  EventInfoTagBuilder.PropagateInput=False
62  topSequence += EventInfoTagBuilder
63 
64  # decide where to put outputstream in sequencing
65  if asAlg:
66  outSequence += outputStream
67  else:
68  outSequence += outputStream
69 
70  if fileName != "":
71  outputStream.OutputFile = fileName
72  from .OutputStreamAthenaPoolConf import MakeEventStreamInfo
73  streamInfoTool = MakeEventStreamInfo( streamName + "_MakeEventStreamInfo" )
74  streamInfoTool.Key = streamName
75  streamInfoTool.EventInfoKey = eventInfoKey
76  # for xAOD access, add EventFormat to all POOL output streams
77  # Key to use for event format on this stream
78  event_format_key = 'EventFormat{}'.format(streamName)
79  event_format_tool = CfgMgr.xAODMaker__EventFormatStreamHelperTool(
80  "{}_MakeEventFormat".format(streamName),
81  Key=event_format_key,
82  )
83  outputStream.MetadataItemList += ["xAOD::EventFormat#{}".format(event_format_key)]
84 
85  # Create a new xAOD::FileMetaData object
86  file_metadata_key = "FileMetaData"
87  file_metadata_creator_tool = CfgMgr.xAODMaker__FileMetaDataCreatorTool(
88  "FileMetaDataCreatorTool",
89  OutputKey=file_metadata_key,
90  StreamName=streamName,
91  )
92  outputStream.MetadataItemList += [
93  "xAOD::FileMetaData#{}".format(file_metadata_key),
94  "xAOD::FileMetaDataAuxInfo#{}Aux.".format(file_metadata_key),
95  ]
96 
97  outputStream.HelperTools = [
98  streamInfoTool,
99  event_format_tool,
100  file_metadata_creator_tool,
101  ]
102 
103 
104  # Support for MT thinning.
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]
111 
112 
113  # Set the list of transient items based on what we know is in the transient
114  # store. The output algorithm will then declare input dependencies
115  # for objects which are both listed here and in the ItemList.
116  # (We do it like this because ItemList is typically configured to include
117  # everything which might possibly be output. If this gets cleaned up,
118  # then we can remove this.)
119  # Some builds don't include RecExConfig, so don't crash in that case.
120  # FIXME: Rather than using ObjKeyStore, we could scan all algorithms
121  # and look for write handles.
122  try:
123  tlist = []
124  from RecExConfig.ObjKeyStore import objKeyStore
125  for typ, klist in objKeyStore['transient'].getProperties().items():
126  for k in klist:
127  tlist.append (typ + '#' + k)
128  outputStream.TransientItems += tlist
129  except ImportError:
130  pass
131 
132  return outputStream
133 

◆ registerTrigNavThinningSvc()

def python.CreateOutputStreams.registerTrigNavThinningSvc (   streamName,
  svc 
)

Definition at line 16 of file CreateOutputStreams.py.

16 def registerTrigNavThinningSvc (streamName, svc):
17  _trigNavThinningSvcs[streamName] = svc
18  return
19 

Variable Documentation

◆ _trigNavThinningSvcs

dictionary python.CreateOutputStreams._trigNavThinningSvcs = {}
private

Definition at line 15 of file CreateOutputStreams.py.

◆ AthenaPoolOutputConditionStream

def python.CreateOutputStreams.AthenaPoolOutputConditionStream = createOutputConditionStream

Definition at line 145 of file CreateOutputStreams.py.

◆ AthenaPoolOutputStream

def python.CreateOutputStreams.AthenaPoolOutputStream = createOutputStream

backward compat

Definition at line 144 of file CreateOutputStreams.py.

AthSequencer
ClassName: AthSequencer.
Definition: AthSequencer.h:40
vtune_athena.format
format
Definition: vtune_athena.py:14
EventInfoAttListTool
Definition: EventInfoAttListTool.h:27
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7
python.CreateOutputStreams.registerTrigNavThinningSvc
def registerTrigNavThinningSvc(streamName, svc)
Definition: CreateOutputStreams.py:16
python.CreateOutputStreams.createOutputConditionStream
def createOutputConditionStream(streamName, fileName="")
Definition: CreateOutputStreams.py:134
python.CreateOutputStreams.createOutputStream
def createOutputStream(streamName, fileName="", asAlg=False, noTag=False, eventInfoKey="EventInfo", decisionFilter="", trigNavThinningSvc=None)
Definition: CreateOutputStreams.py:20
EventInfoTagBuilder
Definition: EventInfoTagBuilder.h:39
OutputConditionsAlg
Definition: OutputConditionsAlg.h:24
MakeEventStreamInfo
This class provides an algorithm to make the EventStreamInfo object and update it.
Definition: MakeEventStreamInfo.h:27
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:71
AthenaOutputStream
algorithm that marks for write data objects in SG
Definition: AthenaOutputStream.h:55
AthenaOutputStreamTool
This is the implementation of IAthenaOutputStreamTool.
Definition: AthenaOutputStreamTool.h:33