48{
49 std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc");
50 std::string RawDataInputSvc_Name("RawDataInputSvc");
51 std::string RawDataEmcMcHitCnv_Name("RawDataEmcMcHitCnv");
52
53
54
55
56 SmartIF<IService> pCnvSvc(conversionSvc());
57 if (isGaudiThreaded(pCnvSvc->name())){
58 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
59 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
60 RawDataEmcMcHitCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
61 }
62
63
64 MsgStream log(messageService(), RawDataEmcMcHitCnv_Name.c_str());
65
67 if (StatusCode::SUCCESS != sc) {
68 log << MSG::ERROR << "RawDataBaseCnv: Cant initialize PackedRawDataCnvSvc" << endreq;
69 return sc;
70 }
71
72
73 IService* isvc = 0;
74 sc = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), isvc, true);
75 if (sc != StatusCode::SUCCESS) {
76 log << MSG::ERROR << "Cant get PackedRawDataCnvSvc" << endreq;
77 }
78
79 m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (isvc);
80 if (m_RawDataAccess == 0 ) {
81 log << MSG::ERROR << "RawDataEmcCnv: Cant cast to RawDataCnvSvc " << endreq;
82 return StatusCode::FAILURE;
83 }
84
85 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), isvc);
86 if (sc != StatusCode::SUCCESS ) {
87 log << MSG::WARNING << "Cant get RawDataInputSvc " << endreq;
88 return sc ;
89 }
90
91 m_inputSvc = dynamic_cast<RawDataInputSvc*> (isvc);
92 if (m_inputSvc == 0 ) {
93 log << MSG::WARNING << "Cant cast to RawDataInputSvc " << endreq;
94 return StatusCode::FAILURE ;
95 }
96
97 return StatusCode::SUCCESS;
98}