44 {
45 StatusCode sc = ConversionSvc::initialize();
46
47 MsgStream log(
msgSvc(),
"CalibTreeCnvSvc");
48
49 if (!sc.isSuccess()) return sc;
50
51
52
53 m_detDataSvc = 0;
54
55
56 sc = serviceLocator()->getService
57 ("CalibDataSvc", IDataProviderSvc::interfaceID(),(IInterface*&) m_detDataSvc);
58 if ( !sc.isSuccess() ) {
59 log << MSG::ERROR << "Could not locate CalibDataSvc" << endreq;
60 return sc;
61 }
62
63
64
65
66
67
68 sc = setDataProvider(m_detDataSvc);
69 if ( !sc.isSuccess() ) {
70 log << MSG::ERROR << "Could not set data provider" << endreq;
71 return sc;
72 }
73
74 sc = setProperties();
75
76
77 sc = serviceLocator()->service
78 ("DetectorPersistencySvc", m_detPersSvc, true);
79 if ( !sc.isSuccess() ) {
80 log << MSG::ERROR
81 << "Cannot locate IConversionSvc interface of DetectorPersistencySvc"
82 << endreq;
83 return sc;
84 } else {
85 log << MSG::DEBUG
86 << "Retrieved IConversionSvc interface of DetectorPersistencySvc"
87 << endreq;
88 }
89
90
91 IAddressCreator* iAddrCreator;
92
93
94 sc = m_detPersSvc->queryInterface(IAddressCreator::interfaceID(),
95 (void**) &iAddrCreator);
96 if ( !sc.isSuccess() ) {
97 log << MSG::ERROR
98 << "Cannot query IAddressCreator interface of DetectorPersistencySvc"
99 << endreq;
100 return sc;
101 } else {
102 log << MSG::DEBUG
103 << "Retrieved IAddressCreator interface of DetectorPersistencySvc"
104 << endreq;
105 }
106 log << MSG::DEBUG
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;
111 return sc;
112 }
113
114
115
116 return sc;
117}