25 if (status || olength<=0 )
return NULL;
29 for (i =0; i<olength; i++) *k++ = temp[i];
40 COUT<<
"Failed to fill data structure"<<std::endl;
44 if (strcmp(what,
"HEADER3")==0)
49 else if ( strcmp(what,
"YEAR")==0)
53 else if ( strcmp(what,
"MONTH")==0)
57 else if ( strcmp(what,
"DATE")==0)
61 else if ( strcmp(what,
"DAY")==0)
65 else if ( strcmp(what,
"HOUR")==0)
69 else if ( strcmp(what,
"MIN")==0)
73 else if ( strcmp(what,
"SEC")==0)
78 else if (strcmp(what,
"ALIGNMENT")==0)
82 else if ( strcmp(what,
"CROSSCTR")==0)
86 else if ( strcmp(what,
"BEAMCTR0")==0)
90 else if ( strcmp(what,
"BEAMCTR1")==0)
94 else if ( strcmp(what,
"GACCEPT")==0)
98 else if (strcmp(what,
"ACPTORINP")==0)
102 else if ( strcmp(what,
"ACPTCTR")==0)
106 else if ( strcmp(what,
"GRANCTR")==0)
108 if( (ich<0) || (ich>31) ) {
115 else if ( strcmp(what,
"GDISABLE")==0)
119 else if ( strcmp(what,
"FACCEPT")==0)
124 else if (strcmp(what,
"HEADER2")==0)
128 else if ( strcmp(what,
"PACCEPT")==0)
132 else if (strcmp(what,
"MODEBITS")==0)
136 else if ( strcmp(what,
"RBITS0")==0)
140 else if ( strcmp(what,
"RBITS1")==0)
144 else if ( strcmp(what,
"DCMFULL")==0)
148 else if ( strcmp(what,
"FEMUNREL")==0)
152 else if ( strcmp(what,
"GBUSY")==0)
156 else if ( strcmp(what,
"PXBAR")==0)
160 else if ( strcmp(what,
"PBUSY")==0)
166 else if (strcmp(what,
"HEADER1")==0)
175 else if ( strcmp(what,
"LUTINPUT")==0)
185 else if ( strcmp(what,
"RAWTRIG")==0)
194 else if ( strcmp(what,
"TRIGBUSY")==0)
203 else if ( strcmp(what,
"LIVETRIG")==0)
212 else if ( strcmp(what,
"SCALEDTRIG")==0)
221 else if ( strcmp(what,
"TRIGPARXBAR")==0)
241 std::cout<<
"Failed to fill data structure"<<std::endl;
310 if( (ich<0) || (ich>31) ) {
450 os<<
"Failed to fill sgl1. Exit"<<std::endl;
465 std::ios::fmtflags oldFlags = os.flags();
467 oldFill=os.fill(
'0');
468 for(m=0;m<54;m++) os<<
"=";
470 os <<
"GL1 data packet:" << std::endl;
471 os <<
"Detected " << std::dec <<
sgl1->
gl1_boards <<
" GL1-1 boards in the data packet." <<std::endl;
472 os <<
"--> GL1-3 <--"<<std::endl;
479 os <<
"Beam Cross. Counter = 0x" <<
SETW(8)
489 os <<
"Granule Accept Counters:"<< std::endl;
505 os <<
"--> GL1-2 <--"<<std::endl;
518 os << std::dec <<
SETW(1) <<
"--> GL1-1[" << i <<
"] <--" << std::endl;
529 os << std::dec << std::endl;
540 os << std::endl << std::dec <<
SETW(5) << j <<
" | ";
543 os << std::hex <<
SETW(8) << k[j++] <<
" ";
544 if (j>=dlength)
break;
546 if (j>=dlength)
break;
549 for(m=0;m<54;m++) os<<
"=";
550 os << std::dec << std::endl;
566 COUT<<
"can't allocate memory for GL1_EVENT_DATA structure "<<std::endl;
577 check_length = 2*(dlength-46);
578 while( check_length>=21 ){
588 if (buf == 0)
return;
608 ((buf[3]&0xFFFF)<<16) + ((buf[3]&0xFFFF0000)>>16);
610 ((buf[4]&0xFFFF)<<16) + ((buf[4]&0xFFFF0000)>>16);
616 for(
unsigned int j=0;
j<32;
j+=2){
630 (buf[28]&0xFFFF0000)+(buf[29]&0xFFFF);
632 (buf[29]&0xFFFF0000)+(buf[30]&0xFFFF);