12#include "GaudiKernel/MsgStream.h"
13#include "GaudiKernel/SmartDataPtr.h"
15#include "GaudiKernel/ThreadGaudi.h"
48 std::string PackedRawDataCnvSvc_Name(
"PackedRawDataCnvSvc");
49 std::string RawDataInputSvc_Name(
"RawDataInputSvc");
50 std::string RawDataHltRawCnv_Name(
"RawDataHltRawCnv");
55 SmartIF<IService> pCnvSvc(conversionSvc());
56 if (isGaudiThreaded(pCnvSvc->name())){
57 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
58 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
59 RawDataHltRawCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
63 MsgStream log(messageService(), RawDataHltRawCnv_Name.c_str());
65 if (StatusCode::SUCCESS != sc) {
72 StatusCode status = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), isvc,
true);
75 if(m_RawDataAccess == 0 ) {
76 log<<MSG::ERROR<<
" RawDataCnv: Cant cast to RawDataCnvSvc " <<endreq;
77 return StatusCode::FAILURE ;
81 log << MSG::INFO <<
"RawDataCnvSvc retrieved "<< endreq;
84 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc);
85 if(sc != StatusCode::SUCCESS ) {
86 log<<MSG::WARNING <<
" Cant get RawDataInputSvc " <<endreq;
91 if(m_inputSvc == 0 ) {
92 log<<MSG::WARNING<<
" Cant cast to RawDataInputSvc " <<endreq;
93 return StatusCode::FAILURE ;
96 return StatusCode::SUCCESS;
106 return Converter::updateObj(pAddr, pObj);
123 cout <<
"RawDataHltRawCnv::createObj can't get event!" << endl;
124 return StatusCode::FAILURE;
129 uint32_t nbuf = hltBuf.
nBuf();
131 uint32_t REId = 0, TEId = 0;
132 uint32_t nmdc=0,ntof=0,nemc=0,nmuc=0;
133 for (uint32_t i = 0; i < nbuf; i++) {
134 uint32_t* buf = hltBuf(i);
135 uint32_t bufSize = hltBuf.
bufSize(i);
136 for (uint32_t j = 0; j < bufSize; j++, digiId++) {
138 m_hltBuilder.
unPack(buf[j], digiId, REId, TEData[0], TEData[1]);
139 TEId = m_hltBuilder.
getTEID(REId);
140 if ( TEId == 0xFFFFFFFF )
continue;
144 for (uint32_t k=0; k< 2;k++){
146 if(k==0||(k==1&&TEData[k])){
150 ntof=(TEData[k]>>8)&0xFF;
151 nemc=(TEData[k]>>16)&0xFF;
152 nmuc=(TEData[k]>>24)&0xFF;
160 digiCol->push_back ( hltRaw );
165 return StatusCode::SUCCESS;
176 return StatusCode::FAILURE;
182 return StatusCode::FAILURE;
198 return m_hltBuilder.
pack(digiCol, re);
unsigned const long PACKEDRAWEVENT_StorageType
const CLID & CLID_HltRawCol
ObjectVector< HltRaw > HltRawCol
const CLID & CLID_HltRawCol
uint32_t bufSize(int i) const
uint32_t getTEID(uint32_t reid)
void unPack(uint32_t reDigi, uint32_t n, uint32_t &REId, uint32_t &TEData1, uint32_t &TEData2)
StatusCode pack(HltRawCol *digiCol, WriteRawEvent *&re)
static bool is_number(const Identifier &id)
static Identifier convert(const unsigned int id, const int nmdc=0, const int ncgem=0, const int ntof=0, const int nemc=0, const int nmuc=0)
convert global id to sub-id(Identifier)
void setIntChannel(const unsigned int intChannel)
virtual WriteRawEvent *& getRawEvent()
const BufferHolder & getHltBuf() const
static const CLID & classID()
StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Convert the transient object to the requested representation.
virtual StatusCode updateObj(IOpaqueAddress *, DataObject *)
override the RawDataBaseCnv version
RawDataHltRawCnv(ISvcLocator *svc)
void setChargeChannel(const unsigned int chargeChannel)
_EXTERN_ std::string HltRawCol