1#include "GaudiKernel/MsgStream.h"
3#include "GaudiKernel/ThreadGaudi.h"
6#include "RawDataCnv/RawDataAddress.h"
7#include "RawDataCnv/RawDataInputSvc.h"
8#include "RawDataCnv/PackedRawDataCnvSvc.h"
9#include "RawDataCnv/EventManagement/RAWEVENT.h"
10#include "EventModel/EventHeader.h"
11#include "RawDataCnv/RawDataEvtHeaderCnv.h"
26 if ( sc.isFailure() )
return sc;
28 std::string PackedRawDataCnvSvc_Name(
"PackedRawDataCnvSvc");
29 std::string RawDataInputSvc_Name(
"RawDataInputSvc");
30 std::string RawDataEvtHeaderCnv_Name(
"RawDataEvtHeaderCnv");
35 SmartIF<IService> pCnvSvc(conversionSvc());
36 if (isGaudiThreaded(pCnvSvc->name())){
37 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
38 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
39 RawDataEvtHeaderCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
43 MsgStream log(messageService(), RawDataEvtHeaderCnv_Name.c_str());
46 sc = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), svc);
47 if ( sc.isFailure() ) {
48 log << MSG::ERROR <<
"Can't get RawDataAccess interface" << endreq;
49 return StatusCode::FAILURE;
53 if (m_RawDataAccess == 0 ) {
54 log << MSG::ERROR <<
"RawDataEvtHeaderCnv: Cant cast to RawDataCnvSvc" << endreq;
55 return StatusCode::FAILURE;
58 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc);
59 if ( sc.isFailure() ) {
60 log << MSG::WARNING <<
"Cant get RawDataInputSvc " << endreq;
65 if ( m_inputSvc == 0 ) {
66 log << MSG::ERROR <<
"Cant cast to RawDataInputSvc" << endreq;
67 return StatusCode::FAILURE ;
70 return StatusCode::SUCCESS;
81 return Converter::updateObj(pAddr, pObj);
97 if (evt == NULL)
return StatusCode::FAILURE;
106 if ( rBuf.
nBuf() == 1 ) {
107 uint32_t dataLen = rBuf.
bufSize(0);
108 uint32_t * dataPtr = rBuf(0);
117 if ( dataLen > 11 && dataPtr[1] == 0xffffffff ) {
119 if ( (dataPtr[start] >> 24) == 0xcf ) {
120 unsigned long t1 = calEts( dataPtr + start );
123 static unsigned long t2 = 0;
124 if ( (start+3) < dataLen && (dataPtr[start+2]>>24) == 0xd1 ) {
125 t2 = calEts( dataPtr + start + 2 );
132 return StatusCode::SUCCESS;
140unsigned long RawDataEvtHeaderCnv::calEts(uint32_t* dptr)
142 unsigned int tmp = dptr[0] & 0xffffff;
143 unsigned long val = (tmp >> 16 ) * 61 * 61;
144 val += ((tmp >> 8) & 0xff) * 61;
147 val += (dptr[1] & 0x3fffff);
unsigned const long PACKEDRAWEVENT_StorageType
uint32_t bufSize(int i) const
const BufferHolder & getEtsBuf() const
const RawEventHeader & eventHeader() const