BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataTrigGTDCnv.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "RawDataCnv/RawDataAddress.h"
4#include "TrigEvent/TrigGTD.h"
5
6#include "RawDataBaseCnv.h"
7
8extern const CLID& CLID_TrigGTDCol;
9
11public:
12 RawDataTrigGTDCnv( ISvcLocator* svc ) : RawDataBaseCnv( svc, classID() ) {}
13
14 static const CLID& classID() { return CLID_TrigGTDCol; }
15
16 StatusCode createObj( IOpaqueAddress* pAddr, DataObject*& pObj ) {
17 MsgStream log( msgSvc(), "RawDataTrigGTDCnv" );
18 RawDataAddress* pEFAddr;
19
20 RAWEVENT* evt;
21 TrigGTD* trigGTD;
22
23 TrigGTDCol* gtdCol = new TrigGTDCol;
24 pObj = gtdCol;
25
26 evt = m_inputSvc->currentEvent();
27 if ( evt == NULL )
28 {
29 log << MSG::ERROR << "RawDataTrigGTDCnv::createObj has no event!" << endmsg;
30 return StatusCode::FAILURE;
31 }
32
33 const BufferHolder& gtdBuf = evt->getGTDBuf();
34 uint32_t nbuf = gtdBuf.nBuf();
35
36 for ( uint32_t i = 0; i < nbuf; i++ )
37 {
38 uint32_t* buf = gtdBuf( i );
39 uint32_t bufSize = gtdBuf.bufSize( i );
40 uint32_t index = 0;
41 while ( bufSize - index > 1 )
42 {
43 uint32_t blockSize = ( ( ( *( buf + index ) ) >> 14 ) & 0x3FF );
44 uint32_t id = ( ( *( buf + index ) ) >> 24 );
45 if ( blockSize == 0 || ( index + blockSize ) > bufSize ) break;
46 if ( ( id > 0xD1 && id < 0xD8 && id != 0xD5 ) || id == 0xDA ||
47 ( id > 0xE1 && id < 0xED ) )
48 {
49 trigGTD = new TrigGTD( buf + index );
50 gtdCol->push_back( trigGTD );
51 }
52 index += blockSize;
53 }
54 }
55
56 return StatusCode::SUCCESS;
57 }
58};
const CLID & CLID_TrigGTDCol
ObjectVector< TrigGTD > TrigGTDCol
const CLID & CLID_TrigGTDCol
IMessageSvc * msgSvc()
IRawDataInputSvc * m_inputSvc
RawDataBaseCnv(long storageType, const CLID &clid, ISvcLocator *svc)
StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
static const CLID & classID()
RawDataTrigGTDCnv(ISvcLocator *svc)