28 snprintf(sbuf,
sizeof(sbuf),
"%u", (
unsigned)
GetSize());
30 printf(
"*** Event #0x%06x fullid=0x%04x runid=0x%08x typ %x size %s *** \n",
40 time_t tempo = time(NULL);
41 struct tm* gmTime = gmtime(&tempo);
42 uint32_t date = 0, clock = 0;
43 date |= gmTime->tm_year << 16;
44 date |= gmTime->tm_mon << 8;
45 date |= gmTime->tm_mday;
47 clock |= gmTime->tm_hour << 16;
48 clock |= gmTime->tm_min << 8;
49 clock |= gmTime->tm_sec;
68 if (prev == 0)
return FirstSubevent();
72 if (next >= (
char*)
this + GetSize())
return 0;
81 unsigned sz = ((GetSize() -
sizeof(
RawSubevent)) / Alignment());
83 if ((ix>=sz) || (len==0))
return;
84 if (ix + len > sz) len = sz - ix;
87 if (sz>99) wlen = 3;
else
90 for (
unsigned cnt=0;cnt<len;cnt++,ix++)
91 printf(
"%*s[%*u] %08x%s", (cnt%8 ? 2 : prefix),
"", wlen, ix, (unsigned) Data(ix), (cnt % 8 == 7 ?
"\n" :
""));
93 if (len % 8 != 0) printf(
"\n");
100 if (GetSize()!=GetPaddedSize())
101 snprintf(sbuf,
sizeof(sbuf),
"%4u+%u", (
unsigned) GetSize(), (
unsigned) (GetPaddedSize() - GetSize()));
103 snprintf(sbuf,
sizeof(sbuf),
"%6u", (
unsigned) GetSize());
104 printf(
" *** Subevent size %s decoding 0x%06x id 0x%04x trig 0x%08x typ %x %s align %u ***\n",
106 (
unsigned) GetDecoding(),
108 (
unsigned) GetTrigNr(),
109 (
unsigned) GetTrigTypeTrb3(),
110 IsSwapped() ?
"swapped" :
"not swapped",
111 (
unsigned) Alignment());
113 if (print_raw_data) PrintRawData();
@ EvtDecoding_64bitAligned
uint32_t GetPaddedSize() const
RawSubevent * NextSubevent(RawSubevent *prev=0)
RawSubevent * FirstSubevent()
void InitHeader(uint32_t evid)
Method to set initial header value like decoding and date/time.
uint32_t GetSeqNr() const
uint32_t AllSubeventsSize()
Hadaq subevent structure.
void Dump(bool print_raw_data=false)
Print subevent header and optionally raw data.
void PrintRawData(unsigned ix=0, unsigned len=0xffffffff, unsigned prefix=6)
Print raw data, optionally one can position and portion to print.