BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataTrigCnv.cxx
Go to the documentation of this file.
1#include "GaudiKernel/MsgStream.h"
2#include "GaudiKernel/IRegistry.h"
7
8
9extern const CLID& CLID_TrigEvent;
10
11// Constructor.
14{
15 init();
16}
17
19{
20 return CLID_TrigEvent;
21}
22
24{
25 StatusCode sc = RawDataBaseCnv::initialize();
26 if (sc.isFailure()) {
27 return sc;
28 }
29
30 MsgStream log(messageService(), "RawDataTrigCnv");
31
32 IService* svc = 0;
33 sc = serviceLocator()->service("PackedRawDataCnvSvc", svc);
34 if (sc != StatusCode::SUCCESS) {
35 log << MSG::ERROR << "Can't get RawDataAccess interface" << endreq;
36 return StatusCode::FAILURE;
37 }
38
39 m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (svc);
40 if (m_RawDataAccess == 0 ) {
41 log << MSG::ERROR << "RawDataCnv: Cant cast to RawDataCnvSvc" << endreq;
42 return StatusCode::FAILURE;
43 }
44
45 sc = serviceLocator()->getService("RawDataInputSvc", svc);
46 if(sc != StatusCode::SUCCESS ) {
47 log << MSG::WARNING << "Cant get RawDataInputSvc " << endreq;
48 return sc ;
49 }
50
51 m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc);
52 if(m_inputSvc == 0 ) {
53 log << MSG::ERROR << "Cant cast to RawDataInputSvc" << endreq;
54 return StatusCode::FAILURE ;
55 }
56
57 return StatusCode::SUCCESS;
58}
59
60StatusCode RawDataTrigCnv::updateObj(IOpaqueAddress* pAddr, DataObject* pObj) {
61 MsgStream log(msgSvc(), "RawDataTrigCnv");
62 log << MSG::DEBUG << "RawDataTrigCnv::updateObj" << endreq;
63 return Converter::updateObj(pAddr, pObj);
64}
65
66StatusCode RawDataTrigCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj)
67{
68 TrigEvent * evt = new TrigEvent();
69 pObj = evt;
70 return StatusCode::SUCCESS;
71}
72
73StatusCode RawDataTrigCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAddr)
74{
75 std::string nm = pObj->registry()->name();
76 RawDataAddress* addr = new RawDataAddress(classID(), nm, "");
77 pAddr = addr;
78
79 return StatusCode::SUCCESS;
80}
unsigned const long PACKEDRAWEVENT_StorageType
Definition: ClassID_temp.h:17
const CLID & CLID_TrigEvent
Definition: EventModel.cxx:277
const CLID & CLID_TrigEvent
Definition: EventModel.cxx:277
IMessageSvc * msgSvc()
StatusCode initialize()
RawDataTrigCnv(ISvcLocator *svc)
static const CLID & classID()
StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
virtual StatusCode updateObj(IOpaqueAddress *, DataObject *)
override the RawDataBaseCnv version
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Convert the transient object to the requested representation.
StatusCode init()