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