ATLAS Offline Software
ByteStreamOutputStreamCopyTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
11 
12 
13 //__________________________________________________________________________
15 
16  ATH_MSG_INFO("Initializing");
17 
18  // retrieve services
19  ATH_CHECK( m_inputSvc.retrieve() );
20  ATH_CHECK( m_outputSvc.retrieve() );
21 
22  return StatusCode::SUCCESS;
23 }
24 
25 //__________________________________________________________________________
27  const std::string& /*cnvSvc*/,
28  bool /*extendProvenenceRecord*/) {
30  return StatusCode::SUCCESS;
31 }
32 //__________________________________________________________________________
33 StatusCode ByteStreamOutputStreamCopyTool::connectOutput(const std::string& /*outputName*/) {
35  return StatusCode::SUCCESS;
36 }
37 //__________________________________________________________________________
39 
40  ATH_MSG_DEBUG("In commitOutput");
41  const RawEvent* re = m_inputSvc->currentEvent() ;
42  if(!re){
43  ATH_MSG_ERROR(" failed to get the current event from ByteStreamInputSvc");
44  return StatusCode::FAILURE ;
45  }
46  if( ! m_outputSvc->putEvent(re) ) {
47  ATH_MSG_ERROR(" failed to write event to ByteStreamOutputSvc");
48  return StatusCode::FAILURE ;
49  }
50  ATH_MSG_DEBUG(" done in commitOutput");
51  return StatusCode::SUCCESS;
52 }
53 //__________________________________________________________________________
55  return StatusCode::SUCCESS;
56 }
57 //__________________________________________________________________________
58 StatusCode ByteStreamOutputStreamCopyTool::streamObjects(const TypeKeyPairs& typeKeys, const std::string&
59  /*outputName*/) {
60  if (typeKeys.size() != 0){
61  ATH_MSG_WARNING("Streaming objects is not supported. The whole input event is written out");
62  }
63  return StatusCode::SUCCESS;
64 }
65 //__________________________________________________________________________
66 StatusCode ByteStreamOutputStreamCopyTool::streamObjects(const DataObjectVec& dataObjects, const std::string&
67  /*outputName*/) {
68  if (dataObjects.size() != 0){
69  ATH_MSG_WARNING("Streaming objects is not supported. The whole input event is written out");
70  }
71  return StatusCode::SUCCESS;
72 }
73 //__________________________________________________________________________
75  return StatusCode::SUCCESS;
76 }
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.h
Implementation of IAthenaOutputStreamTool for Copying ByteStream from input.
SG::IFolder
a run-time configurable list of data objects
Definition: SGIFolder.h:21
ByteStreamOutputStreamCopyTool::connectOutput
virtual StatusCode connectOutput(const std::string &outputName="") override
Connect to the output stream Must connectOutput BEFORE streaming Only specify "outputName" if one wan...
Definition: ByteStreamOutputStreamCopyTool.cxx:33
ByteStreamOutputStreamCopyTool::initialize
virtual StatusCode initialize() override
Initialize.
Definition: ByteStreamOutputStreamCopyTool.cxx:14
ByteStreamOutputStreamCopyTool::m_inputSvc
ServiceHandle< IByteStreamInputSvc > m_inputSvc
Handle for BS input Svc.
Definition: ByteStreamOutputStreamCopyTool.h:79
ByteStreamOutputStreamCopyTool::finalizeOutput
virtual StatusCode finalizeOutput() override
Finalize the output stream after the last commit, e.g.
Definition: ByteStreamOutputStreamCopyTool.cxx:54
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ByteStreamOutputStreamCopyTool::commitOutput
virtual StatusCode commitOutput(bool doCommit=false) override
Commit the output stream after having streamed out objects Must commitOutput AFTER streaming.
Definition: ByteStreamOutputStreamCopyTool.cxx:38
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ByteStreamOutputStreamCopyTool::getInputItemList
virtual StatusCode getInputItemList(SG::IFolder *m_p2BWrittenFromTool) override
Get ItemList from the OutputStreamTool (e.g. all input objects)
Definition: ByteStreamOutputStreamCopyTool.cxx:74
ByteStreamOutputStreamCopyTool::connectServices
virtual StatusCode connectServices(const std::string &dataStore, const std::string &cnvSvc, bool extendProvenenceRecord=false) override
No need to connect Services.
Definition: ByteStreamOutputStreamCopyTool.cxx:26
ByteStreamOutputStreamCopyTool::streamObjects
virtual StatusCode streamObjects(const TypeKeyPairs &typeKeys, const std::string &outputName="") override
No object written for this tool.
Definition: ByteStreamOutputStreamCopyTool.cxx:58
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
re
const boost::regex re(r_e)