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"
24 m_detPersSvc(0), m_detDataSvc(0) {
29 void** ppvInterface) {
31 if (IID_ICalibTreeSvc.versionMatch(riid)) {
36 return ConversionSvc::queryInterface(riid, ppvInterface);
40 return StatusCode::SUCCESS;
44 StatusCode sc = ConversionSvc::initialize();
46 MsgStream log(
msgSvc(),
"CalibTreeCnvSvc");
48 if (!sc.isSuccess())
return sc;
55 sc = serviceLocator()->getService
56 (
"CalibDataSvc", IDataProviderSvc::interfaceID(),(IInterface*&) m_detDataSvc);
57 if ( !sc.isSuccess() ) {
58 log << MSG::ERROR <<
"Could not locate CalibDataSvc" << endreq;
67 sc = setDataProvider(m_detDataSvc);
68 if ( !sc.isSuccess() ) {
69 log << MSG::ERROR <<
"Could not set data provider" << endreq;
76 sc = serviceLocator()->service
77 (
"DetectorPersistencySvc", m_detPersSvc,
true);
78 if ( !sc.isSuccess() ) {
80 <<
"Cannot locate IConversionSvc interface of DetectorPersistencySvc"
85 <<
"Retrieved IConversionSvc interface of DetectorPersistencySvc"
90 IAddressCreator* iAddrCreator;
93 sc = m_detPersSvc->queryInterface(IAddressCreator::interfaceID(),
94 (
void**) &iAddrCreator);
95 if ( !sc.isSuccess() ) {
97 <<
"Cannot query IAddressCreator interface of DetectorPersistencySvc"
102 <<
"Retrieved IAddressCreator interface of DetectorPersistencySvc"
106 <<
"Set it as the address creator of the CalibTreeCnvSvc" << endreq;
107 sc = setAddressCreator(iAddrCreator);
108 if ( !sc.isSuccess() ) {
109 log << MSG::ERROR <<
"Cannot set the address creator" << endreq;
121 return ConversionSvc::finalize();
126 const std::string* par,
127 const unsigned long* ip,
128 IOpaqueAddress*& refpAddress) {
130 MsgStream log(
msgSvc(), name() );
132 log << MSG::ERROR <<
"bad storage type" << (int)svc_type << endreq;
133 return StatusCode::FAILURE;
135 std::string dataIdent;
136 std::string fullpath;
147 log << MSG::WARNING<<
"Wrong CLID"<<endreq;
208 return StatusCode::SUCCESS;
214 DataObject* pObject ) {
218 MsgStream log(
msgSvc(),
"CalibTreeCnvSvc" );
221 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 queryInterface(const InterfaceID &riid, void **ppvInterface)
virtual StatusCode finalize()
virtual StatusCode initialize()
CalibTreeCnvSvc(const std::string &name, ISvcLocator *svc)
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)