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;
100 switch (getMessageType()) {
123 stop += 0x3FFFFFFFFFFFLLU;
125 printf(
"Epochs overflow error in CalcDistance\n");
140 stop += 0x3FFFFFFFFFFFLLU;
142 printf(
"Epochs overflow error in CalcDistanceD\n");
205 const uint8_t* arr =
reinterpret_cast<const uint8_t*
>(&data);
213 snprintf(buf,
sizeof(buf),
"LE= %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X ", arr[7], arr[6], arr[5], arr[4], arr[3],
214 arr[2], arr[1], arr[0]);
221 snprintf(buf,
sizeof(buf),
" ");
225 double timeInSec = getMsgFullTimeD(epoch) / 1.e9;
228 switch (getMessageType()) {
230 snprintf(buf,
sizeof(buf),
"Msg:%u ", getMessageType());
236 snprintf(buf,
sizeof(buf),
237 "EPOCH @%17.11f Get4:%2d Epoche2:%10u 0x%08x Sync:%x "
238 "Dataloss:%x Epochloss:%x Epochmissmatch:%x",
239 timeInSec, getGet4Idx(), getGdpbEpEpochNb(), getGdpbEpEpochNb(), getGdpbEpSync(), getGdpbEpDataLoss(),
240 getGdpbEpEpochLoss(), getGdpbEpMissmatch());
244 os << buf << std::endl;
247 snprintf(buf,
sizeof(buf),
"Msg:%u ", getMessageType());
253 snprintf(buf,
sizeof(buf),
"Get4 24b @%17.11f Get4:%2d Chn:%3d Dll:%1d Ts:%7d", timeInSec, getGet4Idx(),
254 getGdpbHitChanId(), getGdpbHit32DllLck(), getGdpbHitFullTs());
258 os << buf << std::endl;
261 kind = kind & ~msg_print_Human;
270 snprintf(buf,
sizeof(buf),
"Msg:%2u ", getMessageType());
279 switch (getMessageType()) {
310 snprintf(buf,
sizeof(buf),
"Error - unexpected MessageType: %1x, full data %08X::%08X", getMessageType(),
311 getField(32, 32), getField(0, 32));
317 os << buf << std::endl;
332 std::cout <<
"Full epoch = " << std::setw(9) << fulExtendedEpoch <<
" ";
333 printDataCout(outType, kind);
void PrintMessage(unsigned outType=msg_print_Cout, unsigned kind=msg_print_Human) const
bool operator<(const FullMessage &other) const
strict weak ordering operator, including epoch for both messages
uint64_t fulExtendedEpoch
uint32_t getGdpbHitFullTs() const
bool operator==(const critof001::Message &other) const
equality operator, assumes same epoch for both messages
bool operator!=(const critof001::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.
uint8_t getMessageType() const
Returns the message type. Valid for all message types. 2 bit.
static uint64_t CalcDistance(uint64_t start, uint64_t 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 critof001::Message &other) const
strict weak ordering operator, assumes same epoch for both messages
void printDataCout(unsigned kind=msg_print_Prefix|msg_print_Data, uint32_t epoch=0) const
Print message in human readable format to cout.
uint64_t getMsgFullTime(uint64_t epoch) const
Returns expanded and adjusted time of message (in ns)
static double CalcDistanceD(double start, double 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