BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataOutputSvc Class Reference

#include <RawDataOutputSvc.h>

+ Inheritance diagram for RawDataOutputSvc:

Public Member Functions

 RawDataOutputSvc (const std::string &name, ISvcLocator *svcloc)
 
 ~RawDataOutputSvc (void)
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
virtual bool putEvent (WriteRawEvent *re)
 
 RawDataOutputSvc (const std::string &name, ISvcLocator *svcloc)
 
 ~RawDataOutputSvc (void)
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
virtual bool putEvent (WriteRawEvent *re)
 
- Public Member Functions inherited from IRawDataOutputSvc
 IRawDataOutputSvc (const std::string &name, ISvcLocator *svcloc)
 
virtual ~IRawDataOutputSvc (void)
 
virtual StatusCode initialize ()
 
virtual bool putEvent (WriteRawEvent *re)=0
 
 IRawDataOutputSvc (const std::string &name, ISvcLocator *svcloc)
 
virtual ~IRawDataOutputSvc (void)
 
virtual StatusCode initialize ()
 
virtual bool putEvent (WriteRawEvent *re)=0
 

Detailed Description

Constructor & Destructor Documentation

◆ RawDataOutputSvc() [1/2]

RawDataOutputSvc::RawDataOutputSvc ( const std::string &  name,
ISvcLocator *  svcloc 
)

Definition at line 18 of file RawDataOutputSvc.cxx.

19 : IRawDataOutputSvc(name,svcloc),
20 m_fw(0)
21{
22 PropertyMgr m_propMgr;
23 m_propMgr.declareProperty("OutputFile", m_outputFile = "offline.raw");
24
25 IJobOptionsSvc* jobSvc;
26 Gaudi::svcLocator()->service("JobOptionsSvc", jobSvc);
27 jobSvc->setMyProperties(name, &m_propMgr);
28
29 m_buffer = new uint32_t[64*1024]; // 256k bytes
30}
The event conversion service needs an additional interface used by the converters to declare their ob...

◆ ~RawDataOutputSvc() [1/2]

RawDataOutputSvc::~RawDataOutputSvc ( void  )

Definition at line 33 of file RawDataOutputSvc.cxx.

34{
35 MsgStream log(messageService(), name() );
36 log << MSG::DEBUG << "RawDataOutputSvc Destructor called " << endreq;
37
38 delete [] m_buffer;
39}

◆ RawDataOutputSvc() [2/2]

RawDataOutputSvc::RawDataOutputSvc ( const std::string &  name,
ISvcLocator *  svcloc 
)

◆ ~RawDataOutputSvc() [2/2]

RawDataOutputSvc::~RawDataOutputSvc ( void  )

Member Function Documentation

◆ finalize() [1/2]

StatusCode RawDataOutputSvc::finalize ( )
virtual

Definition at line 42 of file RawDataOutputSvc.cxx.

43{
44 // clean up
45 if ( m_fw ) {
46 delete m_fw;
47 m_fw = 0;
48 }
49
50 return StatusCode::SUCCESS;
51}

◆ finalize() [2/2]

virtual StatusCode RawDataOutputSvc::finalize ( )
virtual

◆ initialize() [1/2]

StatusCode RawDataOutputSvc::initialize ( )
virtual

Reimplemented from IRawDataOutputSvc.

Definition at line 54 of file RawDataOutputSvc.cxx.

55{
56 MsgStream log(messageService(), name() );
57
58 // Open the first output file for writing.
59 m_fw = new RawFileWriter(m_outputFile);
60
61 log << MSG::DEBUG << "Opened output File " << m_outputFile << endreq;
62
63 return StatusCode::SUCCESS;
64}

◆ initialize() [2/2]

virtual StatusCode RawDataOutputSvc::initialize ( )
virtual

Reimplemented from IRawDataOutputSvc.

◆ putEvent() [1/2]

bool RawDataOutputSvc::putEvent ( WriteRawEvent re)
virtual

Implements IRawDataOutputSvc.

Definition at line 67 of file RawDataOutputSvc.cxx.

68{
69 MsgStream log(messageService(), name() );
70
71 //uint32_t evt_size_w = re->size_word();
72
73 const eformat::write::node_t* top = re->bind();
74 if (eformat::write::copy(*top, m_buffer, 64*1024) == 0) {
75 log << MSG::ERROR << "failed to copy Event to the buffer !" << endreq;
76 return false;
77 }
78
79 try {
80 RawEvent evt(m_buffer);
81 evt.check_tree();
82 }
83 catch (std::exception& ex) {
84 std::cerr << "Uncaught std exception: " << ex.what() << std::endl;
85 std::exit(1);
86 }
87 catch (...) {
88 std::cerr << std::endl << "Uncaught unknown exception" << std::endl;
89 std::exit(1);
90 }
91
92 m_fw->writeEvent(m_buffer);
93
94 return true;
95}
int writeEvent(const uint32_t *pevt)
const eformat::write::node_t * bind(void)
uint32_t copy(const node_t &list, uint32_t *dest, size_t max)
Definition: node.cxx:64

◆ putEvent() [2/2]

virtual bool RawDataOutputSvc::putEvent ( WriteRawEvent re)
virtual

Implements IRawDataOutputSvc.


The documentation for this class was generated from the following files: