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