28 for (i =0; i<dlength; i++) *k++ = from[i];
41 int triggermasklength = k[2];
42 int scalerlength = k[3+triggermasklength];
44 int rawIndex = 3+triggermasklength +1;
45 int lifeIndex = rawIndex + scalerlength;
46 int scaledIndex = lifeIndex + scalerlength;
47 int stringIndex = scaledIndex + scalerlength;
49 if (strcmp(what,
"NUMBERSCALERS") == 0)
54 else if (strcmp(what,
"NUMBERMASKS") == 0)
56 return triggermasklength;
59 else if (strcmp(what,
"TRIGGERMASK") == 0)
61 if (channel <0 || channel >=triggermasklength)
return 0;
65 else if (strcmp(what,
"RAWSCALERS") == 0)
67 if (channel <0 || channel >=scalerlength)
return 0;
68 return k[rawIndex+channel];
71 else if (strcmp(what,
"LIFESCALERS") == 0 ||
72 strcmp(what,
"LIVESCALERS") == 0)
74 if (channel <0 || channel >=scalerlength)
return 0;
75 return k[lifeIndex+channel];
78 else if (strcmp(what,
"SCALEDSCALERS") == 0)
80 if (channel <0 || channel >=scalerlength)
return 0;
81 return k[scaledIndex+channel];
84 else if ( strcmp(what,
"TIMESTRING")==0)
86 if (channel <0 || channel >= k[stringIndex] )
return EOF;
87 char *
c = (
char *) &k[stringIndex+1];
91 std::cout <<
"packet_id4scaler::iValue error unknown datum: " << what << std::endl;
97 if (strcmp(what,
"BEAMCLOCK") == 0 || strcmp(what,
"BCLCK") == 0)
109 ULONGLONG beamclock = k[0];
111 unsigned long long beamclock = k[0];
117 std::cout << std::hex << k[0] <<
" " << k[1] <<
" " << beamclock << std::dec<< std::endl;
135 os <<
"Beamclock " << std::hex << std::setw(16)<<
lValue(0,
"BEAMCLOCK") << std::dec << std::endl;
137 int triggermasklength = k[2];
139 for (i=0; i< triggermasklength ; i++)
141 os <<
"Tiggermask " << i <<
" " << std::hex <<
iValue(0,
"TRIGGERMASK") << std::dec << std::endl;
144 os <<
"Scalers: raw | live | scaled" <<std::endl;
146 for (i = 0; i<
iValue(0,
"NUMBERSCALERS"); i++)
148 os <<
SETW(3) << i <<
" "
151 <<
SETW(9) <<
iValue(i,
"SCALEDSCALERS") <<
" "
155 os <<
"time string: ";
158 while ( (c =
iValue(i++,
"TIMESTRING")) ) os <<
c;