7 #include "GaudiKernel/MsgStream.h"
14 m_key_DigitCollection(
"ALFA_DigitCollection"),
15 m_key_ODDigitCollection(
"ALFA_ODDigitCollection")
80 for (
int k=0;
k<23;
k++)
82 for (
int i=0;
i<64;
i++)
169 return StatusCode::SUCCESS;
184 if ( sc_read != StatusCode::SUCCESS ) {
185 msg(MSG::ERROR) <<
"ALFA_Raw2Digit: Could not find container" <<
endmsg;
186 return StatusCode::SUCCESS;
189 else if ( sc_read == StatusCode::SUCCESS ) {
196 if (
sc.isFailure()) {
197 msg(MSG::WARNING) <<
"ALFA_Raw2Digit: recordCollection failed" <<
endmsg;
198 return StatusCode::SUCCESS;
204 if (
sc.isFailure()) {
205 msg(MSG::WARNING) <<
"ALFA_Raw2Digit, recordODCollection failed" <<
endmsg;
206 return StatusCode::SUCCESS;
210 for (
unsigned int i=0;
i<8;
i++) {
212 for (
unsigned int j=0;j<20;j++) {
214 for (
unsigned int k=0;
k<64;
k++) {
218 for (
unsigned int k=0;
k<16;
k++) {
235 for(;RawData_Collection_Beg!=RawData_Collection_End; ++RawData_Collection_Beg)
237 m_mbID = ((*RawData_Collection_Beg)->GetMBId_POT());
253 for (
unsigned int i=0;
i<16;
i++) {
262 for(;p_RawData_Beg!=p_RawData_End; ++p_RawData_Beg)
266 if ((*p_RawData_Beg)->GetPMFId_PMF()>0 && ((*p_RawData_Beg)->GetWordId_PMF())<24)
268 m_pmfID= (*p_RawData_Beg)->GetPMFId_PMF();
274 msg(
MSG::DEBUG) <<
" pmfId = " << (*p_RawData_Beg)->GetPMFId_PMF() <<
", MBId = " << (*p_RawData_Beg)->GetMBId_PMF() <<
endmsg;
279 for (
unsigned int i=0;
i<16;
i++)
281 if ((*p_RawData_Beg)->Get_Chan(
i)!=100)
283 msg(
MSG::DEBUG) <<
"ALFA_Raw2Digit, maroc chanel # = " << (*p_RawData_Beg)->Get_Chan(
i)<<
endmsg;
285 m_fibID = (*p_RawData_Beg)->Get_Chan(
i);
379 return StatusCode::SUCCESS;
476 return StatusCode::SUCCESS;
487 if (
sc.isFailure()) {
msg (
MSG::FATAL) <<
" MD - Could not record the empty digit collection in StoreGate " <<
endmsg;
return sc; }
500 if (
sc.isFailure()) {
msg (
MSG::FATAL) <<
" OD - Could not record the empty digit collection in StoreGate " <<
endmsg;
return sc; }
520 int OD_MaPmtChan = 0;
538 for (
unsigned int j=0; j<8; j++)
558 throw std::runtime_error(
"FATAL: mapping MD maroc-mapmt not found in Datapath.");
573 for (
unsigned int i=0;
i<1280;
i++){
575 m_inChan >> iLayer >> MarChan >> MapChan >> FibChan;
577 msg(
MSG::DEBUG) <<
i <<
" maroc_mapmt_fiber, layer = " << iLayer <<
", maroc = " << MarChan <<
", map = "<< MapChan <<
", fib = " << FibChan <<
endmsg;
579 if ((MarChan < 0) || (MarChan > 63))
581 std::string
s1(
"MarChan out of range; file corrupted");
582 throw std::runtime_error(
s1);
585 if ((MapChan < 0) || (MapChan > 63))
587 std::string
s2(
"MapChan out of range; file corrupted");
588 throw std::runtime_error(
s2);
591 if ((iLayer < 0) || (iLayer > 19))
593 std::string
s2(
"Layer out of range; file corrupted");
594 throw std::runtime_error(
s2);
609 return StatusCode::FAILURE;
623 throw std::runtime_error(
"FATAL: mapping PMF_LAYER_MD not found in Datapath.");
635 for (
unsigned int i=0;
i<20;
i++)
640 if ((PMFNum < 0) || ( PMFNum > 22))
642 std::string
s3(
"PMFNum out of range; file corrupted");
643 throw std::runtime_error(
s3);
655 return StatusCode::FAILURE;
669 throw std::runtime_error(
"FATAL: mapping OD_MAP not found in Datapath.");
681 for(
unsigned int jlay=0; jlay<3; jlay++)
683 for(
unsigned int jside=0; jside<2; jside++)
685 for(
unsigned int jch=0; jch<32; jch++)
687 m_inOD >> OD_PMFNum >> OD_Dieter >> OD_LAYNum >> OD_Side >> OD_MaPmtChan >> OD_FibChan;
688 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;
690 if ((OD_PMFNum < 2) || ( OD_PMFNum > 4))
692 std::string
s4(
"OD_PMFNum out of range; file corrupted");
693 throw std::runtime_error(
s4);
696 if ((OD_MaPmtChan < 1) || ( OD_MaPmtChan > 64))
698 std::string s5(
"OD_MaPmtChan out of range; file corrupted");
699 throw std::runtime_error(s5);
709 if ((OD_LAYNum > 0) && ( OD_LAYNum < 4))
730 return StatusCode::FAILURE;
734 return StatusCode::SUCCESS;
743 if (
int(fmod(
double(
m_maroc2mapmt[pot_n][iLayer][MarChan]+1),
double(8)))>0)
748 chan_j=9-
int(fmod(
double(
m_maroc2mapmt[pot_n][iLayer][MarChan]+1),
double(8)));
758 return StatusCode::SUCCESS;