CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataEvtHeaderCnv Class Reference

#include <RawDataEvtHeaderCnv.h>

+ Inheritance diagram for RawDataEvtHeaderCnv:

Public Member Functions

StatusCode initialize ()
 
virtual long repSvcType () const
 
StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&pObj)
 
virtual StatusCode updateObj (IOpaqueAddress *, DataObject *)
 override the RawDataBaseCnv version
 
- Public Member Functions inherited from RawDataBaseCnv
 RawDataBaseCnv (ISvcLocator *svc)
 
 RawDataBaseCnv (unsigned char storageType, const CLID &clid, ISvcLocator *svc)
 
virtual ~RawDataBaseCnv ()
 
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

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

Friends

class CnvFactory< RawDataEvtHeaderCnv >
 

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 17 of file RawDataEvtHeaderCnv.h.

Constructor & Destructor Documentation

◆ RawDataEvtHeaderCnv()

RawDataEvtHeaderCnv::RawDataEvtHeaderCnv ( ISvcLocator * svc)
protected

Definition at line 15 of file RawDataEvtHeaderCnv.cxx.

15 :
17{
18 // for Mutil-thread by tianhl
19 //init();
20 // for Mutil-thread by tianhl
21}
unsigned const long PACKEDRAWEVENT_StorageType
RawDataBaseCnv(ISvcLocator *svc)
static const CLID & classID()

Member Function Documentation

◆ classID()

const CLID & RawDataEvtHeaderCnv::classID ( )
static

Definition at line 73 of file RawDataEvtHeaderCnv.cxx.

74{
75 return CLID_EventHeader;
76}
const CLID & CLID_EventHeader

Referenced by PackedRawDataCnvSvc::addConverters().

◆ createObj()

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

Definition at line 85 of file RawDataEvtHeaderCnv.cxx.

86{
87 StatusCode sc;
88 RawDataAddress *pEFAddr;
89 const RAWEVENT *evt;
90
92 pObj = header;
93
94 //if ( (pEFAddr = dynamic_cast<RawDataAddress*>(pAddr)) ) {
95 evt = m_inputSvc->currentEvent();
96
97 if (evt == NULL) return StatusCode::FAILURE;
98
99 header->setEventNumber(evt->eventHeader().event_number());
100 header->setRunNumber(evt->eventHeader().run_number());
101 header->setTime(evt->eventHeader().time());
102 header->setFlag1( evt->eventHeader().flag1() );
103 //header->setFlag2( evt->eventHeader().flag2() );
104
105
106 return StatusCode::SUCCESS;
107 //}
108 //else {
109 // return StatusCode::FAILURE;
110 //}
111
112}
void setRunNumber(int value)
Update run number.
Definition EventHeader.h:44
void setTime(int value)
Definition EventHeader.h:48
void setFlag1(unsigned int value)
Update flags.
Definition EventHeader.h:59
void setEventNumber(int value)
Update event number.
Definition EventHeader.h:39
virtual RAWEVENT * currentEvent()=0
uint32_t flag1() const
Definition RAWEVENT.h:26
uint32_t run_number() const
Definition RAWEVENT.h:22
uint32_t event_number() const
Definition RAWEVENT.h:23
uint32_t time() const
Definition RAWEVENT.h:24
const RawEventHeader & eventHeader() const
Definition RAWEVENT.h:87

◆ initialize()

StatusCode RawDataEvtHeaderCnv::initialize ( )

Definition at line 23 of file RawDataEvtHeaderCnv.cxx.

24{
25 StatusCode sc = RawDataBaseCnv::initialize();
26 if ( sc.isFailure() ) return sc;
27
28 std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc");
29 std::string RawDataInputSvc_Name("RawDataInputSvc");
30 std::string RawDataEvtHeaderCnv_Name("RawDataEvtHeaderCnv");
31
32 // for Mutil-thread by tianhl
33 //ConversionSvc* pCnvSvc = 0;
34 //if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){
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());
40 }
41 //}
42 // for Mutil-thread by tianhl
43 MsgStream log(messageService(), RawDataEvtHeaderCnv_Name.c_str());
44
45 IService* svc = 0;
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;
50 }
51
52 m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (svc);
53 if (m_RawDataAccess == 0 ) {
54 log << MSG::ERROR << "RawDataEvtHeaderCnv: Cant cast to RawDataCnvSvc" << endreq;
55 return StatusCode::FAILURE;
56 }
57
58 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc);
59 if ( sc.isFailure() ) {
60 log << MSG::WARNING << "Cant get RawDataInputSvc " << endreq;
61 return sc ;
62 }
63
64 m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc);
65 if ( m_inputSvc == 0 ) {
66 log << MSG::ERROR << "Cant cast to RawDataInputSvc" << endreq;
67 return StatusCode::FAILURE ;
68 }
69
70 return StatusCode::SUCCESS;
71}
StatusCode initialize()

◆ repSvcType()

virtual long RawDataEvtHeaderCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 32 of file RawDataEvtHeaderCnv.h.

32 {
34 }

◆ storageType()

static const unsigned char RawDataEvtHeaderCnv::storageType ( )
inlinestatic

Definition at line 36 of file RawDataEvtHeaderCnv.h.

36 {
38 }

◆ updateObj()

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

override the RawDataBaseCnv version

Definition at line 78 of file RawDataEvtHeaderCnv.cxx.

78 {
79 //MsgStream log(msgSvc(), "RawDataEvtHeaderCnv");
80 //log << MSG::DEBUG << "RawDataEvtHeaderCnv::updateObj" << endreq;
81 return Converter::updateObj(pAddr, pObj);
82}

Friends And Related Symbol Documentation

◆ CnvFactory< RawDataEvtHeaderCnv >

friend class CnvFactory< RawDataEvtHeaderCnv >
friend

Definition at line 1 of file RawDataEvtHeaderCnv.h.


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