ATLAS Offline Software
Functions
python.xAODEventInfoCreator Namespace Reference

Functions

def xAODEventInfoCreator (sequence=None, stream=None, key="", outkey="EventInfo")
 Helper function for creating xAOD::EventInfo. More...
 

Function Documentation

◆ xAODEventInfoCreator()

def python.xAODEventInfoCreator.xAODEventInfoCreator (   sequence = None,
  stream = None,
  key = "",
  outkey = "EventInfo" 
)

Helper function for creating xAOD::EventInfo.

Helper function that schedules the algorithm for creating an xAOD::EventInfo
object out of the AOD's EventInfo one.

Arguments:
  sequence: Optional sequence to which the components should be added.
            If not specified, the main algorithm sequence is used.
  stream: Optional stream that the objects should be written to.
          If not specified, the objects are added to StreamXAOD.
  key: Optional StoreGate key for the AOD object that is supposed to be
       translated.

Definition at line 9 of file xAODEventInfoCreator.py.

9 def xAODEventInfoCreator( sequence = None, stream = None, key = "",
10  outkey = "EventInfo" ):
11  """
12  Helper function that schedules the algorithm for creating an xAOD::EventInfo
13  object out of the AOD's EventInfo one.
14 
15  Arguments:
16  sequence: Optional sequence to which the components should be added.
17  If not specified, the main algorithm sequence is used.
18  stream: Optional stream that the objects should be written to.
19  If not specified, the objects are added to StreamXAOD.
20  key: Optional StoreGate key for the AOD object that is supposed to be
21  translated.
22  """
23 
24  from AthenaCommon.Logging import logging
25  logger = logging.getLogger( "xAODEventInfoCreator" )
26 
27  # Tell the user what's happening:
28  logger.info( "Creating xAOD::EventInfo" )
29 
30  # Get the main sequence if necessary:
31  if sequence is None:
32  from AthenaCommon.AlgSequence import AlgSequence
33  sequence = AlgSequence()
34  pass
35 
36  # Access the stream if necessary:
37  if stream is None:
38  from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
39  stream = MSMgr.GetStream( "StreamXAOD" )
40  pass
41 
42  # Add the converter algorithm:
43  alg = xAODMaker__EventInfoCnvAlg()
44  alg.AODKey = key
45  alg.xAODKey = outkey
46  sequence += alg
47 
48  # Add the created objects to the output:
49  stream.AddItem( "xAOD::EventInfo#%s" % outkey )
50  stream.AddItem( "xAOD::EventAuxInfo#%sAux." % outkey )
51  stream.AddItem( "xAOD::EventInfoContainer#PileUp%s" % outkey )
52  stream.AddItem( "xAOD::EventInfoAuxContainer#PileUp%sAux." % outkey )
53 
54  return
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7
python.xAODEventInfoCreator.xAODEventInfoCreator
def xAODEventInfoCreator(sequence=None, stream=None, key="", outkey="EventInfo")
Helper function for creating xAOD::EventInfo.
Definition: xAODEventInfoCreator.py:9