5#ifndef GDPB_MESS_V1_00_DEF_H
6#define GDPB_MESS_V1_00_DEF_H
163 return (
data >> shift) & (((
static_cast<uint64_t
>(1)) << len) - 1);
166 inline uint32_t
getField(uint32_t shift, uint32_t len)
const
168 return (
data >> shift) & (((
static_cast<uint64_t
>(1)) << len) - 1);
171 inline void setField(uint32_t shift, uint32_t len, uint32_t value)
173 uint64_t mask = (((
static_cast<uint64_t
>(1)) << len) - 1);
174 data = (
data & ~(mask << shift)) | ((static_cast<uint64_t>(value) & mask) << shift);
179 uint64_t mask = (((
static_cast<uint64_t
>(1)) << len) - 1);
180 data = (
data & ~(mask << shift)) | ((value & mask) << shift);
183 inline uint8_t
getBit(uint32_t shift)
const {
return (
data >> shift) & 1; }
185 inline void setBit(uint32_t shift, uint8_t value)
187 data = value ? (
data | ((
static_cast<uint64_t
>(1)) << shift)) : (
data & ~((
static_cast<uint64_t
>(1)) << shift));
191 inline uint32_t
getFieldBE(uint32_t shift, uint32_t len)
const
193 return (
dataBE() >> shift) & (((
static_cast<uint32_t
>(1)) << len) - 1);
195 inline uint8_t
getBitBE(uint32_t shift)
const {
return (
dataBE() >> shift) & 1; }
198 return ((
data & 0x00000000000000FF) << 56) + ((
data & 0x000000000000FF00) << 40)
199 + ((
data & 0x0000000000FF0000) << 24) + ((
data & 0x00000000FF000000) << 8)
200 + ((
data >> 8) & 0x00000000FF000000) + ((
data >> 24) & 0x0000000000FF0000)
201 + ((
data >> 40) & 0x000000000000FF00) + ((
data >> 56) & 0x00000000000000FF);
324 std::ostream& os = std::cout)
const;
331 inline static uint64_t
FullTimeStamp(uint64_t epoch, uint32_t ts) {
return (epoch << 19) | (ts & 0x7ffff); }
334 static uint64_t
CalcDistance(uint64_t start, uint64_t stop);
FullMessage & operator=(const FullMessage &src)
void assign(const FullMessage &src)
void PrintMessage(unsigned outType=msg_print_Cout, unsigned kind=msg_print_Human) const
FullMessage(const Message &src, uint64_t uEpIn=0)
double GetFullTimeNs() const
uint64_t fulExtendedEpoch
bool operator<(const FullMessage &other) const
strict weak ordering operator, including epoch for both messages
FullMessage(const FullMessage &src)
uint64_t getExtendedEpoch() const
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
Message(const Message &src)
uint32_t getGdpbEpEpochNb() const
uint16_t getGdpbHit32Tot() const
uint16_t getGdpbSysPattType() const
void setStarTsLsbStarD(uint64_t fullStarTs)
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
uint8_t getBit(uint32_t shift) const
void setGdpbTsMsbStarA(uint64_t fullGdpbTs)
uint32_t getGdpbSlcChan() const
void setData(uint64_t value)
void setGdpbSysPattType(uint16_t v)
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
void setStarTrigCmdStarD(uint8_t v)
void setGdpbGenChipId(uint32_t v)
uint64_t getFieldLong(uint32_t shift, uint32_t len) const
uint16_t getGdpbHitFineTs() const
uint32_t getGdpbSlcData() const
void setGdpbEpEpochNb(uint32_t v)
bool getGdpbEpSync() const
uint32_t getGdpbSysFwErrResync() const
uint64_t getStarTsMsbStarB() const
void setStarFillerD()
12 bits in between are set to 0
void setStarTokenStarD(uint16_t v)
uint32_t getGdpbHitFullTs() const
uint32_t getStarTrigCmdStarD() const
uint32_t getGdpbSysPattPattern() const
uint32_t getGdpbSlcType() const
bool isStarTrigger() const
Returns true is message type is MSG_STAR_TRI_A, _B, _C, _D (STAR Trigger message)
bool getGdpbHit32DllLck() const
Message & operator=(const Message &src)
uint16_t getGdpbGenGdpbId() const
bool getGdpbSysLinkId() const
bool getGdpbEpEpochLoss() const
uint32_t getStarDaqCmdStarD() const
void setBit(uint32_t shift, uint8_t value)
void setGdpbSysPattPattern(uint32_t v)
void setMessageType(uint8_t v)
Sets the message type field in the current message.
static uint64_t FullTimeStamp(uint64_t epoch, uint32_t ts)
Expanded timestamp for 160 MHz * 19 bit (12 + 7) epochs.
uint64_t getGdpbTsMsbStarA() const
void setStarTsMsbStarB(uint64_t fullStarTs)
uint16_t getGdpbGenChipId() const
bool isHitMsg() const
Returns true is message type is MSG_HIT (Get4 hit data)
uint16_t getGdpbSysErrUnused() const
void setStarTsMidStarC(uint64_t fullStarTs)
void printDataCout(unsigned kind=msg_print_Prefix|msg_print_Data, uint32_t epoch=0) const
Print message in human readable format to cout.
void setField(uint32_t shift, uint32_t len, uint32_t value)
bool getGdpbEpDataLoss() const
uint32_t getStarFillerD() const
12 bits in between are set to 0
bool getGdpbSysErrRoType() const
void setGdpbSysPattIndex(uint16_t v)
bool isGet4SlCtrMsg() const
Returns true is message type is MSG_SLOWC (GET4 Slow Control)
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.
void setGdpbGenGdpbId(uint32_t v)
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
void setStarDaqCmdStarD(uint8_t v)
uint32_t getGdpbSlcMess() const
void setFieldLong(uint32_t shift, uint32_t len, uint64_t value)
bool getGdpbEpLinkId() const
uint32_t getFieldBE(uint32_t shift, uint32_t len) const
bool operator==(const gdpbv100::Message &other) const
equality operator, assumes same epoch for both messages
uint8_t getBitBE(uint32_t shift) const
uint32_t getGdpbSlcEdge() const
static double CalcDistanceD(double start, double stop)
Returns the time difference between two expanded time stamps.
uint64_t getStarTsLsbStarD() const
void setGdpbTsLsbStarB(uint64_t fullGdpbTs)
uint8_t getMessageType() const
Returns the message type. Valid for all message types. 4 bit.
void assign(const Message &src)
void setStarTrigMsgIndex(uint8_t v)
uint32_t getGdpbSysUnkwData() const
uint16_t getGdpbSysErrData() const
bool getGdpbSysErrEdge() const
uint16_t getGdpbSysErrInfo() const
uint16_t getGdpbSysErrChanId() const
void setGdpbSysSubType(uint16_t v)
uint64_t getMsgFullTime(uint64_t epoch) const
Returns expanded and adjusted time of message (in ns)
bool isSysMsg() const
Returns true is message type is MSG_SYST (system message)
bool isEpochMsg() const
Returns true is message type is MSG_EPOCH (epoch2 marker)
uint16_t getGdpbHitChanId() const
uint32_t getField(uint32_t shift, uint32_t len) const
const uint32_t kuFineTime
const uint32_t kuFeePulserChannelDiam
const double kdEpochCycleInS
const double kdClockCycleSize
const double kdClockCycleSizeNs
const uint64_t kulEpochCycleBins
const uint32_t kuCoarseTime
const uint32_t kuFineCounterSize
const uint32_t kuTotCounterSize
@ GET4_V2X_ERR_FIFO_WRITE
@ GET4_V2X_ERR_EPOCH_OVERF
@ GET4_V2X_ERR_EP_CNT_SYNC
@ GET4_V2X_ERR_ADD_RIS_EDG
@ GET4_V2X_ERR_TOK_RING_ST
@ GET4_V2X_ERR_TOT_OVERWRT
@ GET4_V2X_ERR_READOUT_ERR
@ GET4_V2X_ERR_EVT_DISCARD
@ GET4_V2X_ERR_UNPAIR_FALL
@ GET4_V2X_ERR_CHAN_STATE
@ GET4_V2X_ERR_SEQUENCE_ER
const double kdTotBinSize
const uint32_t kuChipIdMergedEpoch
const uint32_t kuFeePulserChannel
const uint32_t kuEpochCounterSz
const uint64_t kulEpochCycleFieldSz
const uint32_t kuCoarseCounterSize
const uint32_t kuCoarseOverflowTest
const uint32_t kuEpochInBins