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