4#include "GaudiKernel/MsgStream.h"
5#include "GaudiKernel/ISvcLocator.h"
6#include "GaudiKernel/PropertyMgr.h"
7#include "GaudiKernel/SmartDataPtr.h"
8#include "RawDataCnv/EventManagement/RAWEVENT.h"
9#include "GaudiKernel/IDataProviderSvc.h"
10#include "GaudiKernel/IDataManagerSvc.h"
13#include "EventModel/Event.h"
14#include "RawEvent/DigiEvent.h"
15#include "MdcRawEvent/MdcDigi.h"
16#include "EmcRawEvent/EmcDigi.h"
17#include "TofRawEvent/TofDigi.h"
18#include "MucRawEvent/MucDigi.h"
20#include "EventModel/EventModel.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 SmartDataPtr<Event::EventHeader> evt(eventSvc(), EventModel::EventHeader);
53 log << MSG::ERROR <<
"Did not retrieve event" << endreq;
54 return StatusCode::FAILURE;
58 int eventNo = evt->eventNumber();
59 int runNo = evt->runNumber();
61 log << MSG::INFO <<
"ReadRawData: retrieved event: " <<
eventNo <<
" run: " <<
runNo << endreq;
63 log << MSG::INFO <<
"ReadRawData: start to read MdcDigiData" << endreq;
64 sc = readMdcDigiData();
66 log << MSG::INFO <<
"ReadRawData: start to read EmcDigiData" << endreq;
67 sc = readEmcDigiData();
69 log << MSG::INFO <<
"ReadRawData: start to read TofDigiData" << endreq;
70 sc = readTofDigiData();
72 log << MSG::INFO <<
"ReadRawData: start to read MucDigiData" << endreq;
73 sc = readMucDigiData();
81 return StatusCode::SUCCESS;
84StatusCode ReadRawData::readMdcDigiData() {
85 MsgStream log(
msgSvc(), name());
86 StatusCode sc = StatusCode::SUCCESS;
90 log << MSG::ERROR <<
"Did not retrieve DigiEvent" << endreq;
91 return StatusCode::FAILURE;
97 log <<
"no MdcDigiCol found" << endreq;
100 log <<
"Event No. " << m_count <<
" ---> " << digiCol->size() <<
" Mdc digis found " << endreq;
102 log << MSG::INFO <<
"Detailed dump of this event: " << endreq;
104 MdcDigiCol::const_iterator pMdcDigi = digiCol->begin();
105 for ( ; pMdcDigi!= digiCol->end(); pMdcDigi++) {
106 log << MSG::INFO <<
"Digi " << ndigi++ <<
" ";
109 (**pMdcDigi).fillStream(log.stream());
115 return StatusCode::SUCCESS;
118StatusCode ReadRawData::readEmcDigiData() {
119 MsgStream log(
msgSvc(), name());
120 StatusCode sc = StatusCode::SUCCESS;
127 log <<
"no EmcDigiCol found" << endreq;
130 log <<
"Event No. " << m_count <<
" ---> " << digiCol->size() <<
" Emc digis found " << endreq;
131 log << MSG::INFO <<
"Detailed dump of this event: " << endreq;
133 EmcDigiCol::const_iterator pEmcDigi = digiCol->begin();
134 for ( ; pEmcDigi != digiCol->end(); pEmcDigi++) {
135 log <<MSG::INFO <<
"Digi " << ndigi++ <<
" ";
136 (**pEmcDigi).fillStream(log.stream());
142 return StatusCode::SUCCESS;
145StatusCode ReadRawData::readTofDigiData() {
146 MsgStream log(
msgSvc(), name());
147 StatusCode sc = StatusCode::SUCCESS;
152 log <<
"no TofDigiCol found" << endreq;
155 log <<
"Event No. " << m_count <<
" ---> " << digiCol->size() <<
" Tof digis found " << endreq;
156 log << MSG::INFO <<
"Detailed dump of this event: " << endreq;
158 TofDigiCol::const_iterator pTofDigi = digiCol->begin();
159 for ( ; pTofDigi!= digiCol->end(); pTofDigi++) {
160 log <<MSG::INFO <<
"Digi " << ndigi++ <<
" ";
161 (**pTofDigi).fillStream(log.stream());
167 return StatusCode::SUCCESS;
170StatusCode ReadRawData::readMucDigiData() {
171 MsgStream log(
msgSvc(), name());
172 StatusCode sc = StatusCode::SUCCESS;
177 log <<
"no MucDigiCol found" << endreq;
180 log <<
"Event No. " << m_count <<
" ---> " << digiCol->size() <<
" Muc digis found " << endreq;
181 log << MSG::INFO <<
"Detailed dump of this event: " << endreq;
183 MucDigiCol::const_iterator pMucDigi = digiCol->begin();
184 for ( ; pMucDigi!= digiCol->end(); pMucDigi++) {
185 log <<MSG::INFO <<
"Digi " << ndigi++ <<
" ";
186 (**pMucDigi).fillStream(log.stream());
192 return StatusCode::SUCCESS;
200 MsgStream log(
msgSvc(), name());
202 log << MSG::INFO <<
"In finalize()" << endreq;
204 return StatusCode::SUCCESS;
ReadRawData(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