#include <RawDataOutputSvc.h>
Definition at line 10 of file RawDataOutputSvc.h.
◆ RawDataOutputSvc()
| RawDataOutputSvc::RawDataOutputSvc |
( |
const std::string & | name, |
|
|
ISvcLocator * | svcloc ) |
Definition at line 19 of file RawDataOutputSvc.cxx.
20 : base_class( name, svcloc ), m_fw( 0 ) {
21
22 declareProperty( "OutputFile", m_outputFile = "offline.raw" );
23
24 m_buffer = new uint32_t[64 * 1024];
25}
Referenced by RawDataOutputSvc().
◆ ~RawDataOutputSvc()
| RawDataOutputSvc::~RawDataOutputSvc |
( |
| ) |
|
Definition at line 28 of file RawDataOutputSvc.cxx.
28 {
29 MsgStream log(
msgSvc(), name() );
30 log << MSG::DEBUG << "RawDataOutputSvc Destructor called " << endmsg;
31
32 delete[] m_buffer;
33}
◆ finalize()
| StatusCode RawDataOutputSvc::finalize |
( |
| ) |
|
Definition at line 35 of file RawDataOutputSvc.cxx.
35 {
36
37 if ( m_fw )
38 {
39 delete m_fw;
40 m_fw = nullptr;
41 }
42
43 return StatusCode::SUCCESS;
44}
◆ initialize()
| StatusCode RawDataOutputSvc::initialize |
( |
| ) |
|
Definition at line 47 of file RawDataOutputSvc.cxx.
47 {
48
49 auto sc = Service::initialize();
50 if ( sc.isFailure() )
51 {
52 error() <<
"Failed to initialize Service" << endmsg;
53 return sc;
54 }
55
56 m_fw = new RawFileWriter( m_outputFile );
57
58 debug() << "Opened output File " << m_outputFile << endmsg;
59
60 return StatusCode::SUCCESS;
61}
◆ putEvent()
Definition at line 64 of file RawDataOutputSvc.cxx.
64 {
65 MsgStream log(
msgSvc(), name() );
66
67
68
71 {
72 log << MSG::ERROR << "failed to copy Event to the buffer !" << endmsg;
73 return false;
74 }
75
76 try
77 {
79 evt.check_tree();
80 } catch ( std::exception& ex )
81 {
82 std::cerr << "Uncaught std exception: " << ex.what() << std::endl;
83 std::exit( 1 );
84 } catch ( ... )
85 {
86 std::cerr << std::endl << "Uncaught unknown exception" << std::endl;
87 std::exit( 1 );
88 }
89
90 m_fw->writeEvent( m_buffer );
91
92 return true;
93}
eformat::FullEventFragment< const uint32_t * > RawEvent
The documentation for this class was generated from the following files: