49 std::string PackedRawDataCnvSvc_Name(
"PackedRawDataCnvSvc");
50 std::string RawDataInputSvc_Name(
"RawDataInputSvc");
51 std::string RawDataEmcMcHitCnv_Name(
"RawDataEmcMcHitCnv");
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());
64 MsgStream log(messageService(), RawDataEmcMcHitCnv_Name.c_str());
67 if (StatusCode::SUCCESS != sc) {
68 log << MSG::ERROR <<
"RawDataBaseCnv: Cant initialize PackedRawDataCnvSvc" << endreq;
74 sc = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), isvc,
true);
75 if (sc != StatusCode::SUCCESS) {
76 log << MSG::ERROR <<
"Cant get PackedRawDataCnvSvc" << endreq;
80 if (m_RawDataAccess == 0 ) {
81 log << MSG::ERROR <<
"RawDataEmcCnv: Cant cast to RawDataCnvSvc " << endreq;
82 return StatusCode::FAILURE;
85 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), isvc);
86 if (sc != StatusCode::SUCCESS ) {
87 log << MSG::WARNING <<
"Cant get RawDataInputSvc " << endreq;
92 if (m_inputSvc == 0 ) {
93 log << MSG::WARNING <<
"Cant cast to RawDataInputSvc " << endreq;
94 return StatusCode::FAILURE ;
97 return StatusCode::SUCCESS;
118 RAWEVENT *evt = m_inputSvc->currentEvent();
122 return StatusCode::FAILURE;
130 std::vector<uint32_t>::const_iterator
iter = evt->
getEmcTruth().begin();
131 std::vector<uint32_t>::const_iterator eiter = evt->
getEmcTruth().end();
133 for (
int emcMcHitId = 0;
iter != eiter; emcMcHitId++) {
135 m_emcMcHitBuilder.unPack(
iter, eiter, m_EmcTruth);
140 m_EmcTruth.
x/(m_emcMcHitBuilder.m_xCoeff*1.0),
141 m_EmcTruth.
y/(m_emcMcHitBuilder.m_yCoeff*1.0),
142 m_EmcTruth.
z/(m_emcMcHitBuilder.m_zCoeff*1.0),
143 m_EmcTruth.
px/(m_emcMcHitBuilder.m_pxCoeff*1.0),
144 m_EmcTruth.
py/(m_emcMcHitBuilder.m_pyCoeff*1.0),
145 m_EmcTruth.
pz/(m_emcMcHitBuilder.m_pzCoeff*1.0),
146 m_EmcTruth.
totalEdep/(m_emcMcHitBuilder.m_totalEdepCoeff*1.0) );
148 emcMcHitCol->push_back(emcMcHit);
151 return StatusCode::SUCCESS;