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