12#include "GaudiKernel/MsgStream.h"
13#include "GaudiKernel/PropertyMgr.h"
14#include "GaudiKernel/IJobOptionsSvc.h"
15#include "GaudiKernel/SmartDataPtr.h"
17#include "GaudiKernel/ThreadGaudi.h"
20#include "EventModel/EventModel.h"
21#include "MdcRawEvent/MdcDigi.h"
22#include "RawDataCnv/EventManagement/RAWEVENT.h"
23#include "RawDataCnv/EventManagement/RawEvent.h"
24#include "RawDataCnv/RawDataInputSvc.h"
25#include "RawDataCnv/RawDataMdcDigiCnv.h"
35 PropertyMgr m_propMgr;
36 m_propMgr.declareProperty(
"ExWireFromRun", m_runFrom = 0 );
37 m_propMgr.declareProperty(
"ExWireToRun", m_runTo = 999999);
39 IJobOptionsSvc* jobSvc;
40 serviceLocator()->service(
"JobOptionsSvc", jobSvc);
41 jobSvc->setMyProperties(
"RawDataMdcDigiCnv", &m_propMgr);
58 std::string PackedRawDataCnvSvc_Name(
"PackedRawDataCnvSvc");
59 std::string RawDataInputSvc_Name(
"RawDataInputSvc");
60 std::string RawDataMdcDigiCnv_Name(
"RawDataMdcDigiCnv");
65 SmartIF<IService> pCnvSvc(conversionSvc());
66 if (isGaudiThreaded(pCnvSvc->name())){
67 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
68 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
69 RawDataMdcDigiCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
75 if ( sc.isFailure() ) {
79 MsgStream log(messageService(), RawDataMdcDigiCnv_Name.c_str());
83 StatusCode status = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), isvc,
true);
85 if(m_RawDataAccess == 0 ) {
86 log<<MSG::ERROR<<
" RawDataMdcCnv: Cant cast to RawDataCnvSvc " <<endreq;
87 return StatusCode::FAILURE ;
91 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc);
97 if(m_inputSvc == 0 ) {
98 log<<MSG::WARNING<<
" Cant cast to RawDataInputSvc " <<endreq;
99 return StatusCode::FAILURE ;
104 m_cnv->
init(m_runFrom, m_runTo);
106 return StatusCode::SUCCESS;
116 return Converter::updateObj(pAddr, pObj);
133 return StatusCode::FAILURE;
141 return m_cnv->
convert(mdcBuf, digiCol);
147 MsgStream log(messageService(),
"RawDataMdcDigiCnv");
151 log <<
" get RawEvent failed !" << endreq;
152 return StatusCode::FAILURE;
157 log <<
"no MdcDigiCol found" << endreq;
158 return StatusCode::FAILURE;
175 return m_cnv->
convert(digiCol, re);
const CLID & CLID_MdcDigiCol
unsigned const long PACKEDRAWEVENT_StorageType
ObjectVector< MdcDigi > MdcDigiCol
const CLID & CLID_MdcDigiCol
static MdcConverter * instance(int runMode=2)
void init(int runFrom, int runTo)
StatusCode convert(const BufferHolder &src, MdcDigiCol *des)
virtual WriteRawEvent *& getRawEvent()
const BufferHolder & getMdcBuf() const
const RawEventHeader & eventHeader() const
virtual StatusCode updateObj(IOpaqueAddress *, DataObject *)
override the RawDataBaseCnv version
StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
static const CLID & classID()
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Convert the transient object to the requested representation.
RawDataMdcDigiCnv(ISvcLocator *svc)
_EXTERN_ std::string MdcDigiCol