BOSS 7.0.5
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
 
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 ()
 
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.
 
 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
 
destinationoperator (const source &) const
 

Static Public Member Functions

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

Protected Member Functions

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

Constructor & Destructor Documentation

◆ RawDataEvtHeaderCnv() [1/2]

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}
static const CLID & classID()

◆ RawDataEvtHeaderCnv() [2/2]

RawDataEvtHeaderCnv::RawDataEvtHeaderCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/2]

const CLID & RawDataEvtHeaderCnv::classID ( )
static

Definition at line 73 of file RawDataEvtHeaderCnv.cxx.

74{
75 return CLID_EventHeader;
76}
const CLID & CLID_EventHeader
Definition: EventModel.cxx:196

Referenced by PackedRawDataCnvSvc::addConverters().

◆ classID() [2/2]

static const CLID & RawDataEvtHeaderCnv::classID ( )
static

◆ createObj() [1/2]

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 const BufferHolder& rBuf = evt->getEtsBuf();
106 if ( rBuf.nBuf() == 1 ) { // this event has ETS data
107 uint32_t dataLen = rBuf.bufSize(0);
108 uint32_t * dataPtr = rBuf(0);
109 //{ // debug
110 // std::cout << "[ETS]: " << std::hex;
111 // for ( uint32_t i = 0; i < dataLen; ++i ) {
112 // std::cout << " 0x" << std::setw(8) << std::setfill('0') << dataPtr[i];
113 // }
114 // std::cout << std::dec << std::endl;
115 //}
116 // check
117 if ( dataLen > 11 && dataPtr[1] == 0xffffffff ) {
118 uint32_t start = 10;
119 if ( (dataPtr[start] >> 24) == 0xcf ) {
120 unsigned long t1 = calEts( dataPtr + start );
121 header->setEtsT1(t1);
122
123 static unsigned long t2 = 0;
124 if ( (start+3) < dataLen && (dataPtr[start+2]>>24) == 0xd1 ) {
125 t2 = calEts( dataPtr + start + 2 );
126 }
127 header->setEtsT2(t2);
128 }
129 }
130 }
131
132 return StatusCode::SUCCESS;
133 //}
134 //else {
135 // return StatusCode::FAILURE;
136 //}
137
138}
virtual RAWEVENT * currentEvent()=0

◆ createObj() [2/2]

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

◆ initialize() [1/2]

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()

◆ initialize() [2/2]

StatusCode RawDataEvtHeaderCnv::initialize ( )

◆ repSvcType() [1/2]

virtual long RawDataEvtHeaderCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 32 of file Event/RawDataCnv/RawDataCnv-00-05-04/RawDataCnv/RawDataEvtHeaderCnv.h.

32 {
34 }

◆ repSvcType() [2/2]

virtual long RawDataEvtHeaderCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 32 of file InstallArea/include/RawDataCnv/RawDataCnv/RawDataEvtHeaderCnv.h.

32 {
34 }

◆ storageType() [1/2]

static const unsigned char RawDataEvtHeaderCnv::storageType ( )
inlinestatic

◆ storageType() [2/2]

static const unsigned char RawDataEvtHeaderCnv::storageType ( )
inlinestatic

◆ updateObj() [1/2]

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}

◆ updateObj() [2/2]

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

override the RawDataBaseCnv version

Friends And Related Function Documentation

◆ CnvFactory< RawDataEvtHeaderCnv >


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