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

#include <RawDataZddEventCnv.h>

+ Inheritance diagram for RawDataZddEventCnv:

Public Member Functions

StatusCode initialize ()
 
virtual long repSvcType () const
 
StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&pObj)
 
virtual StatusCode updateObj (IOpaqueAddress *, DataObject *)
 override the RawDataBaseCnv version
 
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

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

Friends

class CnvFactory< RawDataZddEventCnv >
 

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 14 of file RawDataZddEventCnv.h.

Constructor & Destructor Documentation

◆ RawDataZddEventCnv()

RawDataZddEventCnv::RawDataZddEventCnv ( ISvcLocator *  svc)
protected

Definition at line 12 of file RawDataZddEventCnv.cxx.

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

◆ ~RawDataZddEventCnv()

RawDataZddEventCnv::~RawDataZddEventCnv ( )
protectedvirtual

Definition at line 17 of file RawDataZddEventCnv.cxx.

18{
20}
static void destroy()

Member Function Documentation

◆ classID()

const CLID & RawDataZddEventCnv::classID ( )
static

Definition at line 53 of file RawDataZddEventCnv.cxx.

54{
55 return CLID_ZddEvent;
56}
const CLID & CLID_ZddEvent
Definition: EventModel.cxx:290

Referenced by PackedRawDataCnvSvc::addConverters().

◆ createObj()

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

Definition at line 58 of file RawDataZddEventCnv.cxx.

59{
60 ZddEvent* zddEvt = new ZddEvent;
61 pObj = zddEvt;
62
63 RAWEVENT* evt = m_inputSvc->currentEvent();
64 if (evt == NULL) {
65 //log << MSG::ERROR << "RawDataZddEventCnv::createObj has no event!" << endreq;
66 return StatusCode::FAILURE;
67 }
68
69 const BufferHolder& zddBuf = evt->getZddBuf();
70
71 // Data decoding
72 uint32_t nbuf = zddBuf.nBuf();
73 for ( uint32_t i = 0; i < nbuf; ++i ) { //loop the buffers
74 uint32_t* buf = zddBuf(i);
75 m_cnv->convert(buf, zddBuf.bufSize(i), zddEvt);
76 }
77
78 return StatusCode::SUCCESS;
79}
#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 & getZddBuf() const
Definition: RAWEVENT.h:100
bool convert(uint32_t *pdata, int size, Event::ZddEvent *evt)

◆ createRep()

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

Definition at line 86 of file RawDataZddEventCnv.cxx.

87{
88 // to be filled
89 return StatusCode::SUCCESS;
90}

◆ initialize()

StatusCode RawDataZddEventCnv::initialize ( )

Definition at line 22 of file RawDataZddEventCnv.cxx.

23{
24 StatusCode sc = RawDataBaseCnv::initialize();
25 if ( sc.isFailure() ) return sc;
26
27 std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc");
28 std::string RawDataInputSvc_Name("RawDataInputSvc");
29 std::string RawDataZddEventCnv_Name("RawDataZddEventCnv");
30
31 SmartIF<IService> pCnvSvc(conversionSvc());
32 if (isGaudiThreaded(pCnvSvc->name())){
33 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
34 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
35 RawDataZddEventCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
36 }
37
38 MsgStream log(messageService(), RawDataZddEventCnv_Name.c_str());
39
40 IService* svc ;
41 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc);
42 m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc);
43 if ( m_inputSvc == 0 ) {
44 log<<MSG::WARNING<< " Cant cast to RawDataInputSvc " <<endreq;
45 return StatusCode::FAILURE ;
46 }
47
48 m_cnv = ZddConverter::instance( m_inputSvc->runMode() );
49
50 return StatusCode::SUCCESS;
51}
virtual int runMode()=0
StatusCode initialize()
static ZddConverter * instance(int runMode=2)
Definition: ZddConverter.cxx:9

◆ repSvcType()

virtual long RawDataZddEventCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 28 of file RawDataZddEventCnv.h.

28 {
30 }

◆ storageType()

static const unsigned char RawDataZddEventCnv::storageType ( )
inlinestatic

Definition at line 32 of file RawDataZddEventCnv.h.

32 {
34 }

◆ updateObj()

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

override the RawDataBaseCnv version

Definition at line 81 of file RawDataZddEventCnv.cxx.

82{
83 return Converter::updateObj(pAddr, pObj);
84}

Friends And Related Function Documentation

◆ CnvFactory< RawDataZddEventCnv >

friend class CnvFactory< RawDataZddEventCnv >
friend

Definition at line 50 of file RawDataZddEventCnv.h.


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