Go to the documentation of this file.
33 bool bUppercase =
false) {
40 if (0 != cFill) ss << std::setfill(cFill);
41 if (0 < uWidth) ss << std::setw(uWidth);
42 if (bUppercase) ss << std::uppercase;
45 ss << ulVal << std::dec;
48 if (0 != cFill) ss << std::setfill(
' ');
58 uint64_t uOtherTs = 0;
67 return uThisTs < uOtherTs;
84 return uThisTs < uOtherTs;
89 return this->data == other.
data;
94 return this->data != other.
data;
99 return std::round(getMsgFullTimeD(epoch));
104 switch (getMessageType()) {
106 if (getGdpbHitIs24b())
107 return (
static_cast<double_t
>(
108 FullTimeStamp(epoch, (getGdpbHitCoarse() << 7)))
109 + (
static_cast<double_t
>(getGdpbHitFineTs() - 8.)
114 +
static_cast<double_t
>(getGdpbHitFullTs())
138 stop += 0x3FFFFFFFFFFFLLU;
140 printf(
"Epochs overflow error in CalcDistance\n");
154 stop += 0x3FFFFFFFFFFFLLU;
156 printf(
"Epochs overflow error in CalcDistanceD\n");
219 std::ostream& os)
const {
222 const uint8_t* arr =
reinterpret_cast<const uint8_t*
>(&data);
225 "BE= %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X LE= "
226 "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X ",
249 snprintf(buf,
sizeof(buf),
" ");
253 double timeInSec = getMsgFullTimeD(epoch) / 1.e9;
256 switch (getMessageType()) {
258 snprintf(buf,
sizeof(buf),
"Msg:%u ", getMessageType());
267 "EPOCH @%17.11f Get4:%2d Epoche2:%10u 0x%08x Sync:%x "
268 "Dataloss:%x Epochloss:%x Epochmissmatch:%x",
275 getGdpbEpEpochLoss(),
276 getGdpbEpMissmatch());
279 std::cout << buf << std::endl;
281 os << buf << std::endl;
284 snprintf(buf,
sizeof(buf),
"Msg:%u ", getMessageType());
291 if (getGdpbHitIs24b()) {
294 "Get4 24b @%17.11f Get4:%2d Chn:%3d Edge:%1d Ts:%7d",
304 "Get4 24b @%17.11f Get4:%2d Chn:%3d Dll:%1d Ts:%7d",
308 getGdpbHit32DllLck(),
313 std::cout << buf << std::endl;
315 os << buf << std::endl;
327 snprintf(buf,
sizeof(buf),
"Msg:%2u ", getMessageType());
337 switch (getMessageType()) {
339 if (getGdpbHitIs24b()) {
342 "Get4 24 bits, Get4:0x%04x Chn:%1x Edge:%1x Ts:0x%03x",
351 "Get4 32 bits, Get4:0x%04x Channel %1d Ts:0x%03x Ft:0x%02x "
352 "Tot:0x%02x Dll %1d",
358 getGdpbHit32DllLck());
365 "Get4:0x%04x Link: %1u Epoch:0x%08x Sync:%x Dataloss:%x "
366 "Epochloss:%x Epochmissmatch:%x",
372 getGdpbEpEpochLoss(),
373 getGdpbEpMissmatch());
380 "Get4 Slow control, Get4:0x%04x => Chan:%01d Edge:%01d "
381 "Type:%01x Data:0x%06x",
393 switch (getGdpbSysSubType()) {
397 "Get4:0x%04x Ch:0x%01x Edge:%01x Unused:%06x "
398 "ErrCode:0x%02x - GET4 V1 Error Event",
400 getGdpbSysErrChanId(),
402 getGdpbSysErrUnused(),
403 getGdpbSysErrData());
409 "Unknown GET4 message, data: 0x%08x",
410 getGdpbSysUnkwData());
413 if (getGdpbSysFwErrResync())
416 "GET4 Resynchronization: Get4:0x%04x",
420 sysbuf,
sizeof(sysbuf),
"GET4 SYNC synchronization error");
425 "Pattern message => Type %d, Index %2d, Pattern 0x%08X",
426 getGdpbSysPattType(),
427 getGdpbSysPattIndex(),
428 getGdpbSysPattPattern());
433 "unknown system message type %u",
434 getGdpbSysSubType());
436 snprintf(buf,
sizeof(buf),
"%s", sysbuf);
445 switch (getStarTrigMsgIndex()) {
452 "STAR token A, gDPB TS MSB bits: 0x%s000000",
462 "STAR token B, gDPB TS LSB bits: 0x0000000000%s, STAR TS MSB "
463 "bits: 0x%s000000000000",
474 "STAR token C, , STAR TS Mid "
484 "STAR token D, , STAR TS LSB "
485 "bits: 0x00000000000000%s"
486 ", Token: %03x, DAQ: %1x; TRG:%1x",
490 getStarDaqCmdStarD(),
491 getStarTrigCmdStarD());
501 "Error - unexpected MessageType: %1x, full data %08X::%08X",
509 std::cout << buf << std::endl;
511 os << buf << std::endl;
524 unsigned kind)
const {
525 std::cout <<
"Full epoch = " << std::setw(9) << fulExtendedEpoch <<
" ";
526 printDataCout(outType, kind);
static uint64_t CalcDistance(uint64_t start, uint64_t stop)
Returns the time difference between two expanded time stamps.
double getMsgFullTimeD(uint64_t epoch) const
Returns expanded and adjusted time of message in double (in ns)
std::string FormatHexPrintout(uint64_t ulVal, char cFill=0, uint uWidth=0, bool bUppercase=false)
const double kdClockCycleSizeNs
bool operator!=(const gdpbv100::Message &other) const
inequality operator, assumes same epoch for both messages
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.
void printDataCout(unsigned kind=msg_print_Prefix|msg_print_Data, uint32_t epoch=0) const
Print message in human readable format to cout.
uint8_t getMessageType() const
Returns the message type. Valid for all message types. 4 bit.
bool operator<(const gdpbv100::Message &other) const
strict weak ordering operator, assumes same epoch for both messages
void PrintMessage(unsigned outType=msg_print_Cout, unsigned kind=msg_print_Human) const
static double CalcDistanceD(double start, double stop)
Returns the time difference between two expanded time stamps.
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
equality operator, assumes same epoch for both messages
uint32_t getGdpbHitFullTs() const
uint64_t getMsgFullTime(uint64_t epoch) const
Returns expanded and adjusted time of message (in ns)
uint64_t fulExtendedEpoch
bool operator<(const FullMessage &other) const
strict weak ordering operator, including epoch for both messages