#include <RawDataOutputSvc.h>
Inheritance diagram for RawDataOutputSvc:
Public Member Functions | |
virtual StatusCode | finalize () |
virtual StatusCode | finalize () |
virtual StatusCode | initialize () |
virtual StatusCode | initialize () |
virtual bool | putEvent (WriteRawEvent *re) |
virtual bool | putEvent (WriteRawEvent *re) |
RawDataOutputSvc (const std::string &name, ISvcLocator *svcloc) | |
RawDataOutputSvc (const std::string &name, ISvcLocator *svcloc) | |
~RawDataOutputSvc (void) | |
~RawDataOutputSvc (void) | |
Private Attributes | |
uint32_t * | m_buffer |
uint32_t * | m_buffer |
RawFileWriter * | m_fw |
RawFileWriter * | m_fw |
std::string | m_outputFile |
|
00019 : IRawDataOutputSvc(name,svcloc), 00020 m_fw(0) 00021 { 00022 PropertyMgr m_propMgr; 00023 m_propMgr.declareProperty("OutputFile", m_outputFile = "offline.raw"); 00024 00025 IJobOptionsSvc* jobSvc; 00026 Gaudi::svcLocator()->service("JobOptionsSvc", jobSvc); 00027 jobSvc->setMyProperties(name, &m_propMgr); 00028 00029 m_buffer = new uint32_t[64*1024]; // 256k bytes 00030 }
|
|
00034 { 00035 MsgStream log(messageService(), name() ); 00036 log << MSG::DEBUG << "RawDataOutputSvc Destructor called " << endreq; 00037 00038 delete [] m_buffer; 00039 }
|
|
|
|
|
|
|
|
00043 { 00044 // clean up 00045 if ( m_fw ) { 00046 delete m_fw; 00047 m_fw = 0; 00048 } 00049 00050 return StatusCode::SUCCESS; 00051 }
|
|
Reimplemented from IRawDataOutputSvc. |
|
Reimplemented from IRawDataOutputSvc. 00055 { 00056 MsgStream log(messageService(), name() ); 00057 00058 // Open the first output file for writing. 00059 m_fw = new RawFileWriter(m_outputFile); 00060 00061 log << MSG::DEBUG << "Opened output File " << m_outputFile << endreq; 00062 00063 return StatusCode::SUCCESS; 00064 }
|
|
Implements IRawDataOutputSvc. |
|
Implements IRawDataOutputSvc. 00068 { 00069 MsgStream log(messageService(), name() ); 00070 00071 //uint32_t evt_size_w = re->size_word(); 00072 00073 const eformat::write::node_t* top = re->bind(); 00074 if (eformat::write::copy(*top, m_buffer, 64*1024) == 0) { 00075 log << MSG::ERROR << "failed to copy Event to the buffer !" << endreq; 00076 return false; 00077 } 00078 00079 try { 00080 RawEvent evt(m_buffer); 00081 evt.check_tree(); 00082 } 00083 catch (std::exception& ex) { 00084 std::cerr << "Uncaught std exception: " << ex.what() << std::endl; 00085 std::exit(1); 00086 } 00087 catch (...) { 00088 std::cerr << std::endl << "Uncaught unknown exception" << std::endl; 00089 std::exit(1); 00090 } 00091 00092 m_fw->writeEvent(m_buffer); 00093 00094 return true; 00095 }
|
|
|
|
|
|
|
|
|
|
|