#include <RawDataEvtHeaderCnv.h>
Inheritance diagram for RawDataEvtHeaderCnv:
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 | 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. | |
destination * | operator (const source &) const |
Static Public Member Functions | |
static const CLID & | classID () |
static const unsigned char | storageType () |
Protected Member Functions | |
RawDataEvtHeaderCnv (ISvcLocator *svc) | |
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 |
IRawDataCnvSvc * | m_RawDataAccess |
Define the interface to raw data cnv. | |
Friends | |
class | CnvFactory< RawDataEvtHeaderCnv > |
Definition at line 17 of file RawDataEvtHeaderCnv.h.
typedef Ty2 Converter< Ty1, Ty2 >::destination [inherited] |
Definition at line 19 of file Converter.h.
Definition at line 18 of file Converter.h.
RawDataEvtHeaderCnv::RawDataEvtHeaderCnv | ( | ISvcLocator * | svc | ) | [protected] |
Definition at line 15 of file RawDataEvtHeaderCnv.cxx.
00015 : 00016 RawDataBaseCnv(PACKEDRAWEVENT_StorageType, classID(), svc) 00017 { 00018 // for Mutil-thread by tianhl 00019 //init(); 00020 // for Mutil-thread by tianhl 00021 }
const CLID & RawDataEvtHeaderCnv::classID | ( | ) | [static] |
Reimplemented from RawDataBaseCnv.
Definition at line 73 of file RawDataEvtHeaderCnv.cxx.
References CLID_EventHeader.
Referenced by PackedRawDataCnvSvc::addConverters().
00074 { 00075 return CLID_EventHeader; 00076 }
virtual destination* Converter< Ty1, Ty2 >::convert | ( | const source & | ) | const [protected, pure virtual, inherited] |
StatusCode RawDataEvtHeaderCnv::createObj | ( | IOpaqueAddress * | pAddr, | |
DataObject *& | pObj | |||
) |
Definition at line 85 of file RawDataEvtHeaderCnv.cxx.
References IRawDataInputSvc::currentEvent(), RAWEVENT::eventHeader(), EVENT::header, and m_inputSvc.
00086 { 00087 StatusCode sc; 00088 RawDataAddress *pEFAddr; 00089 const RAWEVENT *evt; 00090 00091 Event::EventHeader *header = new Event::EventHeader(); 00092 pObj = header; 00093 00094 //if ( (pEFAddr = dynamic_cast<RawDataAddress*>(pAddr)) ) { 00095 evt = m_inputSvc->currentEvent(); 00096 00097 if (evt == NULL) return StatusCode::FAILURE; 00098 00099 header->setEventNumber(evt->eventHeader().event_number()); 00100 header->setRunNumber(evt->eventHeader().run_number()); 00101 header->setTime(evt->eventHeader().time()); 00102 header->setFlag1( evt->eventHeader().flag1() ); 00103 //header->setFlag2( evt->eventHeader().flag2() ); 00104 00105 00106 return StatusCode::SUCCESS; 00107 //} 00108 //else { 00109 // return StatusCode::FAILURE; 00110 //} 00111 00112 }
StatusCode RawDataBaseCnv::createRep | ( | DataObject * | pObject, | |
IOpaqueAddress *& | refpAddress | |||
) | [virtual, inherited] |
Convert the transient object to the requested representation.
Reimplemented in RawDataCnv, RawDataDigiCnv, RawDataEmcDigiCnv, RawDataEmcMcHitCnv, RawDataHltCnv, RawDataHltRawCnv, RawDataLumiDigiCnv, RawDataMcCnv, RawDataMcParticleCnv, RawDataMdcDigiCnv, RawDataMdcMcHitCnv, RawDataMucDigiCnv, RawDataMucMcHitCnv, RawDataTofDigiCnv, RawDataTofMcHitCnv, RawDataTrigCnv, RawDataTrigGTDCnv, and RawDataZddEventCnv.
Definition at line 21 of file RawDataBaseCnv.cxx.
00022 { 00023 // Purpose and Method: Convert the transient object to the requested 00024 // representation. It is expected that derived classes will override 00025 // this method. 00026 return StatusCode::SUCCESS; 00027 }
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 RawDataEvtHeaderCnv::initialize | ( | ) |
Reimplemented from RawDataBaseCnv.
Definition at line 23 of file RawDataEvtHeaderCnv.cxx.
References calibUtil::ERROR, RawDataBaseCnv::initialize(), m_inputSvc, m_RawDataAccess, deljobs::string, and Bes_Common::WARNING.
00024 { 00025 StatusCode sc = RawDataBaseCnv::initialize(); 00026 if ( sc.isFailure() ) return sc; 00027 00028 std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc"); 00029 std::string RawDataInputSvc_Name("RawDataInputSvc"); 00030 std::string RawDataEvtHeaderCnv_Name("RawDataEvtHeaderCnv"); 00031 00032 // for Mutil-thread by tianhl 00033 //ConversionSvc* pCnvSvc = 0; 00034 //if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){ 00035 SmartIF<IService> pCnvSvc(conversionSvc()); 00036 if (isGaudiThreaded(pCnvSvc->name())){ 00037 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name()); 00038 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name()); 00039 RawDataEvtHeaderCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name()); 00040 } 00041 //} 00042 // for Mutil-thread by tianhl 00043 MsgStream log(messageService(), RawDataEvtHeaderCnv_Name.c_str()); 00044 00045 IService* svc = 0; 00046 sc = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), svc); 00047 if ( sc.isFailure() ) { 00048 log << MSG::ERROR << "Can't get RawDataAccess interface" << endreq; 00049 return StatusCode::FAILURE; 00050 } 00051 00052 m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (svc); 00053 if (m_RawDataAccess == 0 ) { 00054 log << MSG::ERROR << "RawDataEvtHeaderCnv: Cant cast to RawDataCnvSvc" << endreq; 00055 return StatusCode::FAILURE; 00056 } 00057 00058 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc); 00059 if ( sc.isFailure() ) { 00060 log << MSG::WARNING << "Cant get RawDataInputSvc " << endreq; 00061 return sc ; 00062 } 00063 00064 m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc); 00065 if ( m_inputSvc == 0 ) { 00066 log << MSG::ERROR << "Cant cast to RawDataInputSvc" << endreq; 00067 return StatusCode::FAILURE ; 00068 } 00069 00070 return StatusCode::SUCCESS; 00071 }
destination* Converter< Ty1, Ty2 >::operator | ( | const source & | ) | const [inline, inherited] |
virtual long RawDataEvtHeaderCnv::repSvcType | ( | ) | const [inline, virtual] |
Reimplemented from RawDataBaseCnv.
Definition at line 32 of file RawDataEvtHeaderCnv.h.
References PACKEDRAWEVENT_StorageType.
00032 { 00033 return PACKEDRAWEVENT_StorageType; 00034 }
static const unsigned char RawDataEvtHeaderCnv::storageType | ( | ) | [inline, static] |
Reimplemented from RawDataBaseCnv.
Definition at line 36 of file RawDataEvtHeaderCnv.h.
References PACKEDRAWEVENT_StorageType.
00036 { 00037 return PACKEDRAWEVENT_StorageType; 00038 }
StatusCode RawDataEvtHeaderCnv::updateObj | ( | IOpaqueAddress * | , | |
DataObject * | ||||
) | [virtual] |
override the RawDataBaseCnv version
Definition at line 78 of file RawDataEvtHeaderCnv.cxx.
00078 { 00079 //MsgStream log(msgSvc(), "RawDataEvtHeaderCnv"); 00080 //log << MSG::DEBUG << "RawDataEvtHeaderCnv::updateObj" << endreq; 00081 return Converter::updateObj(pAddr, pObj); 00082 }
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< RawDataEvtHeaderCnv > [friend] |
Definition at line 20 of file RawDataEvtHeaderCnv.h.
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* RawDataEvtHeaderCnv::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 49 of file RawDataEvtHeaderCnv.h.
Referenced by initialize().