Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RawDataOutputSvc Class Reference

#include <RawDataOutputSvc.h>

Inheritance diagram for RawDataOutputSvc:

IRawDataOutputSvc IRawDataOutputSvc List of all members.

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
RawFileWriterm_fw
RawFileWriterm_fw
std::string m_outputFile

Constructor & Destructor Documentation

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

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 }

RawDataOutputSvc::~RawDataOutputSvc void   ) 
 

00034 {
00035   MsgStream log(messageService(), name() );
00036   log << MSG::DEBUG << "RawDataOutputSvc Destructor called " << endreq;
00037 
00038   delete [] m_buffer;
00039 }

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

RawDataOutputSvc::~RawDataOutputSvc void   ) 
 


Member Function Documentation

virtual StatusCode RawDataOutputSvc::finalize  )  [virtual]
 

StatusCode RawDataOutputSvc::finalize  )  [virtual]
 

00043 {
00044    // clean up
00045    if ( m_fw ) {
00046       delete m_fw;
00047       m_fw = 0;
00048    }
00049  
00050    return StatusCode::SUCCESS;
00051 }

virtual StatusCode RawDataOutputSvc::initialize  )  [virtual]
 

Reimplemented from IRawDataOutputSvc.

StatusCode RawDataOutputSvc::initialize  )  [virtual]
 

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 }

virtual bool RawDataOutputSvc::putEvent WriteRawEvent re  )  [virtual]
 

Implements IRawDataOutputSvc.

bool RawDataOutputSvc::putEvent WriteRawEvent re  )  [virtual]
 

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 }


Member Data Documentation

uint32_t* RawDataOutputSvc::m_buffer [private]
 

uint32_t* RawDataOutputSvc::m_buffer [private]
 

RawFileWriter* RawDataOutputSvc::m_fw [private]
 

RawFileWriter* RawDataOutputSvc::m_fw [private]
 

std::string RawDataOutputSvc::m_outputFile [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:42:50 2011 for BOSS6.5.5 by  doxygen 1.3.9.1