12#include "GaudiKernel/StatusCode.h"
13#include "GaudiKernel/Converter.h"
14#include "GaudiKernel/SmartDataPtr.h"
15#include "GaudiKernel/MsgStream.h"
17#include "GaudiKernel/ThreadGaudi.h"
20#include "EventModel/EventModel.h"
21#include "EmcRawEvent/EmcDigi.h"
22#include "RawDataCnv/EventManagement/RAWEVENT.h"
23#include "RawDataCnv/EventManagement/RawEvent.h"
24#include "RawDataCnv/RawDataInputSvc.h"
25#include "RawDataCnv/PackedRawDataCnvSvc.h"
26#include "RawDataCnv/Util/EmcConverter.h"
27#include "RawDataCnv/RawDataEmcDigiCnv.h"
50 std::string PackedRawDataCnvSvc_Name(
"PackedRawDataCnvSvc");
51 std::string RawDataInputSvc_Name(
"RawDataInputSvc");
52 std::string RawDataEmcDigiCnv_Name(
"RawDataEmcDigiCnv");
57 SmartIF<IService> pCnvSvc(conversionSvc());
59 if (isGaudiThreaded(pCnvSvc->name())){
60 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
61 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
62 RawDataEmcDigiCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
67 MsgStream log(
msgSvc(), RawDataEmcDigiCnv_Name.c_str());
70 if ( sc.isFailure() ) {
76 StatusCode status = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), isvc,
true);
78 if(m_RawDataAccess == 0 ) {
79 log<<MSG::ERROR<<
" RawDataCnv: Cant cast to RawDataCnvSvc " <<endreq;
80 return StatusCode::FAILURE ;
84 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc);
90 if ( m_inputSvc == 0 ) {
91 log<<MSG::WARNING<<
" Cant cast to RawDataInputSvc " <<endreq;
92 return StatusCode::FAILURE ;
97 return StatusCode::SUCCESS;
105 MsgStream log(
msgSvc(),
"RawDataEmcDigiCnv");
106 log << MSG::DEBUG <<
"RawDataEmcDigiCnv::updateObj" << endreq;
107 return Converter::updateObj(pAddr, pObj);
113 MsgStream log(
msgSvc(),
"RawDataEmcDigiCnv");
122 cout <<
"RawDataEmcDigiCnv::createObj can't get event!" << endl;
123 return StatusCode::FAILURE;
128 return m_cnv->
convert(emcBuf, digiCol);
134 MsgStream log(
msgSvc(),
"RawDataEmcDigiCnv");
138 log <<
" get RawEvent failed !" << endreq;
139 return StatusCode::FAILURE;
144 log <<
"no EmcDigiCol found" << endreq;
145 return StatusCode::FAILURE;
162 return m_cnv->
convert(digiCol, re);
ObjectVector< EmcDigi > EmcDigiCol
const CLID & CLID_EmcDigiCol
unsigned const long PACKEDRAWEVENT_StorageType
const CLID & CLID_EmcDigiCol
static EmcConverter * instance(int runMode=2)
StatusCode convert(const BufferHolder &src, EmcDigiCol *des)
virtual WriteRawEvent *& getRawEvent()
const BufferHolder & getEmcBuf() const
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Convert the transient object to the requested representation.
static const CLID & classID()
StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
virtual StatusCode updateObj(IOpaqueAddress *, DataObject *)
override the RawDataBaseCnv version
RawDataEmcDigiCnv(ISvcLocator *svc)
_EXTERN_ std::string EmcDigiCol