7 #define MEMZERO(array) memset((array), 0, sizeof(array))
22 const uint32_t *data = (
const uint32_t*)(*data8);
29 printf(
" total event size: 0x%08x (%d)\n", data[0], data[0]&0x0FFFFFFF);
30 printf(
" board id, pattern, gr mask: 0x%08x\n", data[1]);
31 printf(
" event counter: 0x%08x (%d)\n", data[2], data[2]);
32 printf(
" event time tag: 0x%08x (%d)\n", data[3], data[3]);
40 e->
pattern = (data[1]>>8)&0x3FFF;
49 const uint32_t *g = data + 4;
50 for (
int i=0; i<4; i++) {
55 e->
len[i] = g[0] & 0xfff;
56 e->
tr[i] = (g[0]>>12)&1;
57 e->
freq[i] = (g[0]>>16)&3;
58 e->
cell[i] = (g[0]>>20)&0x3ff;
68 const uint8_t* p = (
const uint8_t*)g;
70 for (
int s=0; s<1024; s++)
71 for (
int a=0; a<8; a++) {
74 v = (p[0]) | ((p[1]&0xF)<<8);
78 v = ((p[0]&0xF0)>>4) | ((p[1]&0xFF)<<4);
98 int trlen = e->
len[i]/8;
100 const uint8_t* p = (
const uint8_t*)g;
102 for (
int s=0; s<1024; s++) {
105 v = (p[0]) | ((p[1]&0xF)<<8);
109 v = ((p[0]&0xF0)>>4) | ((p[1]&0xFF)<<4);
131 printf(
" group trigger time tag: 0x%08x\n", g[0]);
142 if (e->trailer_word_count != i+1) {
144 printf (
"v1190unpack: word count mismatch: trailer wc %d, but data has %d words\n", e->trailer_word_count, i+1);
151 printf(
"%d 0x%08x: unexpected data\n", i, data[i]);
153 printf(
"v1190unpack: unexpected data word 0x%08x\n", data[i]);
163 printf(
"v1742event: error %d, ec %d, geo 0x%x, tl %d, obo %d, tdc_e %d, wc %d, %d hits\n",
error, event_count, geo, trailer_trigger_lost, trailer_output_buffer_overflow, trailer_tdc_error, trailer_word_count, (
int)hits.size());
v1742event * UnpackV1742(const char **data8, int *datalen, bool verbose)