112 bool thereIsACM =
false;
114 bool thereIsASL =
false;
117 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode; inword= " << std::hex << inword << std::dec << std::endl; }
121 CMROS.decodeFragment(inword, recField);
122 PDROS.decodeFragment(inword, recField);
123 RXROS.decodeFragment(inword, recField);
124 SLROS.decodeFragment(inword, recField);
129 if (
SLROS.isHeader()) {
133 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode: SectorLogic Header " << std::endl; }
136 SLRO.writeRecord(inword,
false);
139 }
else if (
SLROS.isFooter()) {
143 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode: SectorLogic Footer " << std::endl; }
146 SLRO.writeRecord(inword,
true);
152 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode: SectorLogic Body " << std::endl; }
153 SLRO.writeRecord(inword,
false);
156 }
else if (
RXROS.isHeader()) {
160 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode: RX Header " << std::endl; }
162 RXROS.decodeFragment(inword, recField);
171 std::cout <<
" RPCRODDecode Fragment problem: CM SubHeader expected and RX Header found" << std::endl;
174 CMRO.writeRecord(inword,
true);
179 std::cout <<
" RPCRODDecode Fragment problem: CM Body expected and and RX Header found" << std::endl;
182 CMRO.writeRecord(inword,
true);
187 std::cout <<
" RPCRODDecode Fragment problem: CM Body or Footer expected and RX Header found" << std::endl;
190 CMRO.writeRecord(inword,
true);
195 std::cout <<
" RPCRODDecode Fragment problem: CM Header or Pad Footer expected and RX Header found" << std::endl;
199 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: PadSubHeader expected" << std::endl; }
202 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA fragment expected" << std::endl; }
205 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA Footer expected" << std::endl; }
208 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: Pad PreFooter expected" << std::endl; }
211 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode ERROR in previousRecord " << std::endl; }
215 }
else if (
RXROS.isFooter()) {
221 RXROS.decodeFragment(inword, recField);
222 if (recField ==
'F') {}
230 std::cout <<
" RPCRODDecode Fragment problem: CM SubHeader expected and RX Footer found" << std::endl;
233 CMRO.writeRecord(inword,
true);
237 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CM Body expected and RX Footer found" << std::endl; }
239 CMRO.writeRecord(inword,
true);
244 std::cout <<
" RPCRODDecode Fragment problem: CM Body or Footer expected and and RX Footer found" << std::endl;
247 CMRO.writeRecord(inword,
true);
252 std::cout <<
" RPCRODDecode Fragment problem: CM Header or Pad Footer expected and RX Footer found" << std::endl;
256 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: PadSubHeader expected" << std::endl; }
259 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA fragment expected" << std::endl; }
262 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA Footer expected" << std::endl; }
265 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: Pad PreFooter expected" << std::endl; }
268 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode ERROR in previousRecord " << std::endl; }
272 }
else if (
PDROS.isHeader()) {
276 if (
m_enablePrintOut) { std::cout <<
" PAD Header " << std::hex << inword << std::dec << std::endl; }
278 PDROS.decodeFragment(inword, recField);
279 if (recField ==
'H') {
PadID =
PDROS.padid(); }
282 std::cout <<
" PAD " <<
PadID <<
" LVL1 " << std::hex << ((inword & 0x0e00) >> 8) << std::dec << std::endl;
288 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CM SubHeader expected and not found" << std::endl; }
290 CMRO.writeRecord(inword,
true);
294 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CM Body expected and not found" << std::endl; }
296 CMRO.writeRecord(inword,
true);
301 std::cout <<
" RPCRODDecode Fragment problem: CM Body or Footer expected and not found" << std::endl;
304 CMRO.writeRecord(inword,
true);
309 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: PadSubHeader expected" << std::endl; }
312 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA fragment expected" << std::endl; }
315 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA Footer expected" << std::endl; }
318 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: Pad PreFooter expected" << std::endl; }
321 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode ERROR in previousRecord " << std::endl; }
325 }
else if (
PDROS.isSubHeader()) {
329 if (
m_enablePrintOut) { std::cout <<
" BCID " << std::hex << (inword & 0x0fff) << std::dec << std::endl; }
333 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CM SubHeader expected and not found" << std::endl; }
335 CMRO.writeRecord(inword,
true);
339 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CM Body expected and not found" << std::endl; }
341 CMRO.writeRecord(inword,
true);
346 std::cout <<
" RPCRODDecode Fragment problem: CM Body or Footer expected and not found" << std::endl;
349 CMRO.writeRecord(inword,
true);
353 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: Pad Header expected and not found" << std::endl; }
356 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: PadSubHeader expected" << std::endl; }
359 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA fragment expected" << std::endl; }
362 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA Footer expected" << std::endl; }
365 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: Pad PreFooter expected" << std::endl; }
368 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode ERROR in previousRecord " << std::endl; }
372 }
else if (
PDROS.isPreFooter()) {
376 if (
m_enablePrintOut) { std::cout <<
" STATUS ERROR " << std::hex << (inword & 0x000f) << std::dec << std::endl; }
380 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CM SubHeader expected and not found" << std::endl; }
382 CMRO.writeRecord(inword,
true);
386 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CM Body expected and not found" << std::endl; }
388 CMRO.writeRecord(inword,
true);
393 std::cout <<
" RPCRODDecode Fragment problem: CM Body or Footer expected and not found" << std::endl;
396 CMRO.writeRecord(inword,
true);
401 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: PadSubHeader expected" << std::endl; }
404 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA fragment expected" << std::endl; }
407 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA Footer expected" << std::endl; }
410 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: Pad PreFooter expected" << std::endl; }
413 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode ERROR in previousRecord " << std::endl; }
417 }
else if (
PDROS.isFooter()) {
422 std::cout <<
" PAD Footer " << std::hex << inword << std::dec <<
" ERROR FLAG " << std::hex << (inword & 0x0fff) << std::dec
426 PDROS.decodeFragment(inword, recField);
427 if (recField ==
'F') {}
434 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CM SubHeader expected and not found" << std::endl; }
436 CMRO.writeRecord(inword,
true);
440 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CM Body expected and not found" << std::endl; }
442 CMRO.writeRecord(inword,
true);
447 std::cout <<
" RPCRODDecode Fragment problem: CM Body or Footer expected and not found" << std::endl;
450 CMRO.writeRecord(inword,
true);
454 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: Pad PreFooter expected and not found" << std::endl; }
457 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: PadSubHeader expected" << std::endl; }
461 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA Footer expected" << std::endl; }
464 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: Pad PreFooter expected" << std::endl; }
467 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode ERROR in previousRecord " << std::endl; }
471 }
else if (
CMROS.isHeader()) {
477 CMRO.writeRecord(inword,
false);
483 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode warning: CM SubHeader expected and CM Header found" << std::endl; }
488 std::cout <<
" RPCRODDecode warning: CM Body or CM Footer expected and CM Header found" << std::endl;
493 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: PadSubHeader expected" << std::endl; }
496 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA fragment expected" << std::endl; }
499 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA Footer expected" << std::endl; }
502 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: Pad PreFooter expected" << std::endl; }
505 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode ERROR in previousRecord " << std::endl; }
509 }
else if (
CMROS.isSubHeader()) {
514 CMRO.writeRecord(inword,
false);
519 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode warning: previous record was not a CM Header" << std::endl; }
523 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode warning: CM Body expected and CM SubHeader found" << std::endl; }
527 std::cout <<
" RPCRODDecode warning: CM Body or CM Footer expected; CM SubHeader found" << std::endl;
532 std::cout <<
" RPCRODDecode warning: CM Header or Pad Footer expected; CM SubHeader found" << std::endl;
536 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: PadSubHeader expected" << std::endl; }
539 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA fragment expected" << std::endl; }
542 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA Footer expected" << std::endl; }
545 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: Pad PreFooter expected" << std::endl; }
548 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode ERROR in previousRecord " << std::endl; }
552 }
else if (
CMROS.isBody()) {
562 std::cout <<
" RPCRODDecode (CMBody1) warning: previous record was not a CM subHeader"
563 <<
" or CM Body Record " << std::endl;
568 std::cout <<
" RPCRODDecode (CMBody2) warning: previous record was not a CM subHeader"
569 <<
" or CM Body Record " << std::endl;
576 std::cout <<
" RPCRODDecode (CMBody3) warning: previous record was not a CM subHeader"
577 <<
" or CM Body Record " << std::endl;
581 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: PadSubHeader expected" << std::endl; }
584 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA fragment expected" << std::endl; }
587 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA Footer expected" << std::endl; }
590 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: Pad PreFooter expected" << std::endl; }
593 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode ERROR in previousRecord=" << std::endl; }
597 }
else if (
CMROS.isFooter()) {
604 CMRO.writeRecord(inword,
true);
610 std::cout <<
" RPCRODDecode (CMFooter1) warning: previous record was not a Body record " << std::endl;
615 std::cout <<
" RPCRODDecode (CMFooter2) warning: previous record was not a Body record" << std::endl;
619 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode warning: previous record was not a Body record" << std::endl; }
624 std::cout <<
" RPCRODDecode (CMFooter3) warning: previous record was not a Body record" << std::endl;
628 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: PadSubHeader expected" << std::endl; }
631 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA fragment expected" << std::endl; }
634 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA Footer expected" << std::endl; }
637 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: Pad PreFooter expected" << std::endl; }
640 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode ERROR in previousRecord" << std::endl; }
658 std::cout <<
" RPCRODDecode Fragment problem: CM SubHeader expected and (reserved) found" << std::endl;
661 CMRO.writeRecord(inword,
true);
665 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CM Body expected and (reserved) found" << std::endl; }
667 CMRO.writeRecord(inword,
true);
672 std::cout <<
" RPCRODDecode Fragment problem: CM Body or Footer expected and (reserved) found" << std::endl;
675 CMRO.writeRecord(inword,
true);
680 std::cout <<
" RPCRODDecode Fragment problem: CM Header or Pad Footer expected and (reserved) found" << std::endl;
684 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: PadSubHeader expected" << std::endl; }
687 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA fragment expected" << std::endl; }
690 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: CMA Footer expected" << std::endl; }
693 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode Fragment problem: Pad PreFooter expected" << std::endl; }
696 if (
m_enablePrintOut) { std::cout <<
" RPCRODDecode ERROR in previousRecord " << std::endl; }
702 if (thereIsACM) answer = 1;
703 if (thereIsASL) answer = 2;