BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataTrigGTDCnv Class Reference

#include <RawDataTrigGTDCnv.h>

+ Inheritance diagram for RawDataTrigGTDCnv:

Public Member Functions

StatusCode init ()
 
virtual long repSvcType () const
 
StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&pObj)
 
virtual StatusCode updateObj (IOpaqueAddress *, DataObject *)
 
virtual StatusCode createRep (DataObject *pObj, IOpaqueAddress *&pAddr)
 Convert the transient object to the requested representation.
 
- Public Member Functions inherited from RawDataBaseCnv
 RawDataBaseCnv (ISvcLocator *svc)
 
 RawDataBaseCnv (unsigned char storageType, const CLID &clid, ISvcLocator *svc)
 
virtual ~RawDataBaseCnv ()
 
virtual long repSvcType () const
 
StatusCode initialize ()
 
virtual StatusCode finalize ()
 
void declareObject (const std::string &fullPath, const CLID &clid, const std::string &bank, long par=0)
 Store TDS path to link a particular converter to an object on the TDS.
 
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
 Convert the transient object to the requested representation.
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
 
virtual StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject)
 Update the converted representation of a transient object.
 
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Update the references of an already converted object.
 
- Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
 

Static Public Member Functions

static const CLID & classID ()
 
static const unsigned char storageType ()
 
- Static Public Member Functions inherited from RawDataBaseCnv
static const long storageType ()
 
static const CLID & classID ()
 

Protected Member Functions

 RawDataTrigGTDCnv (ISvcLocator *svc)
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
 

Friends

class CnvFactory< RawDataTrigGTDCnv >
 

Additional Inherited Members

- Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
 
typedef Ty2 destination
 
- Protected Attributes inherited from RawDataBaseCnv
IRawDataCnvSvcm_CnvSvc
 Pointer to event conversion service interface.
 
std::vector< IRawDataCnvSvc::Leafm_leaves
 Leaf objects giving the locations of the objects in the data store.
 

Detailed Description

Definition at line 21 of file RawDataTrigGTDCnv.h.

Constructor & Destructor Documentation

◆ RawDataTrigGTDCnv()

RawDataTrigGTDCnv::RawDataTrigGTDCnv ( ISvcLocator *  svc)
protected

Definition at line 11 of file RawDataTrigGTDCnv.cxx.

11 :
13{
14 init();
15}
unsigned const long PACKEDRAWEVENT_StorageType
Definition: ClassID_temp.h:17
static const CLID & classID()

Member Function Documentation

◆ classID()

const CLID & RawDataTrigGTDCnv::classID ( )
static

Definition at line 18 of file RawDataTrigGTDCnv.cxx.

19{
20 return CLID_TrigGTDCol;
21}
const CLID & CLID_TrigGTDCol
Definition: EventModel.cxx:279

Referenced by PackedRawDataCnvSvc::addConverters().

◆ createObj()

StatusCode RawDataTrigGTDCnv::createObj ( IOpaqueAddress *  pAddr,
DataObject *&  pObj 
)

Definition at line 66 of file RawDataTrigGTDCnv.cxx.

67{
68 MsgStream log(msgSvc(), "RawDataTrigGTDCnv");
69 RawDataAddress* pEFAddr;
70
71 RAWEVENT* evt;
72 TrigGTD* trigGTD;
73
74 TrigGTDCol* gtdCol = new TrigGTDCol;
75 pObj = gtdCol;
76
77 evt = m_inputSvc->currentEvent();
78 if (evt == NULL) {
79 log << MSG::ERROR << "RawDataTrigGTDCnv::createObj has no event!" << endreq;
80 return StatusCode::FAILURE;
81 }
82
83 const BufferHolder& gtdBuf = evt->getGTDBuf();
84 uint32_t nbuf = gtdBuf.nBuf();
85
86 for (uint32_t i = 0; i < nbuf; i++) {
87 uint32_t* buf = gtdBuf(i);
88 uint32_t bufSize = gtdBuf.bufSize(i);
89 uint32_t index = 0;
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);
97 }
98 index += blockSize;
99 }
100 }
101
102 return StatusCode::SUCCESS;
103}
IMessageSvc * msgSvc()
ObjectVector< TrigGTD > TrigGTDCol
Definition: TrigGTD.h:39
#define NULL
uint32_t nBuf() const
Definition: BufferHolder.h:15
uint32_t bufSize(int i) const
Definition: BufferHolder.h:16
virtual RAWEVENT * currentEvent()=0
const BufferHolder & getGTDBuf() const
Definition: RAWEVENT.h:99

◆ createRep()

StatusCode RawDataTrigGTDCnv::createRep ( DataObject *  pObject,
IOpaqueAddress *&  refpAddress 
)
virtual

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

Definition at line 105 of file RawDataTrigGTDCnv.cxx.

106{
107 MsgStream log(messageService(), "RawDataTrigGTDCnv");
108
109 return StatusCode::SUCCESS;
110}

◆ init()

StatusCode RawDataTrigGTDCnv::init ( )

Definition at line 23 of file RawDataTrigGTDCnv.cxx.

24{
25 StatusCode sc = RawDataBaseCnv::initialize();
26 if (sc.isFailure()) {
27 return sc;
28 }
29
30 MsgStream log(messageService(), "RawDataTrigGTDCnv");
31
32 IService* isvc = 0;
33 StatusCode status = serviceLocator()->service("PackedRawDataCnvSvc", isvc, true);
34
35 m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (isvc);
36 if (m_RawDataAccess == 0) {
37 log << MSG::ERROR << "RawDataTrigGTDCnv: Cant cast to RawDataCnvSvc" << endreq;
38 return StatusCode::FAILURE;
39 }
40
41 if (m_RawDataAccess) log << MSG::INFO << "RawDataCnvSvc retrieved" << endreq;
42
43 IService* svc;
44 sc = serviceLocator()->getService("RawDataInputSvc", svc);
45 if (sc.isFailure()) {
46 log << MSG::WARNING << "Cant get RawDataInputSvc" << endreq;
47 return sc;
48 }
49
50 m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc);
51 if (m_inputSvc == 0) {
52 log << MSG::WARNING << "Cant cast to RawDataInputSvc" << endreq;
53 return StatusCode::FAILURE;
54 }
55
56 return StatusCode::SUCCESS;
57}
StatusCode initialize()

Referenced by RawDataTrigGTDCnv().

◆ repSvcType()

virtual long RawDataTrigGTDCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 35 of file RawDataTrigGTDCnv.h.

35 {
37 }

◆ storageType()

static const unsigned char RawDataTrigGTDCnv::storageType ( )
inlinestatic

Definition at line 39 of file RawDataTrigGTDCnv.h.

39 {
41 }

◆ updateObj()

StatusCode RawDataTrigGTDCnv::updateObj ( IOpaqueAddress *  pAddr,
DataObject *  pObj 
)
virtual

Definition at line 59 of file RawDataTrigGTDCnv.cxx.

59 {
60 MsgStream log(msgSvc(), "RawDataTrigGTDCnv");
61 log << MSG::DEBUG << "RawDataTrigGTDCnv::updateObj" << endreq;
62 return Converter::updateObj(pAddr, pObj);
63}

Friends And Related Function Documentation

◆ CnvFactory< RawDataTrigGTDCnv >

friend class CnvFactory< RawDataTrigGTDCnv >
friend

Definition at line 1 of file RawDataTrigGTDCnv.h.


The documentation for this class was generated from the following files: