57 {
58 StatusCode sc = ConversionSvc::initialize();
59
60 MsgStream log(
msgSvc(),
"CalibRootCnvSvc");
61
62 if (!sc.isSuccess()) return sc;
63
64
65
66 m_detDataSvc = 0;
67
68
69 sc = serviceLocator()->getService
70 ("CalibDataSvc", IDataProviderSvc::interfaceID(),(IInterface*&) m_detDataSvc);
71 if ( !sc.isSuccess() ) {
72 log << MSG::ERROR << "Could not locate CalibDataSvc" << endreq;
73 return sc;
74 }
75
76
77
78
79
80
81 sc = setDataProvider(m_detDataSvc);
82 if ( !sc.isSuccess() ) {
83 log << MSG::ERROR << "Could not set data provider" << endreq;
84 return sc;
85 }
86
87 sc = setProperties();
88
89
90 sc = serviceLocator()->service
91 ("DetectorPersistencySvc", m_detPersSvc, true);
92 if ( !sc.isSuccess() ) {
93 log << MSG::ERROR
94 << "Cannot locate IConversionSvc interface of DetectorPersistencySvc"
95 << endreq;
96 return sc;
97 } else {
98 log << MSG::DEBUG
99 << "Retrieved IConversionSvc interface of DetectorPersistencySvc"
100 << endreq;
101 }
102
103
104 IAddressCreator* iAddrCreator;
105
106
107
108
109 sc = m_detPersSvc->queryInterface(IAddressCreator::interfaceID(),
110 (void**) &iAddrCreator);
111 if ( !sc.isSuccess() ) {
112 log << MSG::ERROR
113 << "Cannot query IAddressCreator interface of DetectorPersistencySvc"
114 << endreq;
115 return sc;
116 } else {
117 log << MSG::DEBUG
118 << "Retrieved IAddressCreator interface of DetectorPersistencySvc"
119 << endreq;
120 }
121 log << MSG::DEBUG
122 << "Set it as the address creator of the CalibRootCnvSvc" << endreq;
123 sc = setAddressCreator(iAddrCreator);
124 if ( !sc.isSuccess() ) {
125 log << MSG::ERROR << "Cannot set the address creator" << endreq;
126 return sc;
127 }
128
129
130
131 return sc;
132}