ATLAS Offline Software
Public Types | Public Member Functions | List of all members
IAthenaOutputStreamTool Class Referenceabstract

This is a tool that allows streaming out of DataObjects. This has been factorized out from AthenaOutputStream to allow output streaming to occur from anywhere, for example from the finalized method of an algorithm. More...

#include <IAthenaOutputStreamTool.h>

Inheritance diagram for IAthenaOutputStreamTool:
Collaboration diagram for IAthenaOutputStreamTool:

Public Types

typedef std::pair< std::string, std::string > TypeKeyPair
 Stream out objects. More...
 
typedef std::vector< TypeKeyPairTypeKeyPairs
 
typedef std::vector< DataObject * > DataObjectVec
 Stream out a vector of objects Must convert to DataObject, e.g. More...
 

Public Member Functions

 DeclareInterfaceID (IAthenaOutputStreamTool, 1, 0)
 Declare interface ID. More...
 
virtual StatusCode connectServices (const std::string &dataStore, const std::string &cnvSvc, bool extendProvenenceRecord=false)=0
 Specify which data store and conversion service to use and whether to extend provenence Only use if one wants to override jobOptions. More...
 
virtual StatusCode connectOutput (const std::string &outputName="")=0
 Connect to the output stream Must connectOutput BEFORE streaming Only specify "outputName" if one wants to override jobOptions. More...
 
virtual StatusCode commitOutput (bool doCommit=false)=0
 Commit the output stream after having streamed out objects Must commitOutput AFTER streaming. More...
 
virtual StatusCode finalizeOutput ()=0
 Finalize the output stream after the last commit, e.g. More...
 
virtual StatusCode streamObjects (const TypeKeyPairs &typeKeys, const std::string &outputName="")=0
 
virtual StatusCode streamObjects (const DataObjectVec &dataObjects, const std::string &outputName="")=0
 
virtual StatusCode getInputItemList (SG::IFolder *m_p2BWrittenFromTool)=0
 Get ItemList from the OutputStreamTool (e.g. all input objects) More...
 

Detailed Description

This is a tool that allows streaming out of DataObjects. This has been factorized out from AthenaOutputStream to allow output streaming to occur from anywhere, for example from the finalized method of an algorithm.

How to use the IAthenaOutputStreamTool:

An initial setup of services should be done either via the interface with connectServices or via jobOptions. Note that the defaults are set to Conditions data writing, since event data writing is normally done with AthenaOutputStream.:

To write to a POOL/ROOT file one simply needs:

ToolSvc = Service( "ToolSvc" ) ToolSvc.CondStream1.OutputFile = "SimplePoolFile.root"

where one retrieves the AthenaOutputStreamTool with name CondStream1. The default job opts are:

ConversionSvc = "AthenaPoolCnvSvc" StoreName = "DetectorStore"

After initialization of services, one writes out with a sequence of:

connectOutput() streamObjects(<list of objects>) commitOutput()

where

be a vector of type/key pairs, or a vector of DataObjects.

Definition at line 68 of file IAthenaOutputStreamTool.h.

Member Typedef Documentation

◆ DataObjectVec

typedef std::vector< DataObject* > IAthenaOutputStreamTool::DataObjectVec

Stream out a vector of objects Must convert to DataObject, e.g.


#include "AthenaKernel/StorableConversions.h" T* obj = xxx; DataObject* dataObject = SG::asStorable(obj);

Definition at line 108 of file IAthenaOutputStreamTool.h.

◆ TypeKeyPair

typedef std::pair<std::string, std::string> IAthenaOutputStreamTool::TypeKeyPair

Stream out objects.

Provide vector of typeName/key pairs. If key is empty, assumes only one object and this will fail if there is more than one

Definition at line 99 of file IAthenaOutputStreamTool.h.

◆ TypeKeyPairs

Definition at line 100 of file IAthenaOutputStreamTool.h.

Member Function Documentation

◆ commitOutput()

virtual StatusCode IAthenaOutputStreamTool::commitOutput ( bool  doCommit = false)
pure virtual

Commit the output stream after having streamed out objects Must commitOutput AFTER streaming.

◆ connectOutput()

virtual StatusCode IAthenaOutputStreamTool::connectOutput ( const std::string &  outputName = "")
pure virtual

Connect to the output stream Must connectOutput BEFORE streaming Only specify "outputName" if one wants to override jobOptions.

◆ connectServices()

virtual StatusCode IAthenaOutputStreamTool::connectServices ( const std::string &  dataStore,
const std::string &  cnvSvc,
bool  extendProvenenceRecord = false 
)
pure virtual

Specify which data store and conversion service to use and whether to extend provenence Only use if one wants to override jobOptions.

◆ DeclareInterfaceID()

IAthenaOutputStreamTool::DeclareInterfaceID ( IAthenaOutputStreamTool  ,
,
 
)

Declare interface ID.

◆ finalizeOutput()

virtual StatusCode IAthenaOutputStreamTool::finalizeOutput ( )
pure virtual

Finalize the output stream after the last commit, e.g.

in finalize

◆ getInputItemList()

virtual StatusCode IAthenaOutputStreamTool::getInputItemList ( SG::IFolder m_p2BWrittenFromTool)
pure virtual

Get ItemList from the OutputStreamTool (e.g. all input objects)

◆ streamObjects() [1/2]

virtual StatusCode IAthenaOutputStreamTool::streamObjects ( const DataObjectVec dataObjects,
const std::string &  outputName = "" 
)
pure virtual

◆ streamObjects() [2/2]

virtual StatusCode IAthenaOutputStreamTool::streamObjects ( const TypeKeyPairs typeKeys,
const std::string &  outputName = "" 
)
pure virtual

The documentation for this class was generated from the following file: