7 #include "GaudiKernel/MsgStream.h"
82 for (
int k=0;
k<23;
k++)
84 for (
int i=0;
i<64;
i++)
171 return StatusCode::SUCCESS;
186 if ( sc_read != StatusCode::SUCCESS ) {
187 msg(MSG::ERROR) <<
"ALFA_Raw2Digit: Could not find container" <<
endmsg;
188 return StatusCode::SUCCESS;
191 else if ( sc_read == StatusCode::SUCCESS ) {
198 if (
sc.isFailure()) {
199 msg(MSG::WARNING) <<
"ALFA_Raw2Digit: recordCollection failed" <<
endmsg;
200 return StatusCode::SUCCESS;
206 if (
sc.isFailure()) {
207 msg(MSG::WARNING) <<
"ALFA_Raw2Digit, recordODCollection failed" <<
endmsg;
208 return StatusCode::SUCCESS;
212 for (
unsigned int i=0;
i<8;
i++) {
214 for (
unsigned int j=0;j<20;j++) {
216 for (
unsigned int k=0;
k<64;
k++) {
220 for (
unsigned int k=0;
k<16;
k++) {
237 for(;RawData_Collection_Beg!=RawData_Collection_End; ++RawData_Collection_Beg)
239 m_mbID = ((*RawData_Collection_Beg)->GetMBId_POT());
255 for (
unsigned int i=0;
i<16;
i++) {
264 for(;p_RawData_Beg!=p_RawData_End; ++p_RawData_Beg)
268 if ((*p_RawData_Beg)->GetPMFId_PMF()>0 && ((*p_RawData_Beg)->GetWordId_PMF())<24)
270 m_pmfID= (*p_RawData_Beg)->GetPMFId_PMF();
276 msg(
MSG::DEBUG) <<
" pmfId = " << (*p_RawData_Beg)->GetPMFId_PMF() <<
", MBId = " << (*p_RawData_Beg)->GetMBId_PMF() <<
endmsg;
281 for (
unsigned int i=0;
i<16;
i++)
283 if ((*p_RawData_Beg)->Get_Chan(
i)!=100)
285 msg(
MSG::DEBUG) <<
"ALFA_Raw2Digit, maroc chanel # = " << (*p_RawData_Beg)->Get_Chan(
i)<<
endmsg;
287 m_fibID = (*p_RawData_Beg)->Get_Chan(
i);
381 return StatusCode::SUCCESS;
478 return StatusCode::SUCCESS;
489 if (
sc.isFailure()) {
msg (
MSG::FATAL) <<
" MD - Could not record the empty digit collection in StoreGate " <<
endmsg;
return sc; }
502 if (
sc.isFailure()) {
msg (
MSG::FATAL) <<
" OD - Could not record the empty digit collection in StoreGate " <<
endmsg;
return sc; }
522 int OD_MaPmtChan = 0;
540 for (
unsigned int j=0; j<8; j++)
560 throw std::runtime_error(
"FATAL: mapping MD maroc-mapmt not found in Datapath.");
575 for (
unsigned int i=0;
i<1280;
i++){
577 m_inChan >> iLayer >> MarChan >> MapChan >> FibChan;
579 msg(
MSG::DEBUG) <<
i <<
" maroc_mapmt_fiber, layer = " << iLayer <<
", maroc = " << MarChan <<
", map = "<< MapChan <<
", fib = " << FibChan <<
endmsg;
581 if ((MarChan < 0) || (MarChan > 63))
583 std::string
s1(
"MarChan out of range; file corrupted");
584 throw std::runtime_error(
s1);
587 if ((MapChan < 0) || (MapChan > 63))
589 std::string
s2(
"MapChan out of range; file corrupted");
590 throw std::runtime_error(
s2);
593 if ((iLayer < 0) || (iLayer > 19))
595 std::string
s2(
"Layer out of range; file corrupted");
596 throw std::runtime_error(
s2);
611 return StatusCode::FAILURE;
625 throw std::runtime_error(
"FATAL: mapping PMF_LAYER_MD not found in Datapath.");
637 for (
unsigned int i=0;
i<20;
i++)
642 if ((PMFNum < 0) || ( PMFNum > 22))
644 std::string
s3(
"PMFNum out of range; file corrupted");
645 throw std::runtime_error(
s3);
657 return StatusCode::FAILURE;
671 throw std::runtime_error(
"FATAL: mapping OD_MAP not found in Datapath.");
683 for(
unsigned int jlay=0; jlay<3; jlay++)
685 for(
unsigned int jside=0; jside<2; jside++)
687 for(
unsigned int jch=0; jch<32; jch++)
689 m_inOD >> OD_PMFNum >> OD_Dieter >> OD_LAYNum >> OD_Side >> OD_MaPmtChan >> OD_FibChan;
690 msg(
MSG::DEBUG) <<
" pmf2layer, OD_PMFNum = " << OD_PMFNum <<
", OD_Dieter = "<< OD_Dieter <<
", OD_LAYNum = " << OD_LAYNum <<
", OD_Side = " << OD_Side <<
", OD_MaPmtChan = " << OD_MaPmtChan <<
", OD_FibChan = " << OD_FibChan <<
endmsg;
692 if ((OD_PMFNum < 2) || ( OD_PMFNum > 4))
694 std::string
s4(
"OD_PMFNum out of range; file corrupted");
695 throw std::runtime_error(
s4);
698 if ((OD_MaPmtChan < 1) || ( OD_MaPmtChan > 64))
700 std::string s5(
"OD_MaPmtChan out of range; file corrupted");
701 throw std::runtime_error(s5);
711 if ((OD_LAYNum > 0) && ( OD_LAYNum < 4))
732 return StatusCode::FAILURE;
736 return StatusCode::SUCCESS;
745 if (
int(fmod(
double(
m_maroc2mapmt[pot_n][iLayer][MarChan]+1),
double(8)))>0)
750 chan_j=9-
int(fmod(
double(
m_maroc2mapmt[pot_n][iLayer][MarChan]+1),
double(8)));
760 return StatusCode::SUCCESS;