36 std::string
FormatHexPrintout(uint64_t ulVal,
char cFill = 0, uint uWidth = 0,
bool bUppercase =
false)
44 if (0 != cFill) ss << std::setfill(cFill);
45 if (0 < uWidth) ss << std::setw(uWidth);
46 if (bUppercase) ss << std::uppercase;
49 ss << ulVal << std::dec;
52 if (0 != cFill) ss << std::setfill(
' ');
63 uint64_t uOtherTs = 0;
72 return uThisTs < uOtherTs;
85 return uThisTs < uOtherTs;
130 stop += 0x3FFFFFFFFFFFLLU;
132 printf(
"Epochs overflow error in CalcDistance\n");
147 stop += 0x3FFFFFFFFFFFLLU;
149 printf(
"Epochs overflow error in CalcDistanceD\n");
209 const uint8_t* arr =
reinterpret_cast<const uint8_t*
>(&
data);
210 snprintf(buf,
sizeof(buf),
211 "BE= %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X LE= "
212 "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X ",
213 arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[7], arr[7], arr[6], arr[5], arr[4], arr[3],
214 arr[2], arr[1], arr[0]);
220 snprintf(buf,
sizeof(buf),
" ");
235 snprintf(buf,
sizeof(buf),
236 "EPOCH @%17.11f Get4:%2d Epoche2:%10u 0x%08x Sync:%x "
237 "Dataloss:%x Epochloss:%x Epochmissmatch:%x",
243 os << buf << std::endl;
253 snprintf(buf,
sizeof(buf),
"Get4 24b @%17.11f Get4:%2d Chn:%3d Edge:%1d Ts:%7d", timeInSec,
257 snprintf(buf,
sizeof(buf),
"Get4 24b @%17.11f Get4:%2d Chn:%3d Dll:%1d Ts:%7d", timeInSec,
getGdpbGenChipId(),
263 os << buf << std::endl;
287 snprintf(buf,
sizeof(buf),
"Get4 24 bits, Get4:0x%04x Chn:%1x Edge:%1x Ts:0x%03x",
getGdpbGenChipId(),
291 snprintf(buf,
sizeof(buf),
292 "Get4 32 bits, Get4:0x%04x Channel %1d Ts:0x%03x Ft:0x%02x "
293 "Tot:0x%02x Dll %1d",
300 snprintf(buf,
sizeof(buf),
301 "Get4:0x%04x Link: %1u Epoch:0x%08x Sync:%x Dataloss:%x "
302 "Epochloss:%x Epochmissmatch:%x",
309 snprintf(buf,
sizeof(buf),
310 "Get4 Slow control, Get4:0x%04x => Chan:%01d Edge:%01d "
311 "Type:%01x Data:0x%06x",
321 snprintf(sysbuf,
sizeof(sysbuf),
322 "Get4:0x%04x Ch:0x%01x Edge:%01x Unused:%06x "
323 "ErrCode:0x%02x - GET4 V1 Error Event",
329 snprintf(sysbuf,
sizeof(sysbuf),
"Unknown GET4 message, data: 0x%08x",
getGdpbSysUnkwData());
333 snprintf(sysbuf,
sizeof(sysbuf),
"GET4 Resynchronization: Get4:0x%04x",
getGdpbGenChipId());
335 snprintf(sysbuf,
sizeof(sysbuf),
"GET4 SYNC synchronization error");
338 snprintf(sysbuf,
sizeof(sysbuf),
"Pattern message => Type %d, Index %2d, Pattern 0x%08X",
341 default: snprintf(sysbuf,
sizeof(sysbuf),
"unknown system message type %u",
getGdpbSysSubType());
343 snprintf(buf,
sizeof(buf),
"%s", sysbuf);
354 snprintf(buf,
sizeof(buf),
357 "STAR token A, gDPB TS MSB bits: 0x%s000000",
366 "STAR token B, gDPB TS LSB bits: 0x0000000000%s, STAR TS MSB "
367 "bits: 0x%s000000000000",
377 "STAR token C, , STAR TS Mid "
386 "STAR token D, , STAR TS LSB "
387 "bits: 0x00000000000000%s"
388 ", Token: %03x, DAQ: %1x; TRG:%1x",
399 snprintf(buf,
sizeof(buf),
"Error - unexpected MessageType: %1x, full data %08X::%08X",
getMessageType(),
406 os << buf << std::endl;
void PrintMessage(unsigned outType=msg_print_Cout, unsigned kind=msg_print_Human) const
uint64_t fulExtendedEpoch
bool operator<(const FullMessage &other) const
strict weak ordering operator, including epoch for both messages
static uint64_t CalcDistance(uint64_t start, uint64_t stop)
Returns the time difference between two expanded time stamps.
uint16_t getGdpbHitIs24b() const
uint16_t getStarTrigMsgIndex() const
uint32_t getGdpbEpEpochNb() const
uint16_t getGdpbHit32Tot() const
uint16_t getGdpbSysPattType() const
void printDataLog(unsigned kind=msg_print_Prefix|msg_print_Data, uint32_t epoch=0) const
Print message in human readable format to the Fairroot logger.
uint64_t getStarTsMidStarC() const
uint16_t getGdpbSysSubType() const
uint64_t getGdpbTsLsbStarB() const
bool getGdpbEpMissmatch() const
bool getGdpbHit24Edge() const
double getMsgFullTimeD(uint64_t epoch) const
Returns expanded and adjusted time of message in double (in ns)
uint16_t getGdpbSysPattIndex() const
uint16_t getGdpbHitFineTs() const
uint32_t getGdpbSlcData() const
bool getGdpbEpSync() const
uint32_t getGdpbSysFwErrResync() const
uint64_t getStarTsMsbStarB() const
uint32_t getGdpbHitFullTs() const
uint32_t getStarTrigCmdStarD() const
uint32_t getGdpbSysPattPattern() const
bool getGdpbHit32DllLck() const
bool getGdpbEpEpochLoss() const
uint32_t getStarDaqCmdStarD() const
static uint64_t FullTimeStamp(uint64_t epoch, uint32_t ts)
Expanded timestamp for 160 MHz * 19 bit (12 + 7) epochs.
uint64_t getGdpbTsMsbStarA() const
uint16_t getGdpbGenChipId() const
uint16_t getGdpbSysErrUnused() const
void printDataCout(unsigned kind=msg_print_Prefix|msg_print_Data, uint32_t epoch=0) const
Print message in human readable format to cout.
bool getGdpbEpDataLoss() const
uint16_t getGdpbHitCoarse() const
uint32_t getStarTokenStarD() const
void printData(unsigned outType=msg_print_Cout, unsigned kind=msg_print_Human, uint32_t epoch=0, std::ostream &os=std::cout) const
Print message in binary or human readable format to a stream.
bool operator<(const gdpbv100::Message &other) const
strict weak ordering operator, assumes same epoch for both messages
bool operator!=(const gdpbv100::Message &other) const
inequality operator, assumes same epoch for both messages
bool getGdpbEpLinkId() const
bool operator==(const gdpbv100::Message &other) const
equality operator, assumes same epoch for both messages
static double CalcDistanceD(double start, double stop)
Returns the time difference between two expanded time stamps.
uint64_t getStarTsLsbStarD() const
uint8_t getMessageType() const
Returns the message type. Valid for all message types. 4 bit.
uint32_t getGdpbSysUnkwData() const
uint16_t getGdpbSysErrData() const
bool getGdpbSysErrEdge() const
uint16_t getGdpbSysErrChanId() const
uint64_t getMsgFullTime(uint64_t epoch) const
Returns expanded and adjusted time of message (in ns)
uint16_t getGdpbHitChanId() const
uint32_t getField(uint32_t shift, uint32_t len) const
const double kdClockCycleSizeNs
std::string FormatHexPrintout(uint64_t ulVal, char cFill=0, uint uWidth=0, bool bUppercase=false)