2#include "GaudiKernel/IDetDataSvc.h"
3#include "GaudiKernel/IConversionSvc.h"
4#include "GaudiKernel/IConverter.h"
6#include "GaudiKernel/MsgStream.h"
7#include "GaudiKernel/SvcFactory.h"
8#include "GaudiKernel/CnvFactory.h"
9#include "GaudiKernel/ISvcLocator.h"
10#include "GaudiKernel/IDataProviderSvc.h"
11#include "GaudiKernel/GenericAddress.h"
23 m_detPersSvc(0), m_detDataSvc(0) {
45 StatusCode sc = ConversionSvc::initialize();
47 MsgStream log(
msgSvc(),
"CalibTreeCnvSvc");
49 if (!sc.isSuccess())
return sc;
56 sc = serviceLocator()->getService
57 (
"CalibDataSvc", IDataProviderSvc::interfaceID(),(IInterface*&) m_detDataSvc);
58 if ( !sc.isSuccess() ) {
59 log << MSG::ERROR <<
"Could not locate CalibDataSvc" << endreq;
68 sc = setDataProvider(m_detDataSvc);
69 if ( !sc.isSuccess() ) {
70 log << MSG::ERROR <<
"Could not set data provider" << endreq;
77 sc = serviceLocator()->service
78 (
"DetectorPersistencySvc", m_detPersSvc,
true);
79 if ( !sc.isSuccess() ) {
81 <<
"Cannot locate IConversionSvc interface of DetectorPersistencySvc"
86 <<
"Retrieved IConversionSvc interface of DetectorPersistencySvc"
91 IAddressCreator* iAddrCreator;
94 sc = m_detPersSvc->queryInterface(IAddressCreator::interfaceID(),
95 (
void**) &iAddrCreator);
96 if ( !sc.isSuccess() ) {
98 <<
"Cannot query IAddressCreator interface of DetectorPersistencySvc"
103 <<
"Retrieved IAddressCreator interface of DetectorPersistencySvc"
107 <<
"Set it as the address creator of the CalibTreeCnvSvc" << endreq;
108 sc = setAddressCreator(iAddrCreator);
109 if ( !sc.isSuccess() ) {
110 log << MSG::ERROR <<
"Cannot set the address creator" << endreq;
122 return ConversionSvc::finalize();
127 const std::string* par,
128 const unsigned long* ip,
129 IOpaqueAddress*& refpAddress) {
131 MsgStream log(
msgSvc(), name() );
133 log << MSG::ERROR <<
"bad storage type" << (int)svc_type << endreq;
134 return StatusCode::FAILURE;
136 std::string dataIdent;
137 std::string fullpath;
148 log << MSG::WARNING<<
"Wrong CLID"<<endreq;
209 return StatusCode::SUCCESS;
215 DataObject* pObject ) {
219 MsgStream log(
msgSvc(),
"CalibTreeCnvSvc" );
222 log << MSG::DEBUG <<
"CalibTreeCnvSvc::updateObj starting ...."<<endreq;
const CLID CLID_Calib_EmcCal
const CLID CLID_Calib_DedxCal
const CLID CLID_Calib_MdcCal
const CLID CLID_Calib_TofCal
unsigned const char CALIBTREE_StorageType
virtual StatusCode finalize()
virtual StatusCode initialize()
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *pObject)
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)