ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
ByteStreamOutputStreamCopyTool Class Reference

This is a tool that implements the IAthenaOutputStreamTool for copying ByteStream from input. More...

#include <ByteStreamOutputStreamCopyTool.h>

Inheritance diagram for ByteStreamOutputStreamCopyTool:
Collaboration diagram for ByteStreamOutputStreamCopyTool:

Public Member Functions

 ByteStreamOutputStreamCopyTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor. More...
 
virtual StatusCode initialize () override
 Initialize. More...
 
virtual StatusCode connectOutput (const std::string &outputName="") override
 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) override
 Commit the output stream after having streamed out objects Must commitOutput AFTER streaming. More...
 
virtual StatusCode finalizeOutput () override
 Finalize the output stream after the last commit, e.g. More...
 
virtual StatusCode connectServices (const std::string &dataStore, const std::string &cnvSvc, bool extendProvenenceRecord=false) override
 No need to connect Services. More...
 
virtual StatusCode streamObjects (const TypeKeyPairs &typeKeys, const std::string &outputName="") override
 No object written for this tool. More...
 
virtual StatusCode streamObjects (const DataObjectVec &dataObjects, const std::string &outputName="") override
 no stream of vector of objects either. More...
 
virtual StatusCode getInputItemList (SG::IFolder *m_p2BWrittenFromTool) override
 Get ItemList from the OutputStreamTool (e.g. all input objects) More...
 

Private Attributes

ServiceHandle< IByteStreamOutputSvcm_outputSvc
 Handle for BS output Svc. More...
 
ServiceHandle< IByteStreamInputSvcm_inputSvc
 Handle for BS input Svc. More...
 

Detailed Description

This is a tool that implements the IAthenaOutputStreamTool for copying ByteStream from input.

Definition at line 38 of file ByteStreamOutputStreamCopyTool.h.

Constructor & Destructor Documentation

◆ ByteStreamOutputStreamCopyTool()

ByteStreamOutputStreamCopyTool::ByteStreamOutputStreamCopyTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Constructor.

Definition at line 17 of file ByteStreamOutputStreamCopyTool.cxx.

21  : base_class(type, name, parent),
22  m_outputSvc("ByteStreamEventStorageOutputSvc", name),
23  m_inputSvc("ByteStreamEventStorageInputSvc", name)
24 {
25  // Declare IAthenaOutputStreamTool interface
26  declareInterface<IAthenaOutputStreamTool>(this);
27  declareProperty("ByteStreamOutputSvc", m_outputSvc);
28  declareProperty("ByteStreamInputSvc", m_inputSvc);
29 }

Member Function Documentation

◆ commitOutput()

StatusCode ByteStreamOutputStreamCopyTool::commitOutput ( bool  doCommit = false)
overridevirtual

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

Definition at line 56 of file ByteStreamOutputStreamCopyTool.cxx.

56  {
57 
58  ATH_MSG_DEBUG("In commitOutput");
59  const RawEvent* re = m_inputSvc->currentEvent() ;
60  if(!re){
61  ATH_MSG_ERROR(" failed to get the current event from ByteStreamInputSvc");
62  return StatusCode::FAILURE ;
63  }
64  if( ! m_outputSvc->putEvent(re) ) {
65  ATH_MSG_ERROR(" failed to write event to ByteStreamOutputSvc");
66  return StatusCode::FAILURE ;
67  }
68  ATH_MSG_DEBUG(" done in commitOutput");
69  return StatusCode::SUCCESS;
70 }

◆ connectOutput()

StatusCode ByteStreamOutputStreamCopyTool::connectOutput ( const std::string &  outputName = "")
overridevirtual

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

Do nothing for connectOutput

Definition at line 51 of file ByteStreamOutputStreamCopyTool.cxx.

51  {
53  return StatusCode::SUCCESS;
54 }

◆ connectServices()

StatusCode ByteStreamOutputStreamCopyTool::connectServices ( const std::string &  dataStore,
const std::string &  cnvSvc,
bool  extendProvenenceRecord = false 
)
overridevirtual

No need to connect Services.

Do nothing for connectServices

Definition at line 44 of file ByteStreamOutputStreamCopyTool.cxx.

46  {
48  return StatusCode::SUCCESS;
49 }

◆ finalizeOutput()

StatusCode ByteStreamOutputStreamCopyTool::finalizeOutput ( )
overridevirtual

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

in finalize

Definition at line 72 of file ByteStreamOutputStreamCopyTool.cxx.

72  {
73  return StatusCode::SUCCESS;
74 }

◆ getInputItemList()

StatusCode ByteStreamOutputStreamCopyTool::getInputItemList ( SG::IFolder m_p2BWrittenFromTool)
overridevirtual

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

Definition at line 92 of file ByteStreamOutputStreamCopyTool.cxx.

92  {
93  return StatusCode::SUCCESS;
94 }

◆ initialize()

StatusCode ByteStreamOutputStreamCopyTool::initialize ( )
overridevirtual

Initialize.

Definition at line 32 of file ByteStreamOutputStreamCopyTool.cxx.

32  {
33 
34  ATH_MSG_INFO("Initializing");
35 
36  // retrieve services
37  ATH_CHECK( m_inputSvc.retrieve() );
38  ATH_CHECK( m_outputSvc.retrieve() );
39 
40  return StatusCode::SUCCESS;
41 }

◆ streamObjects() [1/2]

StatusCode ByteStreamOutputStreamCopyTool::streamObjects ( const DataObjectVec &  dataObjects,
const std::string &  outputName = "" 
)
overridevirtual

no stream of vector of objects either.

Definition at line 84 of file ByteStreamOutputStreamCopyTool.cxx.

85  {
86  if (dataObjects.size() != 0){
87  ATH_MSG_WARNING("Streaming objects is not supported. The whole input event is written out");
88  }
89  return StatusCode::SUCCESS;
90 }

◆ streamObjects() [2/2]

StatusCode ByteStreamOutputStreamCopyTool::streamObjects ( const TypeKeyPairs &  typeKeys,
const std::string &  outputName = "" 
)
overridevirtual

No object written for this tool.

Definition at line 76 of file ByteStreamOutputStreamCopyTool.cxx.

77  {
78  if (typeKeys.size() != 0){
79  ATH_MSG_WARNING("Streaming objects is not supported. The whole input event is written out");
80  }
81  return StatusCode::SUCCESS;
82 }

Member Data Documentation

◆ m_inputSvc

ServiceHandle<IByteStreamInputSvc> ByteStreamOutputStreamCopyTool::m_inputSvc
private

Handle for BS input Svc.

Definition at line 79 of file ByteStreamOutputStreamCopyTool.h.

◆ m_outputSvc

ServiceHandle<IByteStreamOutputSvc> ByteStreamOutputStreamCopyTool::m_outputSvc
private

Handle for BS output Svc.

Definition at line 76 of file ByteStreamOutputStreamCopyTool.h.


The documentation for this class was generated from the following files:
ByteStreamOutputStreamCopyTool::m_outputSvc
ServiceHandle< IByteStreamOutputSvc > m_outputSvc
Handle for BS output Svc.
Definition: ByteStreamOutputStreamCopyTool.h:76
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
RawEvent
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Definition: RawEvent.h:37
ByteStreamOutputStreamCopyTool::m_inputSvc
ServiceHandle< IByteStreamInputSvc > m_inputSvc
Handle for BS input Svc.
Definition: ByteStreamOutputStreamCopyTool.h:79
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
re
const boost::regex re(r_e)