ATLAS Offline Software
Public Types | Public Member Functions | Static 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

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...
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Gaudi boilerplate. 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 69 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 107 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 98 of file IAthenaOutputStreamTool.h.

◆ TypeKeyPairs

Definition at line 99 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.

Implemented in ByteStreamOutputStreamCopyTool, ByteStreamMultipleOutputStreamCopyTool, AthenaOutputStreamTool, and Athena::RootOutputStreamTool.

◆ 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.

Implemented in ByteStreamOutputStreamCopyTool, ByteStreamMultipleOutputStreamCopyTool, AthenaOutputStreamTool, and Athena::RootOutputStreamTool.

◆ 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.

Implemented in ByteStreamOutputStreamCopyTool, ByteStreamMultipleOutputStreamCopyTool, Athena::RootOutputStreamTool, and AthenaOutputStreamTool.

◆ finalizeOutput()

virtual StatusCode IAthenaOutputStreamTool::finalizeOutput ( )
pure virtual

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

in finalize

Implemented in ByteStreamOutputStreamCopyTool, ByteStreamMultipleOutputStreamCopyTool, AthenaOutputStreamTool, and Athena::RootOutputStreamTool.

◆ getInputItemList()

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

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

Implemented in ByteStreamOutputStreamCopyTool, ByteStreamMultipleOutputStreamCopyTool, AthenaOutputStreamTool, and Athena::RootOutputStreamTool.

◆ interfaceID()

const InterfaceID & IAthenaOutputStreamTool::interfaceID ( )
inlinestatic

Gaudi boilerplate.

Definition at line 119 of file IAthenaOutputStreamTool.h.

119  {
120  static const InterfaceID IID("IAthenaOutputStreamTool", 1, 0);
121  return IID;
122 }

◆ 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: