1#include "RawEventReader/RawEventReader.h"
3#include "GaudiKernel/MsgStream.h"
4#include "GaudiKernel/AlgFactory.h"
5#include "GaudiKernel/Bootstrap.h"
6#include "GaudiKernel/ISvcLocator.h"
7#include "GaudiKernel/SmartDataPtr.h"
8#include "GaudiKernel/IDataProviderSvc.h"
9#include "GaudiKernel/PropertyMgr.h"
11#include "RawDataCnv/EventManagement/RAWEVENT.h"
12#include "RawDataCnv/Util/MdcConverter.h"
13#include "RawDataCnv/Util/TofConverter.h"
14#include "RawDataCnv/Util/EmcConverter.h"
15#include "RawDataCnv/Util/MucConverter.h"
16#include "Identifier/Identifier.h"
17#include "Identifier/MdcID.h"
18#include "Identifier/TofID.h"
19#include "Identifier/EmcID.h"
20#include "Identifier/MucID.h"
21#include "IRawFile/RawFileExceptions.h"
23#include "RawFile/RawFileReader.h"
24#include "RawEvent/DigiEvent.h"
26#include "EventModel/EventModel.h"
27#include "EventModel/EventHeader.h"
32 Algorithm(name, pSvcLocator)
39 declareProperty(
"MdcDigi",m_mdcdigi=1);
40 declareProperty(
"TofDigi",m_tofdigi=1);
41 declareProperty(
"EmcDigi",m_emcdigi=1);
42 declareProperty(
"MucDigi",m_mucdigi=1);
43 declareProperty(
"InputFiles",m_inputFiles);
58 MsgStream log(
msgSvc(), name());
59 log << MSG::INFO <<
"in initialize()" << endreq;
63 m_mdcCnv->
init(0, 999999);
65 ISvcLocator* svcLocator = Gaudi::svcLocator();
66 StatusCode sc=svcLocator->service(
"EventDataSvc", m_evtSvc);
68 std::cout<<
"Could not accesss EventDataSvc!"<<std::endl;
70 return StatusCode::SUCCESS;
76 MsgStream log(
msgSvc(), name());
77 log << MSG::INFO <<
"in execute()" << endreq;
80 StatusCode sc = m_evtSvc->registerObject(
"/Event/Digi",aDigiEvent);
81 if(sc!=StatusCode::SUCCESS) {
82 std::cout<<
"Could not register DigiEvent" <<std::endl;
93 m_mdcCnv->
convert(mdcBuf, mdcDigiCol);
101 StatusCode scMdc = m_evtSvc->registerObject(
"/Event/Digi/MdcDigiCol", mdcDigiCol);
102 if( scMdc!=StatusCode::SUCCESS ) {
103 std::cout<<
"Could not register MDC digi collection" <<std::endl;
113 m_tofCnv->
convert(tofBuf, tofDigiCol);
129 StatusCode scTof = m_evtSvc->registerObject(
"/Event/Digi/TofDigiCol", tofDigiCol);
130 if( scTof!=StatusCode::SUCCESS ) {
131 std::cout<<
"Could not register TOF digi collection" <<std::endl;
140 m_emcCnv->
convert(emcBuf, emcDigiCol);
142 StatusCode scEmc = m_evtSvc->registerObject(
"/Event/Digi/EmcDigiCol", emcDigiCol);
143 if( scEmc!=StatusCode::SUCCESS ) {
144 std::cout<<
"Could not register EMC digi collection" <<std::endl;
153 m_mucCnv->
convert(mucBuf, mucDigiCol);
155 StatusCode scMuc = m_evtSvc->registerObject(
"/Event/Digi/MucDigiCol", mucDigiCol);
156 if( scMuc!=StatusCode::SUCCESS ) {
157 std::cout<<
"Could not register MUC digi collection" <<std::endl;
161 m_raw_event->
reset();
163 return StatusCode::SUCCESS;
169 const uint32_t* fragment;
178 std::cerr << std::endl <<
"Uncaught unknown exception" << std::endl;
184 for (
int robi = 0; robi < nrobs; robi++) {
187 uint32_t* dataptr = NULL;
190 source_id_number <<= 8;
191 source_id_number >>= 24;
192 switch(source_id_number) {
207 return StatusCode::SUCCESS;
212 MsgStream log(
msgSvc(), name());
213 log << MSG::INFO <<
"in finalize()" << endreq;
219 return StatusCode::SUCCESS;
ObjectVector< EmcDigi > EmcDigiCol
ObjectVector< MdcDigi > MdcDigiCol
ObjectVector< MucDigi > MucDigiCol
ObjectVector< TofDigi > TofDigiCol
static EmcConverter * instance(int runMode=2)
StatusCode convert(const BufferHolder &src, EmcDigiCol *des)
static MdcConverter * instance(int runMode=2)
void init(int runFrom, int runTo)
StatusCode convert(const BufferHolder &src, MdcDigiCol *des)
static MucConverter * instance()
StatusCode convert(const BufferHolder &src, MucDigiCol *des)
void addReTofDigi(uint32_t *digi, uint32_t size)
void addReMdcDigi(uint32_t *digi, uint32_t size)
const BufferHolder & getEmcBuf() const
void addReMucDigi(uint32_t *digi, uint32_t size)
const BufferHolder & getMdcBuf() const
const BufferHolder & getMucBuf() const
const BufferHolder & getTofBuf() const
void addReEmcDigi(uint32_t *digi, uint32_t size)
virtual ~RawEventReader()
RawEventReader(const std::string &name, ISvcLocator *pSvcLocator)
virtual void print() const
const uint32_t * nextEvent()
StatusCode convert(const BufferHolder &src, TofDigiCol *des, LumiDigiCol *des2=0)
static TofConverter * instance()