BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataMucDigiCnv Class Reference

#include <RawDataMucDigiCnv.h>

+ Inheritance diagram for RawDataMucDigiCnv:

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

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

Friends

class CnvFactory< RawDataMucDigiCnv >
 

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 30 of file RawDataMucDigiCnv.h.

Constructor & Destructor Documentation

◆ RawDataMucDigiCnv()

RawDataMucDigiCnv::RawDataMucDigiCnv ( ISvcLocator *  svc)
protected

Definition at line 30 of file RawDataMucDigiCnv.cxx.

30 :
32{
33}
unsigned const long PACKEDRAWEVENT_StorageType
Definition: ClassID_temp.h:17
static const CLID & classID()

◆ ~RawDataMucDigiCnv()

RawDataMucDigiCnv::~RawDataMucDigiCnv ( )
protected

Definition at line 35 of file RawDataMucDigiCnv.cxx.

36{
38}
static void destroy()

Member Function Documentation

◆ classID()

const CLID & RawDataMucDigiCnv::classID ( )
static

Definition at line 42 of file RawDataMucDigiCnv.cxx.

43{
44 return CLID_MucDigiCol;
45}
const CLID & CLID_MucDigiCol
Definition: EventModel.cxx:244

Referenced by PackedRawDataCnvSvc::addConverters().

◆ createObj()

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

Definition at line 108 of file RawDataMucDigiCnv.cxx.

109{
110 //MsgStream log(msgSvc(), "RawDataMucDigiCnv");
111 // Purpose and Method: This converter will create an empty MucDigiCol on
112 // the TDS.
113 MucDigiCol *digiCol = new MucDigiCol;
114 pObj = digiCol;
115
116 RAWEVENT* evt = m_inputSvc->currentEvent();
117 if (evt == NULL) {
118 cout << "RawDataMucDigiCnv::createObj has event!" << endl;
119 return StatusCode::FAILURE;
120 }
121
122 const BufferHolder& mucBuf = evt->getMucBuf();
123
124 return m_cnv->convert(mucBuf, digiCol);
125}
ObjectVector< MucDigi > MucDigiCol
Definition: MucDigi.h:29
virtual RAWEVENT * currentEvent()=0
StatusCode convert(const BufferHolder &src, MucDigiCol *des)
const BufferHolder & getMucBuf() const
Definition: RAWEVENT.h:98

◆ createRep()

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

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

Definition at line 127 of file RawDataMucDigiCnv.cxx.

128{
129 // convert PixelRaw in the container into ByteStream
130 //MsgStream log(messageService(), "RawDataMucDigiCnv");
131
132 WriteRawEvent*& re = m_RawDataAccess->getRawEvent();
133 if (re == 0) {
134 //log << " get RawEvent failed !" << endreq;
135 return StatusCode::FAILURE;
136 }
137
138 SmartDataPtr<MucDigiCol> digiCol(dataProvider(), EventModel::Digi::MucDigiCol);
139 if (digiCol == 0) {
140 //log << "no MucDigiCol found" << endreq;
141 return StatusCode::FAILURE;
142 }
143 /*
144 else {
145 log << MSG::INFO << endreq << "Detailed dump of 1st event: " << endreq << endreq;
146 int ndigi = 0;
147 MucDigiCol::const_iterator pMucDigi = digiCol->begin();
148 for (pMucDigi; pMucDigi!= digiCol->end(); pMucDigi++) {
149 log <<MSG::INFO << "Digi " << ndigi++ << " ";
150 // output the digi proper: " << digi " no longer works because
151 // "digi" now returns an integer sort order
152 (**pMucDigi).fillStream(log.stream());
153 log << endreq;
154 }
155 }
156 */
157
158 return m_cnv->convert(digiCol, re);
159}
virtual WriteRawEvent *& getRawEvent()
_EXTERN_ std::string MucDigiCol
Definition: EventModel.h:60

◆ initialize()

StatusCode RawDataMucDigiCnv::initialize ( )

Definition at line 47 of file RawDataMucDigiCnv.cxx.

48{
49 std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc");
50 std::string RawDataInputSvc_Name("RawDataInputSvc");
51 std::string RawDataMucDigiCnv_Name("RawDataMucDigiCnv");
52
53 // for Mutil-thread by tianhl
54 //ConversionSvc* pCnvSvc = 0;
55 //if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){
56 SmartIF<IService> pCnvSvc(conversionSvc());
57 if (isGaudiThreaded(pCnvSvc->name())){
58 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
59 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
60 RawDataMucDigiCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
61 }
62 //}
63
64 MsgStream log(messageService(), RawDataMucDigiCnv_Name.c_str());
65
66 StatusCode sc = RawDataBaseCnv::initialize();
67 if ( sc.isFailure() ) {
68 return sc;
69 }
70
71 // Check RawDataCnvSvc
72 IService* isvc = 0;
73 StatusCode status = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), isvc, true);
74 m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (isvc);
75 if(m_RawDataAccess == 0 ) {
76 log<<MSG::ERROR<< " MucRawDataCnv: Cant cast to RawDataCnvSvc " <<endreq;
77 return StatusCode::FAILURE ;
78 }
79
80 IService* svc ;
81 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc);
82 //if ( sc.isFailure() ) {
83 // log<<MSG::WARNING << " Cant get RawDataInputSvc " <<endreq;
84 // return sc ;
85 //}
86 m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc);
87 if ( m_inputSvc == 0 ) {
88 log<< MSG::WARNING << " Cant cast to RawDataInputSvc " <<endreq;
89 return StatusCode::FAILURE ;
90 }
91
92 m_cnv = MucConverter::instance();
93
94 return StatusCode::SUCCESS;
95}
static MucConverter * instance()
Definition: MucConverter.cxx:5
StatusCode initialize()

◆ repSvcType()

virtual long RawDataMucDigiCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 45 of file RawDataMucDigiCnv.h.

45 {
47 }

◆ storageType()

static const unsigned char RawDataMucDigiCnv::storageType ( )
inlinestatic

Definition at line 49 of file RawDataMucDigiCnv.h.

49 {
51 }

◆ updateObj()

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

override the RawDataBaseCnv version

Definition at line 98 of file RawDataMucDigiCnv.cxx.

98 {
99 // Purpose and Method: This method does nothing other than announce it has
100 // been called.
101
102 //MsgStream log(msgSvc(), "RawDataMucDigiCnv");
103 //log << MSG::DEBUG << "RawDataMucDigiCnv::updateObj" << endreq;
104 return Converter::updateObj(pAddr, pObj);
105}

Friends And Related Function Documentation

◆ CnvFactory< RawDataMucDigiCnv >

friend class CnvFactory< RawDataMucDigiCnv >
friend

Definition at line 1 of file RawDataMucDigiCnv.h.


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