1#include "GaudiKernel/MsgStream.h"
2#include "TrigEvent/TrigGTD.h"
3#include "RawDataCnv/RawDataAddress.h"
4#include "RawDataCnv/EventManagement/RAWEVENT.h"
5#include "RawDataCnv/RawDataInputSvc.h"
6#include "RawDataCnv/RawDataTrigGTDCnv.h"
30 MsgStream log(messageService(),
"RawDataTrigGTDCnv");
33 StatusCode status = serviceLocator()->service(
"PackedRawDataCnvSvc", isvc,
true);
36 if (m_RawDataAccess == 0) {
37 log << MSG::ERROR <<
"RawDataTrigGTDCnv: Cant cast to RawDataCnvSvc" << endreq;
38 return StatusCode::FAILURE;
41 if (m_RawDataAccess) log << MSG::INFO <<
"RawDataCnvSvc retrieved" << endreq;
44 sc = serviceLocator()->getService(
"RawDataInputSvc", svc);
46 log << MSG::WARNING <<
"Cant get RawDataInputSvc" << endreq;
51 if (m_inputSvc == 0) {
52 log << MSG::WARNING <<
"Cant cast to RawDataInputSvc" << endreq;
53 return StatusCode::FAILURE;
56 return StatusCode::SUCCESS;
60 MsgStream log(
msgSvc(),
"RawDataTrigGTDCnv");
61 log << MSG::DEBUG <<
"RawDataTrigGTDCnv::updateObj" << endreq;
62 return Converter::updateObj(pAddr, pObj);
68 MsgStream log(
msgSvc(),
"RawDataTrigGTDCnv");
79 log << MSG::ERROR <<
"RawDataTrigGTDCnv::createObj has no event!" << endreq;
80 return StatusCode::FAILURE;
84 uint32_t nbuf = gtdBuf.
nBuf();
86 for (uint32_t i = 0; i < nbuf; i++) {
87 uint32_t* buf = gtdBuf(i);
88 uint32_t bufSize = gtdBuf.
bufSize(i);
90 while (bufSize - index > 1) {
91 uint32_t blockSize = ( ((*(buf+index))>>14) & 0x3FF);
92 uint32_t
id = ((*(buf+index))>>24);
93 if (blockSize == 0 || (index+blockSize) > bufSize)
break;
94 if ((
id> 0xD1 &&
id < 0xD8 &&
id != 0xD5) ||
id == 0xDA || (
id > 0xE1 &&
id < 0xED)) {
95 trigGTD =
new TrigGTD(buf+index);
96 gtdCol->push_back(trigGTD);
102 return StatusCode::SUCCESS;
107 MsgStream log(messageService(),
"RawDataTrigGTDCnv");
109 return StatusCode::SUCCESS;
const CLID & CLID_TrigGTDCol
unsigned const long PACKEDRAWEVENT_StorageType
ObjectVector< TrigGTD > TrigGTDCol
const CLID & CLID_TrigGTDCol
uint32_t bufSize(int i) const
const BufferHolder & getGTDBuf() const
static const CLID & classID()
virtual StatusCode updateObj(IOpaqueAddress *, DataObject *)
StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
RawDataTrigGTDCnv(ISvcLocator *svc)
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Convert the transient object to the requested representation.