52 std::string PackedRawDataCnvSvc_Name(
"PackedRawDataCnvSvc");
53 std::string RawDataInputSvc_Name(
"RawDataInputSvc");
54 std::string RawDataMdcMcHitCnv_Name(
"RawDataMdcMcHitCnv");
59 SmartIF<IService> pCnvSvc(conversionSvc());
60 if (isGaudiThreaded(pCnvSvc->name())){
61 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
62 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
63 RawDataMdcMcHitCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
67 MsgStream log(messageService(), RawDataMdcMcHitCnv_Name.c_str());
70 if (StatusCode::SUCCESS != sc) {
71 log << MSG::ERROR <<
"RawDataBaseCnv: Cant initialize PackedRawDataCnvSvc" << endreq;
77 sc = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), isvc,
true);
78 if (sc != StatusCode::SUCCESS) {
79 log << MSG::ERROR <<
"Cant get PackedRawDataCnvSvc" << endreq;
83 if (m_RawDataAccess == 0 ) {
84 log << MSG::ERROR <<
"RawDataMdcCnv: Cant cast to RawDataCnvSvc " << endreq;
85 return StatusCode::FAILURE;
89 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc);
90 if (sc != StatusCode::SUCCESS ) {
91 log << MSG::WARNING <<
"Cant get RawDataInputSvc " << endreq;
96 if (m_inputSvc == 0 ) {
97 log << MSG::WARNING <<
"Cant cast to RawDataInputSvc " << endreq;
98 return StatusCode::FAILURE ;
101 return StatusCode::SUCCESS;
123 RAWEVENT *evt = m_inputSvc->currentEvent();
126 return StatusCode::FAILURE;
134 std::vector<uint32_t>::const_iterator
iter = evt->
getMdcTruth().begin();
135 std::vector<uint32_t>::const_iterator eiter = evt->
getMdcTruth().end();
137 for (
int mdcMcHitId = 0;
iter != eiter; mdcMcHitId++) {
139 m_mdcMcHitBuilder.unPack(
iter, eiter, m_MdcTruth);
144 m_MdcTruth.
x/(m_mdcMcHitBuilder.m_xCoeff*1.0),
145 m_MdcTruth.
y/(m_mdcMcHitBuilder.m_yCoeff*1.0),
146 m_MdcTruth.
z/(m_mdcMcHitBuilder.m_zCoeff*1.0),
147 m_MdcTruth.
driftD/(m_mdcMcHitBuilder.m_driftDCoeff*1.0),
148 m_MdcTruth.
edep/(m_mdcMcHitBuilder.m_edepCoeff*1.0),
151 mdcMcHitCol->push_back(mdcMcHit);
154 return StatusCode::SUCCESS;