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"
33 Algorithm(name, pSvcLocator)
40 declareProperty(
"MdcDigi",m_mdcdigi=1);
41 declareProperty(
"TofDigi",m_tofdigi=1);
42 declareProperty(
"EmcDigi",m_emcdigi=1);
43 declareProperty(
"MucDigi",m_mucdigi=1);
44 declareProperty(
"InputFiles",m_inputFiles);
45 declareProperty(
"RawDataReviseConfFile", m_rawReviseConfig);
59 MsgStream log(
msgSvc(), name());
60 log << MSG::INFO <<
"in initialize()" << endreq;
64 std::ifstream conff(m_rawReviseConfig.c_str());
67 ISvcLocator* svcLocator = Gaudi::svcLocator();
68 StatusCode sc=svcLocator->service(
"EventDataSvc", m_evtSvc);
70 std::cout<<
"Could not accesss EventDataSvc!"<<std::endl;
72 return StatusCode::SUCCESS;
78 MsgStream log(
msgSvc(), name());
79 log << MSG::INFO <<
"in execute()" << endreq;
82 StatusCode sc = m_evtSvc->registerObject(
"/Event/Digi",aDigiEvent);
83 if(sc!=StatusCode::SUCCESS) {
84 std::cout<<
"Could not register DigiEvent" <<std::endl;
95 m_mdcCnv->
convert(mdcBuf, mdcDigiCol);
103 StatusCode scMdc = m_evtSvc->registerObject(
"/Event/Digi/MdcDigiCol", mdcDigiCol);
104 if( scMdc!=StatusCode::SUCCESS ) {
105 std::cout<<
"Could not register MDC digi collection" <<std::endl;
117 m_tofCnv->
convert(tofBuf, etfBuf, tofDigiCol);
134 StatusCode scTof = m_evtSvc->registerObject(
"/Event/Digi/TofDigiCol", tofDigiCol);
135 if( scTof!=StatusCode::SUCCESS ) {
136 std::cout<<
"Could not register TOF digi collection" <<std::endl;
145 m_emcCnv->
convert(emcBuf, emcDigiCol);
147 StatusCode scEmc = m_evtSvc->registerObject(
"/Event/Digi/EmcDigiCol", emcDigiCol);
148 if( scEmc!=StatusCode::SUCCESS ) {
149 std::cout<<
"Could not register EMC digi collection" <<std::endl;
158 m_mucCnv->
convert(mucBuf, mucDigiCol);
160 StatusCode scMuc = m_evtSvc->registerObject(
"/Event/Digi/MucDigiCol", mucDigiCol);
161 if( scMuc!=StatusCode::SUCCESS ) {
162 std::cout<<
"Could not register MUC digi collection" <<std::endl;
166 m_raw_event->
reset();
168 return StatusCode::SUCCESS;
174 const uint32_t* fragment;
183 std::cerr << std::endl <<
"Uncaught unknown exception" << std::endl;
189 for (
int robi = 0; robi < nrobs; robi++) {
192 uint32_t* dataptr =
NULL;
195 source_id_number <<= 8;
196 source_id_number >>= 24;
197 switch(source_id_number) {
215 return StatusCode::SUCCESS;
220 MsgStream log(
msgSvc(), name());
221 log << MSG::INFO <<
"in finalize()" << endreq;
227 return StatusCode::SUCCESS;
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
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)
StatusCode convert(const BufferHolder &src, MdcDigiCol *des)
void init(const SniperJSON &config)
static MucConverter * instance()
StatusCode convert(const BufferHolder &src, MucDigiCol *des)
void addReTofDigi(uint32_t *digi, uint32_t size)
const BufferHolder & getEtfBuf() const
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 addReEtfDigi(uint32_t *digi, uint32_t size)
void addReEmcDigi(uint32_t *digi, uint32_t size)
virtual ~RawEventReader()
virtual void print() const
const uint32_t * nextEvent()
static SniperJSON load(std::istream &is)
StatusCode convert(const BufferHolder &src, TofDigiCol *des, LumiDigiCol *des2=0)
static TofConverter * instance()