510 int s,
c,
f, nfrag,
ngain,
nchan, nsamp,
size,
ch,
extra = 0,
pmt, fragType, nhits = 0;
511 int id,
type, rflag,
unit, pulse, nsmpl, algor, niter;
512 const unsigned int*
data;
514 char fr[2] = {
'F',
'R' };
515 char gb[2] = {
'G',
'B' };
516 std::string unitName[4] = {
"ADC count",
"pCb",
"Cs pCb",
"MeV" };
517 std::string shapeName[4] = {
"Phys",
"Laser",
"CIS",
"Simul" };
518 std::string
algName[8] = {
"Unknown",
"OF1",
"OF2",
"Fit",
"ManyAmps",
"Flat",
"Alg6",
"Alg7" };
519 boost::io::ios_base_all_saver coutsave(std::cout);
528 bool isFrag5 =
false;
530 std::vector<unsigned int> OFC;
534 bool beamROD = (subdet_id == 0x50 || subdet_id >= 0x60);
535 if (subdet_id >= 0x60) {
546 for (
f = 0;
f < nfrag; ++
f) {
548 id = frag[
f]->id & 0xFFFF;
549 type = (frag[
f]->id >> 16) & 0xFF;
550 rflag = (frag[
f]->id) >> 24;
551 unit = (rflag & 0xC0) >> 6;
552 pulse = (rflag & 0x30) >> 4;
553 nsmpl = (rflag & 0x08) >> 3;
554 algor = (rflag & 0x04) >> 2;
555 niter = (rflag & 0x03);
557 data = frag[
f]->data;
561 const unsigned char *
adc;
562 const unsigned short *
result;
563 int tmdb_ch1 =
std::min(5U,((robsourceid)>>16)&0xF);
564 bool EB = (tmdb_ch1>2);
566 int tmdb_ch2 = (((robsourceid))&0xF)*nmod;
567 const char * dr56EB[10] = {
"D5-L",
"D5-R",
"D6-L",
"D6-R",
"D4-L",
"D4-R",
"XX-X",
"XX-X",
"XX-X",
"XX-X" };
568 const char * dr56LB[10] = {
"D0-x",
"D1-L",
"D1-R",
"D2-L",
"D2-R",
"D3-L",
"D3-R",
"B8-L",
"B8-R",
"XX-X" };
569 const char ** dr56rl = (
EB) ? dr56EB : dr56LB;
570 const char * ch11[6] = {
"AUX",
"LBA",
"LBC",
"EBA",
"EBC",
"UNK" };
571 const char * ch12[6] = {
"aux",
"lba",
"lbc",
"eba",
"ebc",
"unk" };
572 const char * dr56hlEB[4] = {
" D6L ",
" D6H ",
" D56L",
" D56H"};
573 const char * dr56hlLB[4] = {
" DxL ",
" DxH ",
" DxxL",
" DxxH"};
575 const char * dr56thEB[4] = {
" D5 ",
" D6 ",
" D56 ",
"BCID "};
576 const char * dr56thLB[4] = {
" Dx ",
" Dy ",
" Dxy ",
"BCID "};
577 const char ** dr56th = (
m_runPeriod < 3) ? (EB ? dr56hlEB : dr56hlLB)
578 : (
EB ? dr56thEB : dr56thLB);
580 const char *
tit[4] = {
"TMDB digits",
"TMDB energy",
"TMDB decision",
"Unknown"};
582 std::cout << std::hex << std::endl <<
tit[
type&3] <<
" fragment 0x" <<
type <<
" vers 0x"<<
id <<
", "
583 << std::dec <<
size <<
" words found"<< std::endl << std::endl;
588 int ntd = (
EB) ? 3 : 1;
589 int ntdl = (
EB) ? 9 : 5;
597 std::cout <<
"ch cell ";
599 std::cout <<
" S"<<
ind;
601 std::cout << std::endl;
602 adc =
reinterpret_cast<const unsigned char *
>(
data);
603 for (
int pword=0;pword<nch;++pword) {
604 int pword1=pword%nchmod;
605 if (!EB && nchmod==8) {
607 if (pword1==0) pword1=9;
610 if (pword1>6) pword1=9;
613 if (pword1>9) pword1=9;
615 std::cout << std::setw(2) << pword <<
" | " << ch11[tmdb_ch1] <<std::setfill(
'0')<<std::setw(2) <<tmdb_ch2+
count
616 <<
"-" <<std::setfill(
' ')<<std::setw(4)<<dr56rl[pword1];
618 std::cout <<
" | " << std::setw(3) << (
static_cast<unsigned>(
adc[pword+nch*
ind]) );
620 std::cout << std::endl;
621 if ((pword+1)%nchmod==0)
count+=1;
628 std::cout <<
"ch cell energy" << std::endl;
629 for (
int pword=0;pword<
size;++pword) {
630 int pword1=pword%nchmod;
631 if (!EB && nchmod==8) {
633 if (pword1==0) pword1=9;
636 if (pword1>6) pword1=9;
639 if (pword1>9) pword1=9;
641 std::cout << std::setw(2) << pword<<
" | " << ch11[tmdb_ch1] <<std::setfill(
'0')<<std::setw(2) <<tmdb_ch2+
count
642 <<
"-" <<std::setfill(
' ')<<std::setw(4)<<dr56rl[pword1]
643 <<
" | "<< std::setw(6) <<
static_cast<int>(
data[pword])
645 if ((pword+1)%nchmod==0)
count+=1;
651 std::cout <<
"nn name TMDB SL_Board SL_Trigger_Sector "
652 << dr56th[3] << dr56th[2] << dr56th[1] << dr56th[0] << std::endl;
653 result =
reinterpret_cast<const unsigned short *
>(
data);
656 int tmdb = (tmdb_ch2) / 8 + 1;
657 int slb =
tmdb * 3 - 1;
659 for (
int pword = 0; pword < ntd; ++pword) {
660 count = (
EB) ? pword * 3 : pword * 4 + 1;
661 unsigned short r =
result[pword];
663 int slts1 = slb * 2 - 2;
664 int slts2 = slts1 + 1;
665 std::string slt_sectors =
" - ";
667 std::stringstream slts12;
668 slts12 << std::setfill(
' ') << std::setw(2) << slts1 <<
"-"
669 << std::setfill(
' ') << std::setw(2) << std::left << slts2;
670 slt_sectors = slts12.str();
672 std::stringstream slb_name;
673 slb_name <<
"SL_E" << std::setfill(
'0') << std::setw(2) << (
EB ?
std::to_string(slb) :
"XX");
674 for(
int pqword = 0; pqword < 4; ++pqword){
675 std::cout << std::setw(2) << pqword + pword * 4 <<
" | "
676 << ((
count > 0 &&
count < ntdl) ? ch11[tmdb_ch1] : ch12[tmdb_ch1])
677 << std::setfill(
'0') << std::setw(2) << tmdb_ch2 +
count
678 << std::setfill(
' ') << std::setw(6) << tmdb_name
679 << std::setfill(
' ') << std::setw(10) << slb_name.str()
680 << std::setfill(
' ') << std::setw(15) << slt_sectors
681 << std::setfill(
' ') << std::setw(11) << ((
m_runPeriod < 3) ? ((
r >> 3) & 1) :
bcid)
682 << std::setw(5) << ((
r >> 2) & 1) << std::setw(5) << ((
r >> 1) & 1) << std::setw(5) << (
r & 1) << std::endl;
687 if (slb > 24) slb = 1;
695 }
else if (
id < 0x100 || beamROD) {
704 bool isLastChannelEOB = ((
data[
size - 1] >> 24) & 0x7) == 0x4;
706 std::cout <<
"\nBeam ToF TDC, ";
708 std::cout <<
"\nBeam TDC 0x" << std::setfill(
'0') << std::hex << std::setw(2) <<
id <<
setupDec <<
", ";
710 std::cout << (isLastChannelEOB ?
size - 1 :
size) <<
" hits found";
714 unsigned short res1 = (
data[
c] >> 13) & 0
x1;
717 : (
data[
c] >> 16) & 0x7FF;
720 int wordType = (
data[
c] >> 24) & 0x7;
721 if (wordType == 0
x2) {
722 std::cout <<
"\n header, " << ((
data[
c] >> 8) & 0x3F) <<
" channels";
723 }
else if (wordType == 0x4) {
724 std::cout <<
"\n end of block, event counter: " << (
data[
c] & 0xFFFFFF) << std::endl;
726 std::cout <<
"\n unknown word: 0x" << std::hex <<
data[
c] << std::dec << std::endl;
731 std::cout <<
"\n ch" << std::setw(3) <<
chan <<
":";
734 }
else if (nhits % 8 == 0) {
739 std::cout <<
" U" << std::setw(4) <<
time;
741 std::cout <<
" " << std::setw(4) <<
time;
744 std::cout << std::endl;
754 std::cout <<
"\nBeam TDC 0x" << std::setfill(
'0') << std::hex << std::setw(2) <<
id <<
setupDec <<
", " <<
size <<
" hits found";
766 std::cout <<
"\n ch" << std::setw(3) <<
chan <<
":";
769 }
else if (nhits % 8 == 0) {
774 std::cout <<
" " << gb[
bad] <<
fr[edge] << std::setw(6) <<
time;
776 std::cout <<
" " <<
fr[edge] << std::setw(6) <<
time;
779 std::cout << std::endl;
785 bool isLastChannelEOB = ((
data[
size - 1] >> 24) & 0x7) == 0x4;
786 std::cout <<
"\nBeam ADC, " << (isLastChannelEOB ?
size - 1 :
size) <<
" hits found";
790 unsigned short res1 = (
data[
c] >> 13) & 0
x1;
792 : (
data[
c] >> 16) & 0x7FF;
795 int wordType = (
data[
c] >> 24) & 0x7;
796 if (wordType == 0
x2) {
797 std::cout <<
"\n header, " << ((
data[
c] >> 8) & 0x3F) <<
" channels";
798 }
else if (wordType == 0x4) {
799 std::cout <<
"\n end of block, event counter: " << (
data[
c] & 0xFFFFFF) << std::endl;
801 std::cout <<
"\n unknown word: 0x" << std::hex <<
data[
c] << std::dec << std::endl;
806 std::cout <<
"\n ch" << std::setw(3) <<
chan <<
":";
809 }
else if (nhits % 8 == 0) {
814 std::cout <<
" U" << std::setw(4) <<
time;
816 std::cout <<
" " << std::setw(4) <<
time;
819 std::cout << std::endl;
829 std::cout <<
"\nTile Beam ADC, " <<
size <<
" channels found";
831 std::cout <<
"\nBeam ADC 0x" << std::hex << std::setfill(
'0') << std::setw(2) <<
id <<
setupDec <<
", " <<
size <<
" channels found";
834 if (
c % 8 == 0) std::cout <<
setupMod <<
c / 8 <<
":";
835 std::cout << std::setw(9) <<
data[
c];
837 std::cout << std::endl;
841 std::cout <<
"\nMuon ADC, " <<
size <<
" channels found";
843 if (
c % 8 == 0) std::cout <<
setupMod <<
c / 8 <<
":";
844 std::cout << std::setw(9) <<
data[
c];
846 std::cout << std::endl;
850 std::cout <<
"\nMuon2 ADC, " <<
size <<
" channels found";
852 if (
c % 8 == 0) std::cout <<
setupMod <<
c / 8 <<
":";
853 std::cout << std::setw(9) <<
data[
c];
855 std::cout << std::endl;
861 std::cout<<
"\nLaser Pattern Unit, " <<
size <<
" words found (hex)";
863 std::cout<<
"\nCommon Pattern Unit, " <<
size <<
" words found (hex)";
866 if (
c % 8 == 0) std::cout <<
setupMod <<
c/8 <<
":";
869 std::cout << std::endl;
875 std::cout<<
"\nLASTROD Laser Object, " <<
size <<
" words found (hex)";
877 if (
c % 8 == 0) std::cout <<
setupMod <<
c/8 <<
":";
880 std::cout<<std::endl<<std::endl;
883 std::cout<<
"CRITICAL ERROR! Unknown format!"<<std::endl;
885 const unsigned int *
p;
887 int Filter = 0, ReqAmp = 0, MeasAmp = 0, Delay = 0, TDC1 = 0, TDC2 = 0;
891 std::cout <<
" Laser Counter: " << std::setw(5) << Counter << std::endl;
893 if ((*
p & 0xFF000000) == 0x20000000) {
894 ReqAmp = *
p & 0xFFFF;
896 Filter = (((*
p >> 16) & 7) ^ 7) + 2;
898 std::cout <<
" Filter Wheel: " << std::setw(5) <<
Filter << std::endl;
900 std::cout <<
" Required Amp: " << std::setw(5) << ReqAmp << std::endl;
902 std::cout <<
"ERROR in Laser Fragment: decoding word 14." << std::endl;
906 if ((*
p & 0xFF000000) == 0x21000000) {
907 Delay = (*
p >> 12) & 0xFFF;
908 MeasAmp = *
p & 0xFFF;
909 std::cout <<
" Measured Amp: " << std::setw(5) << MeasAmp << std::endl;
910 std::cout <<
" Delay: " << std::setw(5) << Delay << std::endl;
912 std::cout <<
"ERROR in Laser Fragment: decoding word 15." << std::endl;
916 bool TDCPrint =
true;
918 if ((*
p & 0xFF000000) == 0x22000000) {
920 TDC1 = (*
p >> 16) & 0xF;
921 TDC2 = (*
p >> 20) & 0xF;
926 std::cout <<
"ERROR in Laser Fragment: decoding word 16." << std::endl;
930 if ((*
p & 0xFF000000) == 0x23000000) {
932 TDC1 = (TDC1 << 12) + (*
p & 0xFFF);
933 TDC2 = (TDC2 << 12) + ((*
p >> 12) & 0xFFF);
938 std::cout <<
"ERROR in Laser Fragment: decoding word 17." << std::endl;
943 std::cout <<
" TDC1 data: " << std::setw(5) << TDC1 << std::endl;
944 std::cout <<
" TDC2 data: " << std::setw(5) << TDC2 << std::endl;
947 int chan0 = 0,
chan1 = 0, chan2 = 0, chan3 = 0, chan4 = 0, chan5 = 0, chan6 = 0, chan7 = 0;
949 if ((*
p & 0xFF000000) == 0x44000000) {
950 chan0 = (*
p & 0xFFF) ^ 0xFFF;
951 chan1 = ((*
p >> 12) & 0xFFF) ^ 0xFFF;
953 std::cout <<
"ERROR in Laser Fragment: decoding word 18." << std::endl;
957 if ((*
p & 0xFF000000) == 0x45000000) {
958 chan2 = (*
p & 0xFFF) ^ 0xFFF;
959 chan3 = ((*
p >> 12) & 0xFFF) ^ 0xFFF;
961 std::cout <<
"ERROR in Laser Fragment: decoding word 19." << std::endl;
965 if ((*
p & 0xFF000000) == 0x46000000) {
966 chan4 = (*
p & 0xFFF) ^ 0xFFF;
967 chan5 = ((*
p >> 12) & 0xFFF) ^ 0xFFF;
969 std::cout <<
"ERROR in Laser Fragment: decoding word 20." << std::endl;
973 if ((*
p & 0xFF000000) == 0x47000000) {
974 chan6 = (*
p & 0xFFF) ^ 0xFFF;
975 chan7 = ((*
p >> 12) & 0xFFF) ^ 0xFFF;
977 std::cout <<
"ERROR in Laser Fragment: decoding word 21." << std::endl;
981 int diode1_Ped = 0, diode1_PedRMS = 0
982 , diode2_Ped = 0, diode2_PedRMS = 0
983 , diode3_Ped = 0, diode3_PedRMS = 0
984 , diode4_Ped = 0, diode4_PedRMS = 0
985 , PMT1_Ped = 0, PMT1_PedRMS = 0
986 , PMT2_Ped = 0, PMT2_PedRMS = 0;
988 diode1_Ped = (*
p >> 16) & 0xFFFF;
989 diode1_PedRMS = *
p & 0xFFFF;
992 diode2_Ped = (*
p >> 16) & 0xFFFF;
993 diode2_PedRMS = *
p & 0xFFFF;
996 diode3_Ped = (*
p >> 16) & 0xFFFF;
997 diode3_PedRMS = *
p & 0xFFFF;
1000 diode4_Ped = (*
p >> 16) & 0xFFFF;
1001 diode4_PedRMS = *
p & 0xFFFF;
1004 PMT1_Ped = (*
p >> 16) & 0xFFFF;
1005 PMT1_PedRMS = *
p & 0xFFFF;
1008 PMT2_Ped = (*
p >> 16) & 0xFFFF;
1009 PMT2_PedRMS = *
p & 0xFFFF;
1012 time_t Ped_Last_Run = *
p;
1015 int diode1_alpha = 0, diode1_alphaRMS = 0
1016 , diode2_alpha = 0, diode2_alphaRMS = 0
1017 , diode3_alpha = 0, diode3_alphaRMS = 0
1018 , diode4_alpha = 0, diode4_alphaRMS = 0;
1020 diode1_alpha = (*
p >> 16) & 0xFFFF;
1021 diode1_alphaRMS = *
p & 0xFFFF;
1024 diode2_alpha = (*
p >> 16) & 0xFFFF;
1025 diode2_alphaRMS = *
p & 0xFFFF;
1028 diode3_alpha = (*
p >> 16) & 0xFFFF;
1029 diode3_alphaRMS = *
p & 0xFFFF;
1032 diode4_alpha = (*
p >> 16) & 0xFFFF;
1033 diode4_alphaRMS = *
p & 0xFFFF;
1036 time_t Alpha_Last_Run = *
p;
1039 time_t PedAlpha_Last_Run(0);
1041 int diode1_PedAlpha = 0, diode1_PedAlphaRMS = 0
1042 , diode2_PedAlpha = 0, diode2_PedAlphaRMS = 0
1043 , diode3_PedAlpha = 0, diode3_PedAlphaRMS = 0
1044 , diode4_PedAlpha = 0, diode4_PedAlphaRMS = 0;
1047 diode1_PedAlpha = (*
p >> 16) & 0xFFFF;
1048 diode1_PedAlphaRMS = *
p & 0xFFFF;
1051 diode2_PedAlpha = (*
p >> 16) & 0xFFFF;
1052 diode2_PedAlphaRMS = *
p & 0xFFFF;
1055 diode3_PedAlpha = (*
p >> 16) & 0xFFFF;
1056 diode3_PedAlphaRMS = *
p & 0xFFFF;
1059 diode4_PedAlpha = (*
p >> 16) & 0xFFFF;
1060 diode4_PedAlphaRMS = *
p & 0xFFFF;
1063 PedAlpha_Last_Run = *
p;
1067 std::cout << std::endl <<
" | ADC | Pedestal(RMS) | Alpha (RMS) | PedAlpha(RMS) |" << std::endl;
1069 std::cout <<
" Diode 1 | " << std::setw(5) << chan0 <<
" | " <<
setupPr1 << diode1_Ped / 10.0 <<
" (" <<
setupPr2 << diode1_PedRMS / 100.0 <<
") | " <<
setupPr1 << diode1_alpha / 10.0 <<
" (" <<
setupPr2 << diode1_alphaRMS / 100.0 <<
") |" << std::endl;
1070 std::cout <<
" Diode 2 | " << std::setw(5) <<
chan1 <<
" | " <<
setupPr1 << diode2_Ped / 10.0 <<
" (" <<
setupPr2 << diode2_PedRMS / 100.0 <<
") | " <<
setupPr1 << diode2_alpha / 10.0 <<
" (" <<
setupPr2 << diode2_alphaRMS / 100.0 <<
") |" << std::endl;
1071 std::cout <<
" Diode 3 | " << std::setw(5) << chan2 <<
" | " <<
setupPr1 << diode3_Ped / 10.0 <<
" (" <<
setupPr2 << diode3_PedRMS / 100.0 <<
") | " <<
setupPr1 << diode3_alpha / 10.0 <<
" (" <<
setupPr2 << diode3_alphaRMS / 100.0 <<
") |" << std::endl;
1072 std::cout <<
" Diode 4 | " << std::setw(5) << chan3 <<
" | " <<
setupPr1 << diode4_Ped / 10.0 <<
" (" <<
setupPr2 << diode4_PedRMS / 100.0 <<
") | " <<
setupPr1 << diode4_alpha / 10.0 <<
" (" <<
setupPr2 << diode4_alphaRMS / 100.0 <<
") |" << std::endl;
1074 std::cout <<
" Diode 1 | " << std::setw(5) << chan0 <<
" | " <<
setupPr1 << diode1_Ped / 10.0 <<
" (" <<
setupPr2 << diode1_PedRMS / 100.0 <<
") | " <<
setupPr1 << diode1_alpha / 10.0 <<
" (" <<
setupPr2 << diode1_alphaRMS / 100.0 <<
") | " <<
setupPr1 << diode1_PedAlpha / 10.0 <<
" (" <<
setupPr2 << diode1_PedAlphaRMS / 100.0 <<
") |" << std::endl;
1075 std::cout <<
" Diode 2 | " << std::setw(5) <<
chan1 <<
" | " <<
setupPr1 << diode2_Ped / 10.0 <<
" (" <<
setupPr2 << diode2_PedRMS / 100.0 <<
") | " <<
setupPr1 << diode2_alpha / 10.0 <<
" (" <<
setupPr2 << diode2_alphaRMS / 100.0 <<
") | " <<
setupPr1 << diode2_PedAlpha / 10.0 <<
" (" <<
setupPr2 << diode2_PedAlphaRMS / 100.0 <<
") |" << std::endl;
1076 std::cout <<
" Diode 3 | " << std::setw(5) << chan2 <<
" | " <<
setupPr1 << diode3_Ped / 10.0 <<
" (" <<
setupPr2 << diode3_PedRMS / 100.0 <<
") | " <<
setupPr1 << diode3_alpha / 10.0 <<
" (" <<
setupPr2 << diode3_alphaRMS / 100.0 <<
") | " <<
setupPr1 << diode3_PedAlpha / 10.0 <<
" (" <<
setupPr2 << diode3_PedAlphaRMS / 100.0 <<
") |" << std::endl;
1077 std::cout <<
" Diode 4 | " << std::setw(5) << chan3 <<
" | " <<
setupPr1 << diode4_Ped / 10.0 <<
" (" <<
setupPr2 << diode4_PedRMS / 100.0 <<
") | " <<
setupPr1 << diode4_alpha / 10.0 <<
" (" <<
setupPr2 << diode4_alphaRMS / 100.0 <<
") | " <<
setupPr1 << diode4_PedAlpha / 10.0 <<
" (" <<
setupPr2 << diode4_PedAlphaRMS / 100.0 <<
") |" << std::endl;
1080 std::cout <<
" PMT 1 | " << std::setw(5) << chan4 <<
" | " <<
setupPr1 << PMT1_Ped / 10.0 <<
" (" <<
setupPr2 << PMT1_PedRMS / 100.0 <<
") | x | x |" << std::endl;
1081 std::cout <<
" PMT 2 | " << std::setw(5) << chan5 <<
" | " <<
setupPr1 << PMT2_Ped / 10.0 <<
" (" <<
setupPr2 << PMT2_PedRMS / 100.0 <<
") | x | x |" << std::endl;
1082 std::cout <<
" InjChrg | " << std::setw(5) << chan6 <<
" | x | x | x |" << std::endl;
1083 std::cout <<
" Spare | " << std::setw(5) << chan7 <<
" | x | x | x |" << std::endl;
1085 std::cout << std::endl <<
" | Date & Time (GMT) | Date & Time (CERN)" << std::endl;
1089 gmtime_r(&Ped_Last_Run, &TimeInfo);
1090 strftime(buf, 80,
"%d.%m.%Y %H:%M:%S", &TimeInfo);
1092 std::cout <<
" Pedestal | " <<
buf <<
" | " <<
cern_local_time(Ped_Last_Run) << std::endl;
1094 gmtime_r(&Alpha_Last_Run, &TimeInfo);
1095 strftime(buf, 80,
"%d.%m.%Y %H:%M:%S", &TimeInfo);
1097 std::cout <<
" Alpha | " <<
buf <<
" | " <<
cern_local_time(Alpha_Last_Run) << std::endl;
1099 gmtime_r(&PedAlpha_Last_Run, &TimeInfo);
1100 strftime(buf, 80,
"%d.%m.%Y %H:%M:%S", &TimeInfo);
1102 std::cout <<
" PedAlpha | " <<
buf <<
" | " <<
cern_local_time(PedAlpha_Last_Run) << std::endl;
1104 int diodeTemp = 0, secsDiodeT = 0
1105 , boxTemp = 0, secsBoxT = 0
1106 , boxHum = 0, secsBoxH = 0
1107 , gasFlow = 0, secsGasF = 0;
1109 diodeTemp = *
p & 0xFFF;
1110 secsDiodeT = (*
p >> 12) & 0xFFFFF;
1112 boxTemp = *
p & 0xFFF;
1113 secsBoxT = (*
p >> 12) & 0xFFFFF;
1115 boxHum = *
p & 0xFFF;
1116 secsBoxH = (*
p >> 12) & 0xFFFFF;
1118 gasFlow = *
p & 0xFFF;
1119 secsGasF = (*
p >> 12) & 0xFFFFF;
1122 std::cout << std::endl <<
" | Time | Value |" << std::endl;
1123 std::cout <<
" Laser diode temp | " << std::setw(7) << secsDiodeT <<
" | " <<
setupPr3 << diodeTemp / 10.0 <<
" |" << std::endl;
1124 std::cout <<
" Laser box temp | " << std::setw(7) << secsBoxT <<
" | " <<
setupPr3 << boxTemp / 10.0 <<
" |" << std::endl;
1125 std::cout <<
" Laser box humidity | " << std::setw(7) << secsBoxH <<
" | " <<
setupPr3 << boxHum / 10.0 <<
" |" << std::endl;
1126 std::cout <<
" Laser box gas flow | " << std::setw(7) << secsGasF <<
" | " <<
setupPr3 << gasFlow / 10.0 <<
" |" << std::endl;
1128 std::bitset<32> PLCstatus = *
p;
1129 int PLCtime = (*
p >> 12) & 0xFFFFF;
1132 int Alpha0 = PLCstatus[0];
1133 int Alpha1 = PLCstatus[1];
1134 int Alpha2 = PLCstatus[2];
1135 int LV = PLCstatus[3];
1136 int HV1 = PLCstatus[4];
1137 int HV2 = PLCstatus[5];
1138 int ShOpen = PLCstatus[6];
1139 int ShClose = PLCstatus[7];
1140 int Ilock = PLCstatus[8];
1141 int Alarm = PLCstatus[9];
1142 int Err = PLCstatus[11];
1144 const char *YesNo[2] = {
" No",
"Yes"};
1145 const char *OnOff[2] = {
"Off",
" On"};
1147 std::cout << std::endl <<
" Time | Err | Alarm | Ilock | ShClose | ShOpen | HV2 | HV1 | LV | Alpha2 | Alpha1 | Alpha0 |"
1148 << std::endl <<
" " << std::setw(7) << PLCtime
1149 <<
" | " << YesNo[Err] <<
" | " << OnOff[Alarm] <<
" | " << OnOff[Ilock] <<
" | " << YesNo[ShClose]
1150 <<
" | " << YesNo[ShOpen] <<
" | " << OnOff[HV2] <<
" | " << OnOff[HV1] <<
" | " << OnOff[
LV]
1151 <<
" | " << OnOff[Alpha2] <<
" | " << OnOff[Alpha1] <<
" | " << OnOff[Alpha0] <<
" |" << std::endl;
1154 std::cout <<
"CRITICAL ERROR! Wrong size" << std::endl;
1164 std::cout<<
"\nLASTROD New Laser Object, " <<
size <<
" words found" << std::endl;
1166 bool first_half_present = (
size == 25 ||
size == 26 ||
size == 128 ||
size == 129);
1167 bool second_half_present = (
size == 99 ||
size == 100 ||
size == 128 ||
size == 129);
1169 if ( ! (first_half_present || second_half_present) ) {
1170 std::cout <<
"CRITICAL ERROR! Unknown format!" << std::endl;
1173 const char *
name[17] = {
" PhotoDiode 0",
1196 const unsigned int *
p =
data;
1198 if (first_half_present) {
1206 std::cout << std::endl <<
" DAQ type: " << std::setw(5) << (
data[0]%0xFF) << std::endl;
1207 std::cout <<
" Laser Counter: " << std::setw(5) <<
data[1] << std::endl;
1208 std::cout <<
" Required Amp: " << std::setw(5) << (
data[2]>>16) << std::endl;
1209 std::cout <<
" Measured Amp: " << std::setw(5) << (
data[2]&0xFFFF) << std::endl;
1210 std::cout <<
" Filter Wheel: " << std::setw(5) << (
data[3]>>16 & 0x000F) << std::endl;
1211 std::cout <<
" Delay: " << std::setw(5) << (
data[3]&0xFFFF) << std::endl;
1212 std::cout <<
" Linearity DAC: " << std::setw(5) << (
data[4]&0xFFFF) << std::endl;
1213 std::cout << std::endl;
1217 std::cout <<
" HG LG" << std::endl;
1218 for (
int n=0;
n<17; ++
n) {
1220 std::cout <<
name[
n] <<
": " << std::setw(5) << ((*p)&0xFFFF) << std::setw(6) << ((*p)>>16) <<
" => " << std::setw(5) << (8500-((*p)&0xFFFF)) << std::setw(6) << (8500-((*p)>>16))<< std::endl;
1241 std::bitset<32>
status = *(
p++);
1242 const char *YesNo[2] = {
" No",
"Yes"};
1243 std::cout << std::endl;
1244 std::cout <<
"| Link| Link| Bad | Bad | TTC | TTC | PLL | PLL |Laser|Laser|Inter| Comb| Busy| Long|" << std::endl;
1245 std::cout <<
"| not | not | VME | TTC |doubl|singl| lock| lock| temp| diod| lock| run | | busy|" << std::endl;
1246 std::cout <<
"| full| down|clock|clock|error|error| VME | TTC |fault| off |close| fini| |>5sec|" << std::endl;
1247 std::cout <<
"|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|" << std::endl;
1248 std::cout <<
"| " << YesNo[
status[27]] <<
" | " << YesNo[
status[26]] <<
" | " << YesNo[
status[24]] <<
" | " << YesNo[
status[22]] <<
" | " << YesNo[
status[20]] <<
" | " << YesNo[
status[19]] <<
" | " << YesNo[
status[16]] <<
" | " << YesNo[
status[15]] <<
" | " << YesNo[
status[10]] <<
" | " << YesNo[
status[9]] <<
" | " << YesNo[
status[8]] <<
" | " << YesNo[
status[6]] <<
" | " << YesNo[
status[1]] <<
" | " << YesNo[
status[0]] <<
" |" << std::endl;
1250 std::cout << std::endl <<
" FPGA Global Status: 0x" << std::hex
1251 <<
status.to_ulong() <<
" => " <<
status.to_string() << std::dec << std::endl;
1253 gmtime_r(&tim, &TimeInfo);
1254 strftime(buf, 80,
"%d.%m.%Y %H:%M:%S", &TimeInfo);
1255 std::cout <<
"DCS Time Stamp (GMT): " <<
buf <<
" => " <<
cern_local_time(tim) << std::endl;
1256 std::cout <<
" PhotoDiode Polarity: " << std::setw(5) << (*
p++) << std::endl;
1260 if (second_half_present) {
1261 std::cout <<
" Calibration Type: " << std::setw(5) << (*
p++) << std::endl;
1263 gmtime_r(&tim, &TimeInfo);
1264 strftime(buf, 80,
"%d.%m.%Y %H:%M:%S", &TimeInfo);
1265 std::cout <<
" Time Stamp (GMT): " <<
buf <<
" => " <<
cern_local_time(tim) << std::endl;
1268 if (
p[96]==0 || (
p[96]==3072 && (*
p)<21504000)) {
1269 std::cout <<
" Number of events: " <<
p[96] <<
" => assuming 1024" << std::endl << std::endl;
1272 std::cout <<
" Number of events: " << std::setw(5) <<
p[96] << std::endl << std::endl;
1274 std::cout <<
" pedHG rmsHG pedLG rmsLG" << std::endl;
1275 for (
int n=0;
n<16; ++
n) {
1288 double ped0 =
double(sum0)/nevt;
1289 double ped1 =
double(sum1)/nevt;
1291 double rms0 =
double(ssq0)/nevt - ped0*ped0;
1292 double rms1 =
double(ssq1)/nevt - ped1*ped1;
1293 if (rms0>0.0) rms0 = sqrt(rms0);
1294 if (rms1>0.0) rms1 = sqrt(rms1);
1296 std::cout <<
name[
n] <<
":" << std::setw(11) << sum0 << std::setw(11) << sum1 << std::setw(11) << msb0 << std::setw(11) << lsb0 << std::setw(11) << msb1 << std::setw(11) << lsb1 <<
" => " << std::setw(7) << std::setprecision(1) << 8500.-ped0 <<
" +/- " << std::setw(7) << std::setprecision(1) << rms0 <<
" " << std::setw(7) << std::setprecision(1) << 8500.-ped1 <<
" +/- " << std::setw(7) << std::setprecision(1) << rms1 << std::endl;
1304 std::cout <<
"\nLaser ADC, " <<
size <<
" channels found";
1306 if (
c % 8 == 0) std::cout <<
setupMod <<
c/8<<
":";
1307 std::cout << std::setw(9) <<
data[
c];
1309 std::cout << std::endl;
1313 std::cout <<
"\nECAL ADC, " <<
size <<
" channels found";
1315 if (
c % 8 == 0) std::cout <<
setupMod <<
c/8<<
":";
1316 std::cout << std::setw(9) <<
data[
c];
1318 std::cout << std::endl;
1322 std::cout <<
"\nDigi parameters, " <<
size <<
" words found";
1324 if (
c % 8 == 0) std::cout <<
setupMod <<
c/8<<
":";
1325 std::cout << std::setw(11) <<
data[
c];
1327 std::cout << std::endl;
1330 const unsigned int *
p =
data;
1331 int Counter = 0,
Mode = 0, Samples = 0, Pipeline = 0, I3Delay = 0,
Event = 0, Phase = 0,
1332 DAC = 0, Capacity = 0, Card = 0,
RunType = 0, microsec = 0;
1334 bool DefFormat =
true;
1335 if (
size == 4) DefFormat =
false;
1359 const char *RunTypeText;
1361 case 1: RunTypeText =
"Physics";
break;
1362 case 2: RunTypeText =
"Laser";
break;
1363 case 4: RunTypeText =
"Pedestals";
break;
1364 case 8: RunTypeText =
"CIS mono";
break;
1365 case 16: RunTypeText =
"CIS scan";
break;
1366 default: RunTypeText =
"Unknown";
break;
1369 std::cout <<
"\n CIS Counter: " << std::setw(3) << Counter<< std::endl;
1370 std::cout <<
"\n Run Type: " << std::setw(3) <<
RunType <<
" (" << RunTypeText <<
")";
1372 std::cout <<
"\n Samples: " << std::setw(3) << Samples;
1373 std::cout <<
"\n Pipeline: " << std::setw(3) << Pipeline << std::endl;
1375 const char* ModeText;
1378 ModeText =
"Normal";
1380 case 1: ModeText =
"Calibration";
break;
1381 default: ModeText =
"Unknown";
break;
1386 gmtime_r(&
Time, &TimeInfo);
1387 strftime(buf, 80,
"%d.%m.%Y %H:%M:%S", &TimeInfo);
1388 std::cout << std::endl;
1390 std::cout <<
" Microsec.: " << microsec << std::endl << std::endl;
1391 std::cout <<
" Mode: " << std::setw(3) <<
Mode <<
" (" << ModeText <<
")" << std::endl;
1392 std::cout <<
" Samples: " << std::setw(3) << Samples << std::endl;
1393 std::cout <<
" Pipeline: " << std::setw(3) << Pipeline << std::endl;
1394 std::cout <<
" I3Delay: " << std::setw(3) << I3Delay << std::endl;
1395 std::cout <<
" Event: " << std::setw(3) <<
Event << std::endl;
1396 std::cout <<
" Phase: " << std::setw(3) << Phase << std::endl;
1397 std::cout <<
" DAC: " << std::setw(3) << DAC << std::endl;
1398 std::cout <<
" Capacity: " << std::setw(3) << Capacity <<
" pF" << std::endl;
1399 std::cout <<
" Card: " << std::setw(3) << Card << std::endl;
1402 int last =
size - 1;
1403 for (; last > 15; --last) {
1404 if (
data[last] != 0)
break;
1407 std::cout <<
"\n Remaing " << last - 15 <<
" non-zero words (hex):";
1408 for (
c = 16;
c <= last; ++
c) {
1409 if (
c % 8 == 0) std::cout <<
setupMod <<
c/8<<
":";
1410 std::cout << std::hex << std::setw(11) <<
data[
c] << std::dec;
1412 std::cout << std:: endl;
1417 std::cout <<
"CRITICAL ERROR! Unknown format!" << std::endl;
1422 std::cout <<
"\nAdder FADC, " <<
size <<
" words found (hex)" ;
1424 if (
c % 8 == 0) std::cout <<
setupMod <<
c/8<<
":";
1425 std::cout << std::hex << std::setw(9) <<
data[
c] << std::dec;
1427 std::cout << std::endl;
1438 std::cout <<
"\nCoincidence trigger frag " <<
id -
COIN_TRIG1_FRAG + 1 <<
", " <<
size <<
" words found (hex)";
1440 if (
c % 8 == 0) std::cout <<
setupMod <<
c/8<<
":";
1441 std::cout << std::hex << std::setw(11) <<
data[
c] << std::dec;
1443 std::cout << std::endl;
1447 std::cout <<
"\nUnknown fragment [0x" << std::hex <<
id << std::dec <<
"], " <<
size <<
" words found" << std::endl;
1454 fragType = (*itr).second;
1456 fragType = (
id >> 8);
1457 if (fragType > 4 || fragType < 1) fragType = 2;
1468 std::cout <<
"\nDigitizer fragment 0x" << std::hex <<
id << std::dec <<
", " <<
size <<
" words found:"
1469 <<
"\t" <<
nchan / 3 <<
" chips, " << nsamp <<
"+2 samples" << std::endl;
1473 }
else if (
ngain == 2) {
1480 std::cout <<
"\nfirst data word:" << std::setw(12) <<
data[0] <<
" (0x"<<
setup0 <<
data[0] <<
setupDec <<
")";
1485 std::cout <<
"\n" << std::setw(3) <<
extra <<
" extra words:";
1490 std::cout << std::endl;
1493 std::cout <<
"\nPMT Ch | BCID M G";
1494 for (
s = 0;
s < nsamp; ++
s) {
1495 std::cout << std::setw(4) <<
s <<
" ";
1498 std::cout <<
" Head/Data/CRC\n---|---|-------------------------";
1499 for (
s = 0;
s < nsamp; ++
s) {
1500 std::cout <<
"-----";
1510 std::cout <<
"\n" << std::setw(3) <<
pmt << std::setw(3) <<
ch <<
" |";
1512 std::cout <<
"\n -- " << std::setw(2) <<
ch <<
" |";
1516 std::cout << std::setw(5) << (
channel[
ch].bcid) << std::setw(2) << ((
channel[
ch].flag >> 3) & 3);
1521 std::cout << std::setw(2) << (
channel[
ch].gain);
1523 for (
s = 0;
s < nsamp; ++
s) {
1524 std::cout << std::setw(5) << (
channel[
ch].sample[
s]);
1567 for (
int i = 0;
i < 7;
i++) {
1571 std::cout <<
" RawERR ";
1574 for (
int i = 0;
i < 7;
i++) {
1575 std::cout << std::setw(5) << Frag5Data[
ch].
s[
i] ;
1580 if (!OK) std::cout <<
"\nOF weights: ERROR";
1584 std::cout << std::endl;
1586 for (
int ch = 0;
ch < 48;
ch++) {
1588 for (
int i = 0;
i < 7;
i++) {
1605 std::cout <<
" " <<
ch <<
",";
1608 std::cout <<
"\nCompare Raw <=> Frag5: ";
1610 std::cout <<
"OK" << std::endl;
1612 std::cout <<
"ERROR" << std::endl;
1620 std::cout <<
"\nRaw data compressed fragment 0x" << std::hex <<
id << std::dec <<
", " <<
size <<
" words found" << std::endl;
1625 std::cout <<
"\nRaw data compressed fragment 0x" << std::hex <<
id << std::dec <<
", " <<
size <<
" words found:"
1626 <<
"\t" <<
ngain <<
" gain, " <<
nchan <<
" channels in total" << std::endl;
1628 std::cout <<
"\nPMT Ch |";
1629 for (
int j = 1; j <= ((nsamp / 2) + 1); j++) {
1630 std::cout <<
" HexWord" << j <<
" ";
1634 for (
int l = 1;
l <= nsamp;
l++) {
1635 std::cout <<
" Smp" <<
l;
1639 int ch = rawcomp[
i].chan;
1642 std::cout <<
"\n" << std::setw(3) <<
pmt << std::setw(3) <<
ch <<
" |";
1644 std::cout <<
"\n -- " << std::setw(2) <<
ch <<
" |";
1646 std::cout << std::hex << std::setfill(
'0');
1647 for (
int j = 0; j < ((nsamp / 2) + 1); j++) {
1648 std::cout <<
" " << std::setw(8) << rawcomp[
i].words[j] <<
" ";
1650 std::cout <<
setupDec <<
"| " << rawcomp[
i].gain;
1651 for (
int l = 0;
l < nsamp;
l++) {
1652 std::cout << std::setw(6) << rawcomp[
i].samples[
l];
1654 if (!rawcomp[
i].verif) std::cout <<
" Wrong Data";
1661 std::cout <<
"\nReco non calibrated energy fragment 0x" << std::hex <<
id << std::dec <<
", " <<
size <<
" words found:"
1662 <<
"\t" <<
ngain <<
" gain, " <<
nchan <<
" channels in total" << std::endl
1663 <<
"\tATTENTION: HIGH gain amplitude is divided by 64" << std::endl;
1665 std::cout <<
"\nPMT Ch | full word | G amp time q amp time qual";
1669 std::cout <<
"\n" << std::setw(3) <<
pmt << std::setw(3) <<
ch <<
" |";
1671 std::cout <<
"\n -- " << std::setw(2) <<
ch <<
" |";
1674 << std::setw(1) << recochan[
ch].gain << std::setw(6) << recochan[
ch].amp << std::setw(5) << recochan[
ch].time
1675 << std::setw(3) << recochan[
ch].quality << std::setw(10) << std::setprecision(1) <<
float (recochan[
ch].
gain ? recochan[
ch].d_amp / 64. : recochan[
ch].d_amp)
1676 << std::setw(11) << std::setprecision(4) << (
float) recochan[
ch].d_time << std::setw(8) << std::setprecision(1) << (
float) recochan[
ch].d_quality;
1686 std::cout <<
"\nReco calibrated energy fragment 0x" << std::hex <<
id << std::dec <<
", " <<
size <<
" words found:"
1687 <<
"\t" << ((
nchan > 48 &&
nchan < 96) ? 1 :
ngain) <<
" gain, " << unitName[
unit].c_str() <<
" units, " <<
nchan <<
" channels in total" << std::endl;
1690 std::cout <<
"Reco flags: 0x" << std::hex << std::setfill(
'0') << rflag <<
setupDec <<
" units: " << unitName[
unit].c_str() <<
" pulse_shape: " << shapeName[pulse].c_str() <<
" nsamples: " << 7 + 2 * nsmpl <<
" algorithm: " <<
algName[algor + 1].c_str() <<
" niterations: " << niter << std::endl;
1692 std::cout <<
"Reco flags: 0x" << std::hex << std::setfill(
'0') << rflag <<
setupDec <<
" units: " << unitName[
unit].c_str() <<
" pulse_shape: " << shapeName[pulse].c_str() <<
" nsamples: " << 7 + 2 * nsmpl <<
" algorithm: " <<
algName[algor * 4 + niter].c_str() << std::endl;
1695 std::cout <<
"\nPMT Ch | full word | G amp time b q amp time qual";
1699 std::cout <<
"\n" << std::setw(3) <<
pmt << std::setw(3) <<
ch <<
" |";
1701 std::cout <<
"\n -- " << std::setw(2) <<
ch <<
" |";
1707 std::cout <<
" 0x" <<
setup0 << recocalib[
ch].word <<
setupDec <<
" | " << std::setw(1) << recocalib[
ch].gain << std::setw(6) << recocalib[
ch].amp << std::setw(5) << recocalib[
ch].time << std::setw(2) << recocalib[
ch].bad << std::setw(3) << recocalib[
ch].quality << std::setw(10) << std::setprecision(1) << recocalib[
ch].d_amp << std::setw(11) << std::setprecision(4) << recocalib[
ch].d_time << std::setw(8) << std::setprecision(1) << recocalib[
ch].d_quality;
1709 if (recocalib[
ch].
bad != 0) {
1710 std::cout <<
" Bad channel";
1725 std::cout <<
"\nFrag5 Compressed fragment 0x" << std::hex <<
id << std::dec <<
", " <<
size <<
" words found:"
1726 <<
"\t" << 1 <<
" gain, " << unitName[
unit].c_str() <<
" units, " <<
nchan <<
" channels in total" << std::endl;
1735 std::vector<double>
a(7),
b(7),
c(7),
g(7),
dg(7);
1751 for (
int i = 0;
i < 7; ++
i) {
1770 int size_L2 = (*((
const uint32_t*)
data - 3 + 2) >> (32 - 2 - 3)) & 0x7;
1771 std::cout <<
"size_L2: " << size_L2 <<
" |";
1776 std::cout <<
" SumEt: " << SumEt <<
", SumEz: " << SumEz <<
", SumE: " << SumE << std::endl;
1778 std::cout << std::endl;
1782 #define code_ped4 TileRawChannel2Bytes5::code_ped4
1783 #define code_ped5 TileRawChannel2Bytes5::code_ped5
1784 #define code_amp5 TileRawChannel2Bytes5::code_amp5
1785 #define code_amp6 TileRawChannel2Bytes5::code_amp6
1786 #define code_raws TileRawChannel2Bytes5::code_raws
1787 #define code_rawf TileRawChannel2Bytes5::code_rawf
1788 #define code_full TileRawChannel2Bytes5::code_full
1789 #define code_dump TileRawChannel2Bytes5::code_dump
1790 #define code_null TileRawChannel2Bytes5::code_null
1792 int cnt_ped4, cnt_ped5, cnt_amp5, cnt_amp6, cnt_raws, cnt_rawf, cnt_full, cnt_dump, cnt_null;
1793 cnt_ped4 = cnt_ped5 = cnt_amp5 = cnt_amp6 = cnt_raws = cnt_rawf = cnt_full = cnt_dump = cnt_null = 0;
1794 std::cout <<
"PMT Ch | full word | Type G B ectrl ereco ebin ene time | s1 s2 s3 s4 s5 s6 s7";
1796 const char *strcode_empty =
"----";
1797 const char *strcode_ped4 =
"ped4";
1798 const char *strcode_ped5 =
"ped5";
1799 const char *strcode_amp5 =
"amp5";
1800 const char *strcode_amp6 =
"amp6";
1801 const char *strcode_raws =
"raws";
1802 const char *strcode_rawf =
"rawf";
1803 const char *strcode_full =
"full";
1804 const char *strcode_dump =
"dump";
1805 const char *strcode_null =
"null";
1806 const char *strcode_error =
"ERR ";
1812 std::cout <<
"\n" << std::setw(3) <<
pmt << std::setw(3) <<
ch <<
" |";
1814 std::cout <<
"\n -- " << std::setw(2) <<
ch <<
" |";
1818 const char *scode = strcode_empty;
1823 float ene = Frag5Data[
ch].
ene;
1826 for (
int i = 0;
i < 7;
i++) {
1827 s[
i] = Frag5Data[
ch].
s[
i];
1831 case code_ped4: scode = strcode_ped4; cnt_ped4++;
break;
1832 case code_ped5: scode = strcode_ped5; cnt_ped5++;
break;
1833 case code_amp5: scode = strcode_amp5; cnt_amp5++;
break;
1834 case code_amp6: scode = strcode_amp6; cnt_amp6++;
break;
1835 case code_raws: scode = strcode_raws; cnt_raws++;
break;
1836 case code_rawf: scode = strcode_rawf; cnt_rawf++;
break;
1837 case code_full: scode = strcode_full; cnt_full++;
break;
1838 case code_dump: scode = strcode_dump; cnt_dump++;
break;
1839 case code_null: scode = strcode_null; cnt_null++;
break;
1840 default: scode = strcode_error;
break;
1843 int ene_recobin = ene_bin + (
gain == 0 ? 512 : 2048);
1853 ene_bin += (
gain == 0 ? 512 : 2048);
1860 }
else if (ene_ctrl > 0x7FFF) {
1872 std::cout << std::setw(7) << ene_ctrl << std::setw(7) << ene_recobin << std::setw(6) << ene_bin << std::setw(10) << std::setprecision(4) << ene <<
" -- ";
1876 std::cout << std::setw(7) << ene_ctrl << std::setw(7) << ene_recobin << std::setw(6) << ene_bin << std::setw(10) << std::setprecision(4) << ene << std::setw(6) << std::setprecision(1) <<
time <<
" ";
1880 std::cout <<
" ----- ----- ---- --- -- ";
1885 std::cout <<
"| " << std::setw(4) <<
s[0] << std::setw(5) <<
s[1] << std::setw(5) <<
s[2] << std::setw(5) <<
s[3] << std::setw(5) <<
s[4] << std::setw(5) <<
s[5] << std::setw(5) <<
s[6] <<
" " ;
1886 if (ene_ctrl != ene_recobin) {
1888 std::cout <<
" ERR";
1892 std::cout <<
"\n\nFrag5 Self-Consistency: ";
1894 std::cout <<
"OK" << std::endl;
1896 std::cout <<
"ERROR" << std::endl;
1899 std::cout <<
"\nped4" << cnt_ped4 <<
", ped5 " << cnt_ped5 <<
", amp5 " << cnt_amp5 <<
", amp6 " << cnt_amp6 <<
", raws " << cnt_raws <<
", rawf " << cnt_rawf <<
", full " << cnt_full <<
", dump " << cnt_dump <<
", null " << cnt_null << std::endl;
1906 std::cout <<
"\nFELIX fragment 0x" << std::hex <<
id << std::dec <<
", " <<
size <<
" words found" << std::endl;
1910 std::cout << std::hex << std::endl;
1911 bool phase2format = (
size>
head && correct_data[2] == 0x12345678 && correct_data[
size-1] == 0x87654321);
1913 int thisVersion = (((correct_data[3] >> 16) & 0xFFFF) == 0) ? 1 : 0;
1914 const char * namesV0[] = {
"size_packet",
"elink",
"SOP",
"runParam1",
"runParam2",
"runParam3",
"runParam4",
"BC_MD_ID",
"L1ID" };
1915 const char * namesV1[] = {
"size_packet",
"elink",
"SOP",
"version",
"MODULE_BC_MD",
"L1ID",
"BCR" ,
"runParam1",
"runParam2",
"runParam3"};
1916 const char **
names = (thisVersion) ? namesV1 : namesV0;
1917 if (thisVersion)
head = 10;
1919 std::cout << std::setw(13) <<
names[
i] << std::setw(10) << correct_data[
i] << std::endl;
1924 std::cout <<
" Word" << std::setw(3) <<
i << std::setw(10) << correct_data[
i] << std::endl;
1927 std::cout << std::dec << std::endl;
1928 FelixData_t digitsHighGain, digitsLowGain, digitsMetaData;
1929 unpack_frag6(correct_data.data(),
size, digitsHighGain, digitsLowGain, digitsMetaData);
1931 std::cout <<
" MD1 MD2 MD3 MD4" << std::endl;
1932 std::cout <<
"-----------------------------------------------------";
1933 const char * metaNamesV0[] = {
"BCID",
"L1ID",
"ModuleID",
"RunType",
"RunNumber",
"PedHi",
"PedLo",
"ChargeInj",
"TimeInj",
"Capacitor",
"ECR" };
1934 const char * metaNamesV1[] = {
"BCID",
"L1ID",
"ModuleID",
"RunType",
"RunNumber",
"PedHi",
"PedLo",
"ChargeInj",
"TimeInj",
"Capacitor",
"ECR",
"BCR",
"Version",
"FragID" };
1935 const char ** metaNames = (
version) ? metaNamesV1 : metaNamesV0;
1936 for (
size_t i = 0;
i < digitsMetaData.size(); ++
i) {
1937 std::cout << std::endl << std::setw(13) << metaNames[
i];
1938 for (
size_t j = 0; j<digitsMetaData[
i].size(); ++j) {
1939 std::cout << std::setw(10) << digitsMetaData[
i][j];
1942 std::cout << std::endl << std::endl;
1945 if (digitsLowGain[0].
size()>0)
1947 if (digitsHighGain[0].
size()>0)
1950 std::cout <<
" ch G ";
1951 for (
size_t s = 0;
s < nsamp; ++
s) {
1952 std::cout << std::setw(5) <<
s;
1954 std::string
a(8+nsamp*5,
'-');
1955 std::cout << std::endl <<
a;
1957 for (
size_t ch = 0;
ch < digitsHighGain.size() ; ++
ch) {
1958 std::cout << std::endl << std::setw(3) <<
ch <<
" HG ";
1959 for (
size_t s = 0;
s < digitsHighGain[
ch].size(); ++
s) {
1960 std::cout << std::setw(5) << (digitsHighGain[
ch][
s]);
1964 for (
size_t ch = 0;
ch < digitsLowGain.size() ; ++
ch) {
1965 std::cout << std::endl << std::setw(3) <<
ch <<
" LG ";
1966 for (
size_t s = 0;
s < digitsLowGain[
ch].size(); ++
s) {
1967 std::cout << std::setw(5) << (digitsLowGain[
ch][
s]);
1970 std::cout << std::endl << std::endl;
1978 std::cout <<
"\nQuality fragment 0x" << std::hex <<
id <<
", " << std::dec <<
size <<
" words found:" << std::endl;
1981 std::cout <<
" ATTENTION: Error bits found in the Data Quality fragment 0xA" << std::endl;
1984 std::cout <<
" --------------------------------------" << std::endl;
1985 std::cout <<
" | Quality Block | Word (16bit)" << std::endl;
1986 if (DQword.dspbcid >> 15) {
1987 std::cout <<
" | DSP BCID | " << std::dec << (DQword.dspbcid & 0x7FFF) << std::endl;
1989 std::cout <<
" | DSP BCID | not filled (" << std::dec << DQword.dspbcid <<
")" << std::endl;
1991 std::cout <<
" | Global CRC | " << std::hex <<
"0x" << std::setw(1) << DQword.global_crc << std::setfill(
'0') << std::endl;
1992 std::cout <<
" | BCID checks | " <<
setup0x4 << DQword.bcid << std::endl;
1993 std::cout <<
" | Mem parity err | " <<
setup0x4 << DQword.memory << std::endl;
1994 std::cout <<
" | Single strobe err | " <<
setup0x4 << DQword.Sstrobe << std::endl;
1995 std::cout <<
" | Double strobe err | " <<
setup0x4 << DQword.Dstrobe << std::endl;
1996 std::cout <<
" | Head format err | " <<
setup0x4 << DQword.headformat << std::endl;
1997 std::cout <<
" | Head parity err | " <<
setup0x4 << DQword.headparity << std::endl;
1998 std::cout <<
" | Sample format err | " <<
setup0x4 << DQword.sampleformat << std::endl;
1999 std::cout <<
" | Sample parity err | " <<
setup0x4 << DQword.sampleparity << std::endl;
2000 std::cout <<
" | FE chip mask err | " <<
setup0x4 << DQword.fe_chip_mask << std::endl;
2001 std::cout <<
" | ROD chip mask err | " <<
setup0x4 << DQword.rod_chip_mask << std::endl;
2002 std::cout <<
" --------------------------------------" << std::setfill(
' ') << std::dec << std::endl;
2006 std::cout <<
"\nUnknown (type " <<
type <<
") fragment 0x" << std::hex <<
id <<
", " << std::dec <<
size <<
" words found" << std::endl;
2009 std::cout << std::endl;
2011 std::cout <<
"\nType " <<
type <<
" fragment 0x" << std::hex <<
id <<
", " << std::dec <<
size <<
" words found" << std::endl;
2012 std::cout <<
"\nEmpty Event" << std::endl;