4#include "GaudiKernel/MsgStream.h"
5#include "GaudiKernel/ISvcLocator.h"
6#include "GaudiKernel/PropertyMgr.h"
7#include "GaudiKernel/SmartDataPtr.h"
9#include "GaudiKernel/IDataProviderSvc.h"
10#include "GaudiKernel/IDataManagerSvc.h"
26 : Algorithm(name, pSvcLocator)
33 MsgStream log(
msgSvc(), name());
36 log << MSG::INFO <<
"in initialize()" << endreq;
38 return StatusCode::SUCCESS;
45 MsgStream log(
msgSvc(), name() );
47 log << MSG::INFO <<
"================================================" << endreq;
48 log << MSG::INFO <<
"In execute()" << endreq;
49 log << MSG::INFO <<
"++++++++++++++++++++++++++++++++++++++++++++++++" << endreq;
51 static int evtnum = 0;
52 static int runnum = 999;
57 event->setRunNumber(runnum);
59 IDataManagerSvc* evtmgr =
dynamic_cast<IDataManagerSvc*
>(eventSvc());
60 sc = evtmgr->setRoot(EventModel::EventHeader , event);
61 if( sc.isFailure() ) {
62 log << MSG::ERROR <<
"Unable to register /Event object" << endreq;
67 log << MSG::INFO <<
" DigiEvent clID :: " << digi->
clID() << endreq;
69 if( sc.isFailure() ) {
70 log << MSG::ERROR <<
"Unable to register /Event/Digi object" << endreq;
74 sc = writeMdcDigiData();
75 if( sc.isFailure() ) {
76 log << MSG::ERROR <<
"Unable to register /Event/Digi/MdcDigiCol object" << endreq;
80 sc = writeEmcDigiData();
81 if( sc.isFailure() ) {
82 log << MSG::ERROR <<
"Unable to register /Event/Digi/EmcDigiCol object" << endreq;
86 sc = writeTofDigiData();
87 if( sc.isFailure() ) {
88 log << MSG::ERROR <<
"Unable to register /Event/Digi/EmcDigiCol object" << endreq;
92 sc = writeMucDigiData();
93 if( sc.isFailure() ) {
94 log << MSG::ERROR <<
"Unable to register /Event/Digi/EmcDigiCol object" << endreq;
100 return StatusCode::SUCCESS;
103StatusCode WriteRawData::writeMdcDigiData()
107 for (
int i=0; i <
n; i++) {
114 mdcCol->push_back ( mdcDigi );
117 StatusCode sc = StatusCode::SUCCESS;
122StatusCode WriteRawData::writeEmcDigiData()
126 for (
int i=0; i <
n; i++) {
133 emcCol->push_back ( emcDigi );
136 StatusCode sc = StatusCode::SUCCESS;
141StatusCode WriteRawData::writeTofDigiData()
145 for (
int i=0; i <
n; i++) {
152 tofCol->push_back ( tofDigi );
155 StatusCode sc = StatusCode::SUCCESS;
160StatusCode WriteRawData::writeMucDigiData()
164 for (
int i=0; i <
n; i++) {
168 mucCol->push_back ( mucDigi );
171 StatusCode sc = StatusCode::SUCCESS;
181 MsgStream log(
msgSvc(), name());
183 log << MSG::INFO <<
"In finalize()" << endreq;
185 return StatusCode::SUCCESS;
ObjectVector< EmcDigi > EmcDigiCol
ObjectVector< MdcDigi > MdcDigiCol
ObjectVector< MucDigi > MucDigiCol
ObjectVector< TofDigi > TofDigiCol
virtual const CLID & clID() const
Retrieve reference to class definition structure.
void setMeasure(const unsigned int measure)
void setOverflow(const unsigned int overflow)
void setChargeChannel(const unsigned int chargeChannel)
void setTimeChannel(const unsigned int timeChannel)
void setOverflow(const unsigned int overflow)
WriteRawData(const std::string &name, ISvcLocator *pSvcLocator)
_EXTERN_ std::string Event
_EXTERN_ std::string MdcDigiCol
_EXTERN_ std::string MucDigiCol
_EXTERN_ std::string EmcDigiCol
_EXTERN_ std::string TofDigiCol