9#include <rawdata/dataobjects/RawFTSWFormat_v2.h>
49 tv->tv_usec = (int)(((
double)
GetTTCtime(n)) / 127.216);
57 ts->tv_nsec = (long)(((
double)
GetTTCtime(n)) / 0.127216);
91 int ret = (buffer[ POS_INJECTION_INFO ] & INJ_HER_LER_MASK) >> INJ_HER_LER_SHIFT;
98 unsigned int* buffer = (
unsigned int*)
GetBuffer(n);
99 unsigned int ret = (buffer[ POS_INJECTION_INFO ] & INJ_TIME_MASK) >> INJ_TIME_SHIFT;
105 unsigned int* buffer = (
unsigned int*)
GetBuffer(n);
106 unsigned int ret = buffer[ POS_TIME_SINCE_PREV_TRG ];
112 unsigned int* buffer = (
unsigned int*)
GetBuffer(n);
113 unsigned int ret = (buffer[ POS_BUNCH_NUM ] & INJ_BUNCH_MASK) >> INJ_BUNCH_SHIFT;
119 unsigned int* buffer = (
unsigned int*)
GetBuffer(n);
120 unsigned int ret = buffer[ POS_FRAME_COUNT ];
126 unsigned int prev_evenum,
unsigned int* cur_evenum,
127 unsigned int prev_exprunsubrun_no,
unsigned int* cur_exprunsubrun_no)
136 if (prev_exprunsubrun_no == *cur_exprunsubrun_no) {
137 if ((
unsigned int)(prev_evenum + 1) != *cur_evenum) {
138 sprintf(err_buf,
"[FATAL] ERROR_EVENT : Event # jump : i %d prev 0x%x cur 0x%x : Exiting...\n %s %s %d\n",
139 n, prev_evenum, *cur_evenum, __FILE__, __PRETTY_FUNCTION__, __LINE__);
140 printf(
"%s", err_buf);
147 sprintf(err_buf,
"[FATAL] ERROR_EVENT : invalid FTSW packet length : block %d nwords %d must be %d : Exiting...\n %s %s %d\n",
148 n,
GetBlockNwords(n), SIZE_FTSW_PACKET, __FILE__, __PRETTY_FUNCTION__, __LINE__);
149 printf(
"%s", err_buf);
154 sprintf(err_buf,
"[FATAL] ERROR_EVENT : invalid magic word : block %d magic word 0x%x must be 0x%x : Exiting...\n %s %s %d\n",
155 n,
GetMagicTrailer(n), FTSW_MAGIC_TRAILER, __FILE__, __PRETTY_FUNCTION__, __LINE__);
156 printf(
"%s", err_buf);
161 printf(
"[DEBUG] ========== dump a data block : block # %d==========\n", n);
165 if (k % 10 == 9) printf(
"\n[DEBUG] ");
168 string err_str = err_buf;
throw (err_str);
unsigned int GetExpRunSubrun(int n) OVERRIDE_CPP17
Exp# (10bit) run# (14bit) restart # (8bit)
Abstract base class for different kinds of events.