#include <RawDataMucDigiCnv.h>
Inheritance diagram for RawDataMucDigiCnv:
Public Types | |
typedef Ty1 | source |
typedef Ty2 | destination |
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. | |
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 | 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. | |
destination * | operator (const source &) const |
Static Public Member Functions | |
static const CLID & | classID () |
static const unsigned char | storageType () |
Protected Member Functions | |
RawDataMucDigiCnv (ISvcLocator *svc) | |
~RawDataMucDigiCnv () | |
virtual destination * | convert (const source &) const =0 |
Protected Attributes | |
IRawDataCnvSvc * | m_CnvSvc |
Pointer to event conversion service interface. | |
std::vector< IRawDataCnvSvc::Leaf > | m_leaves |
Leaf objects giving the locations of the objects in the data store. | |
Private Attributes | |
IRawDataInputSvc * | m_inputSvc |
PackedRawDataCnvSvc * | m_RawDataAccess |
Define the interface to raw data cnv. | |
MucConverter * | m_cnv |
EmcConverter for packing or unpacking data. | |
Friends | |
class | CnvFactory< RawDataMucDigiCnv > |
Definition at line 30 of file RawDataMucDigiCnv.h.
typedef Ty2 Converter< Ty1, Ty2 >::destination [inherited] |
Definition at line 19 of file Converter.h.
Definition at line 18 of file Converter.h.
RawDataMucDigiCnv::RawDataMucDigiCnv | ( | ISvcLocator * | svc | ) | [protected] |
Definition at line 30 of file RawDataMucDigiCnv.cxx.
00030 : 00031 RawDataBaseCnv(PACKEDRAWEVENT_StorageType, classID(), svc) 00032 { 00033 }
RawDataMucDigiCnv::~RawDataMucDigiCnv | ( | ) | [protected] |
Definition at line 35 of file RawDataMucDigiCnv.cxx.
References MucConverter::destroy().
00036 { 00037 MucConverter::destroy(); 00038 }
const CLID & RawDataMucDigiCnv::classID | ( | ) | [static] |
Reimplemented from RawDataBaseCnv.
Definition at line 42 of file RawDataMucDigiCnv.cxx.
References CLID_MucDigiCol.
Referenced by PackedRawDataCnvSvc::addConverters().
00043 { 00044 return CLID_MucDigiCol; 00045 }
virtual destination* Converter< Ty1, Ty2 >::convert | ( | const source & | ) | const [protected, pure virtual, inherited] |
StatusCode RawDataMucDigiCnv::createObj | ( | IOpaqueAddress * | pAddr, | |
DataObject *& | pObj | |||
) |
Definition at line 108 of file RawDataMucDigiCnv.cxx.
References MucConverter::convert(), IRawDataInputSvc::currentEvent(), RAWEVENT::getMucBuf(), m_cnv, m_inputSvc, and EventModel::Digi::MucDigiCol.
00109 { 00110 //MsgStream log(msgSvc(), "RawDataMucDigiCnv"); 00111 // Purpose and Method: This converter will create an empty MucDigiCol on 00112 // the TDS. 00113 MucDigiCol *digiCol = new MucDigiCol; 00114 pObj = digiCol; 00115 00116 RAWEVENT* evt = m_inputSvc->currentEvent(); 00117 if (evt == NULL) { 00118 cout << "RawDataMucDigiCnv::createObj has event!" << endl; 00119 return StatusCode::FAILURE; 00120 } 00121 00122 const BufferHolder& mucBuf = evt->getMucBuf(); 00123 00124 return m_cnv->convert(mucBuf, digiCol); 00125 }
StatusCode RawDataMucDigiCnv::createRep | ( | DataObject * | pObj, | |
IOpaqueAddress *& | pAddr | |||
) | [virtual] |
Convert the transient object to the requested representation.
Reimplemented from RawDataBaseCnv.
Definition at line 127 of file RawDataMucDigiCnv.cxx.
References MucConverter::convert(), PackedRawDataCnvSvc::getRawEvent(), m_cnv, m_RawDataAccess, and EventModel::Digi::MucDigiCol.
00128 { 00129 // convert PixelRaw in the container into ByteStream 00130 //MsgStream log(messageService(), "RawDataMucDigiCnv"); 00131 00132 WriteRawEvent*& re = m_RawDataAccess->getRawEvent(); 00133 if (re == 0) { 00134 //log << " get RawEvent failed !" << endreq; 00135 return StatusCode::FAILURE; 00136 } 00137 00138 SmartDataPtr<MucDigiCol> digiCol(dataProvider(), EventModel::Digi::MucDigiCol); 00139 if (digiCol == 0) { 00140 //log << "no MucDigiCol found" << endreq; 00141 return StatusCode::FAILURE; 00142 } 00143 /* 00144 else { 00145 log << MSG::INFO << endreq << "Detailed dump of 1st event: " << endreq << endreq; 00146 int ndigi = 0; 00147 MucDigiCol::const_iterator pMucDigi = digiCol->begin(); 00148 for (pMucDigi; pMucDigi!= digiCol->end(); pMucDigi++) { 00149 log <<MSG::INFO << "Digi " << ndigi++ << " "; 00150 // output the digi proper: " << digi " no longer works because 00151 // "digi" now returns an integer sort order 00152 (**pMucDigi).fillStream(log.stream()); 00153 log << endreq; 00154 } 00155 } 00156 */ 00157 00158 return m_cnv->convert(digiCol, re); 00159 }
void RawDataBaseCnv::declareObject | ( | const std::string & | fullPath, | |
const CLID & | clid, | |||
const std::string & | bank, | |||
long | par = 0 | |||
) | [inherited] |
Store TDS path to link a particular converter to an object on the TDS.
Definition at line 81 of file RawDataBaseCnv.cxx.
00082 { 00083 // Purpose and Method: Save the path on the TDS, in the m_leaves vector, 00084 // corresponding to the DataObject that the converter handles. 00085 // m_leaves.push_back(IRawDataCnvSvc::Leaf(path, cl, bank, par)); 00086 }
StatusCode RawDataBaseCnv::fillRepRefs | ( | IOpaqueAddress * | pAddress, | |
DataObject * | pObject | |||
) | [virtual, inherited] |
Resolve the references of the converted object.
Definition at line 29 of file RawDataBaseCnv.cxx.
00030 { 00031 // Purpose and Method: Resolve the references of the converted object. 00032 // It is expected that derived classes will override this method. 00033 return StatusCode::SUCCESS; 00034 }
StatusCode RawDataBaseCnv::finalize | ( | ) | [virtual, inherited] |
Definition at line 73 of file RawDataBaseCnv.cxx.
References RawDataBaseCnv::m_CnvSvc.
00073 { 00074 if ( m_CnvSvc ) { 00075 m_CnvSvc->release(); 00076 m_CnvSvc = 0; 00077 } 00078 return Converter::finalize(); 00079 }
StatusCode RawDataMucDigiCnv::initialize | ( | ) |
Reimplemented from RawDataBaseCnv.
Definition at line 47 of file RawDataMucDigiCnv.cxx.
References calibUtil::ERROR, RawDataBaseCnv::initialize(), MucConverter::instance(), m_cnv, m_inputSvc, m_RawDataAccess, deljobs::string, and Bes_Common::WARNING.
00048 { 00049 std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc"); 00050 std::string RawDataInputSvc_Name("RawDataInputSvc"); 00051 std::string RawDataMucDigiCnv_Name("RawDataMucDigiCnv"); 00052 00053 // for Mutil-thread by tianhl 00054 //ConversionSvc* pCnvSvc = 0; 00055 //if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){ 00056 SmartIF<IService> pCnvSvc(conversionSvc()); 00057 if (isGaudiThreaded(pCnvSvc->name())){ 00058 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name()); 00059 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name()); 00060 RawDataMucDigiCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name()); 00061 } 00062 //} 00063 00064 MsgStream log(messageService(), RawDataMucDigiCnv_Name.c_str()); 00065 00066 StatusCode sc = RawDataBaseCnv::initialize(); 00067 if ( sc.isFailure() ) { 00068 return sc; 00069 } 00070 00071 // Check RawDataCnvSvc 00072 IService* isvc = 0; 00073 StatusCode status = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), isvc, true); 00074 m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (isvc); 00075 if(m_RawDataAccess == 0 ) { 00076 log<<MSG::ERROR<< " MucRawDataCnv: Cant cast to RawDataCnvSvc " <<endreq; 00077 return StatusCode::FAILURE ; 00078 } 00079 00080 IService* svc ; 00081 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc); 00082 //if ( sc.isFailure() ) { 00083 // log<<MSG::WARNING << " Cant get RawDataInputSvc " <<endreq; 00084 // return sc ; 00085 //} 00086 m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc); 00087 if ( m_inputSvc == 0 ) { 00088 log<< MSG::WARNING << " Cant cast to RawDataInputSvc " <<endreq; 00089 return StatusCode::FAILURE ; 00090 } 00091 00092 m_cnv = MucConverter::instance(); 00093 00094 return StatusCode::SUCCESS; 00095 }
destination* Converter< Ty1, Ty2 >::operator | ( | const source & | ) | const [inline, inherited] |
virtual long RawDataMucDigiCnv::repSvcType | ( | ) | const [inline, virtual] |
Reimplemented from RawDataBaseCnv.
Definition at line 45 of file RawDataMucDigiCnv.h.
References PACKEDRAWEVENT_StorageType.
00045 { 00046 return PACKEDRAWEVENT_StorageType; 00047 }
static const unsigned char RawDataMucDigiCnv::storageType | ( | ) | [inline, static] |
Reimplemented from RawDataBaseCnv.
Definition at line 49 of file RawDataMucDigiCnv.h.
References PACKEDRAWEVENT_StorageType.
00049 { 00050 return PACKEDRAWEVENT_StorageType; 00051 }
StatusCode RawDataMucDigiCnv::updateObj | ( | IOpaqueAddress * | , | |
DataObject * | ||||
) | [virtual] |
override the RawDataBaseCnv version
Definition at line 98 of file RawDataMucDigiCnv.cxx.
00098 { 00099 // Purpose and Method: This method does nothing other than announce it has 00100 // been called. 00101 00102 //MsgStream log(msgSvc(), "RawDataMucDigiCnv"); 00103 //log << MSG::DEBUG << "RawDataMucDigiCnv::updateObj" << endreq; 00104 return Converter::updateObj(pAddr, pObj); 00105 }
StatusCode RawDataBaseCnv::updateRep | ( | IOpaqueAddress * | pAddress, | |
DataObject * | pObject | |||
) | [virtual, inherited] |
Update the converted representation of a transient object.
Definition at line 36 of file RawDataBaseCnv.cxx.
00037 { 00038 // Purpose and Method: Update the converted representation of a transient 00039 // object. It is expected that derived classes will override this. 00040 return StatusCode::SUCCESS; 00041 }
StatusCode RawDataBaseCnv::updateRepRefs | ( | IOpaqueAddress * | pAddress, | |
DataObject * | pObject | |||
) | [virtual, inherited] |
Update the references of an already converted object.
Definition at line 43 of file RawDataBaseCnv.cxx.
00044 { 00045 // Purpose and Method: Update the references of an already converted object. 00046 // It is expected that derived classes will override this method. 00047 return StatusCode::SUCCESS; 00048 }
friend class CnvFactory< RawDataMucDigiCnv > [friend] |
Definition at line 34 of file RawDataMucDigiCnv.h.
MucConverter* RawDataMucDigiCnv::m_cnv [private] |
EmcConverter for packing or unpacking data.
Definition at line 66 of file RawDataMucDigiCnv.h.
Referenced by createObj(), createRep(), and initialize().
IRawDataCnvSvc* RawDataBaseCnv::m_CnvSvc [protected, inherited] |
Pointer to event conversion service interface.
Definition at line 28 of file RawDataBaseCnv.h.
Referenced by RawDataBaseCnv::finalize().
IRawDataInputSvc* RawDataMucDigiCnv::m_inputSvc [private] |
std::vector<IRawDataCnvSvc::Leaf> RawDataBaseCnv::m_leaves [protected, inherited] |
Leaf objects giving the locations of the objects in the data store.
Definition at line 30 of file RawDataBaseCnv.h.
Define the interface to raw data cnv.
Definition at line 64 of file RawDataMucDigiCnv.h.
Referenced by createRep(), and initialize().