ATLAS Offline Software
|
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>
Public Types | |
typedef std::pair< std::string, std::string > | TypeKeyPair |
Stream out objects. More... | |
typedef std::vector< TypeKeyPair > | TypeKeyPairs |
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... | |
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.
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.
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.
typedef std::vector< TypeKeyPair > IAthenaOutputStreamTool::TypeKeyPairs |
Definition at line 100 of file IAthenaOutputStreamTool.h.
|
pure virtual |
Commit the output stream after having streamed out objects Must commitOutput AFTER streaming.
|
pure virtual |
Connect to the output stream Must connectOutput BEFORE streaming Only specify "outputName" if one wants to override jobOptions.
|
pure virtual |
Specify which data store and conversion service to use and whether to extend provenence Only use if one wants to override jobOptions.
IAthenaOutputStreamTool::DeclareInterfaceID | ( | IAthenaOutputStreamTool | , |
1 | , | ||
0 | |||
) |
Declare interface ID.
|
pure virtual |
Finalize the output stream after the last commit, e.g.
in finalize
|
pure virtual |
Get ItemList from the OutputStreamTool (e.g. all input objects)
|
pure virtual |
|
pure virtual |