StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
gdpb::Message Class Reference
Inheritance diagram for gdpb::Message:
gdpb::FullMessage

Public Member Functions

 Message (const Message &src)
 
 Message (uint64_t dataIn)
 
void assign (const Message &src)
 
Messageoperator= (const Message &src)
 
void reset ()
 
uint64_t getData () const
 
void setData (uint64_t value)
 
uint64_t getFieldLong (uint32_t shift, uint32_t len) const
 
uint32_t getField (uint32_t shift, uint32_t len) const
 
void setField (uint32_t shift, uint32_t len, uint32_t value)
 
void setFieldLong (uint32_t shift, uint32_t len, uint64_t value)
 
uint8_t getBit (uint32_t shift) const
 
void setBit (uint32_t shift, uint8_t value)
 
uint32_t getFieldBE (uint32_t shift, uint32_t len) const
 
uint8_t getBitBE (uint32_t shift) const
 
uint64_t dataBE () const
 
uint8_t getMessageType () const
 Returns the message type. Valid for all message types. 4 bit.
 
uint16_t getRocNumber () const
 Returns the number of the sending ROC. Valid for all message types. More...
 
void setMessageType (uint8_t v)
 Sets the message type field in the current message.
 
void setRocNumber (uint16_t v)
 Sets the ROC number field in the current message.
 
uint32_t getEpoch2EpochMissmatch () const
 
uint32_t getEpoch2EpochLost () const
 For Epoch2 data: Returns epoch-lost flag (1 bit field)
 
uint32_t getEpoch2DataLost () const
 For Epoch2 data: Returns data-lost flag (1 bit field)
 
uint32_t getEpoch2Sync () const
 For Epoch2 data: Returns sync flag (1 bit field)
 
uint32_t getEpoch2StampTime () const
 
uint32_t getEpoch2Number () const
 For Epoch2 data: Returns the epoch number (32 bit field)
 
uint32_t getEpoch2ChipNumber () const
 
void setEpoch2EpochMissmatch (uint32_t v)
 For Epoch2 data: Set epoch missmatch flag (1 bit field)
 
void setEpoch2EpochLost (uint32_t v)
 For Epoch2 data: Set epoch-lost flag (1 bit field)
 
void setEpoch2DataLost (uint32_t v)
 For Epoch2 data: Set data-lost flag (1 bit field)
 
void setEpoch2Sync (uint32_t v)
 For Epoch2 data: Set sync flag (1 bit field)
 
void setEpoch2StampTime (uint32_t v)
 
void setEpoch2Number (uint32_t v)
 For Epoch2 data: Set the epoch number (32 bit field)
 
void setEpoch2ChipNumber (uint32_t v)
 
uint8_t getGet4Number () const
 For Get4 data: Returns Get4 chip number (6 bit field)
 
uint8_t getGet4ChNum () const
 For Get4 data: Returns Get4 channel number (2 bit field)
 
uint32_t getGet4Ts () const
 For Get4 data: Returns Get4 time stamp, 50 ps binning (19 bit field)
 
uint32_t getGet4FineTs () const
 For Get4 data: Returns Get4 fine time stamp, 50 ps binning (7 bit field)
 
uint32_t getGet4CoarseTs () const
 For Get4 data: Returns Get4 coarse time stamp, 6.4 ns binning (12 bit field)
 
uint32_t getGet4Edge () const
 For Get4 data: Returns Get4 rising or falling edge (1 bit field)
 
uint32_t getGet4CRC () const
 
void setGet4Number (uint8_t v)
 For Get4 data: Sets Get4 chip number (6 bit field)
 
void setGet4ChNum (uint8_t v)
 For Get4 data: Sets Get4 channel number (2 bit field)
 
void setGet4Ts (uint32_t v)
 For Get4 data: Sets Get4 time stamp, 50 ps binning (19 bit field)
 
void setGet4Edge (uint32_t v)
 For Get4 data: Sets Get4 rising or falling edge (1 bit field)
 
void setGet4CRC (uint32_t v)
 
uint8_t getSysMesType () const
 For SysMes data: Returns system message subtype (8 bit field)
 
uint32_t getSysMesData () const
 For SysMes data: Returns system message data (32 bit field)
 
void setSysMesType (uint8_t v)
 For SysMes data: Set system message type (8 bit field)
 
void setSysMesData (uint32_t v)
 For SysMes data: Set system message data (32 bit field)
 
uint16_t getGdpbGenChipId () const
 
void setGdpbGenChipId (uint32_t v)
 
uint16_t getGdpbHitChanId () const
 
uint32_t getGdpbHitFullTs () const
 
uint16_t getGdpbHitCrc () const
 
uint16_t getGdpbHitCoarse () const
 
uint16_t getGdpbHitFineTs () const
 
bool getGdpbHit24Edge () const
 
bool getGdpbHit32DllLck () const
 
uint16_t getGdpbHit32Tot () const
 
bool getGdpbEpLinkId () const
 
uint32_t getGdpbEpEpochNb () const
 
uint16_t getGdpbEpStampTs () const
 
bool getGdpbEpSync () const
 
bool getGdpbEpDataLoss () const
 
bool getGdpbEpEpochLoss () const
 
bool getGdpbEpMissmatch () const
 
uint32_t getGdpbSlcMess () const
 
uint32_t getGdpbSlcData () const
 
uint32_t getGdpbSlcType () const
 
uint32_t getGdpbSlcEdge () const
 
uint32_t getGdpbSlcChan () const
 
uint16_t getGdpbSlcCrc () const
 
bool getGdpbSysLinkId () const
 
uint16_t getGdpbSysSubType () const
 
bool getGdpbSysErrRoType () const
 
uint16_t getGdpbSysErrUnused () const
 
uint16_t getGdpbSysErrChanId () const
 
bool getGdpbSysErrEdge () const
 
uint16_t getGdpbSysErrData () const
 
uint32_t getGdpbSysUnkwData () const
 
uint16_t getStarTrigMsgIndex () const
 
uint64_t getGdpbTsMsbStarA () const
 
uint64_t getGdpbTsLsbStarB () const
 
uint64_t getStarTsMsbStarB () const
 
uint64_t getStarTsMidStarC () const
 
uint64_t getStarTsLsbStarD () const
 
uint32_t getStarFillerD () const
 12 bits in between are set to 0
 
uint32_t getStarTokenStarD () const
 
uint32_t getStarDaqCmdStarD () const
 
uint32_t getStarTrigCmdStarD () const
 
void setStarTrigMsgIndex (uint8_t v)
 
void setGdpbTsMsbStarA (uint64_t fullGdpbTs)
 
void setGdpbTsLsbStarB (uint64_t fullGdpbTs)
 
void setStarTsMsbStarB (uint64_t fullStarTs)
 
void setStarTsMidStarC (uint64_t fullStarTs)
 
void setStarTsLsbStarD (uint64_t fullStarTs)
 
void setStarFillerD ()
 12 bits in between are set to 0
 
void setStarTokenStarD (uint16_t v)
 
void setStarDaqCmdStarD (uint8_t v)
 
void setStarTrigCmdStarD (uint8_t v)
 
bool isNopMsg () const
 Returns true is message type is #MSG_NOP (filler message)
 
bool isEpoch2Msg () const
 Returns true is message type is #MSG_EPOCH2 (epoch2 marker)
 
bool isGet4Msg () const
 Returns true is message type is #MSG_GET4 (Get4 hit data)
 
bool isSysMsg () const
 Returns true is message type is #MSG_SYS (system message)
 
bool isGet4SlCtrMsg () const
 Returns true is message type is #MSG_GET4_SLC (GET4 Slow Control)
 
bool isGet4Hit32Msg () const
 Returns true is message type is #MSG_GET4_32B (GET4 Hit Data in 32b mode)
 
bool isGet4SysMsg () const
 Returns true is message type is #MSG_GET4_SYS (GET4 system message)
 
bool isStarTrigger () const
 Returns true is message type is #MSG_STAR_TRI (STAR Trigger message)
 
bool isGet4Hack32Msg () const
 Returns true is message type is #MSG_SYS (system message) and subtype is 32bHack.
 
bool isStartDaqMsg () const
 Returns true if system message and subtype #ROC_SYSMSG_DAQ_START.
 
bool isStopDaqMsg () const
 Returns true if system message and subtype #ROC_SYSMSG_DAQ_FINISH.
 
void printDataCout (unsigned kind=msg_print_Prefix|msg_print_Data, uint32_t epoch=0) const
 Print message in human readable format to cout. More...
 
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. More...
 
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. More...
 
uint64_t getMsgFullTime (uint64_t epoch) const
 
double getMsgFullTimeD (uint64_t epoch) const
 
bool operator< (const gdpb::Message &other) const
 strict weak ordering operator, assumes same epoch for both messages
 
bool assign (void *src, int fmt=formatNormal)
 
bool copyto (void *tgt, int fmt=formatNormal)
 

Static Public Member Functions

static uint64_t FullTimeStamp2 (uint64_t epoch, uint32_t stamp)
 Expanded timestamp for 160 MHz * 19 bit (12 + 7) epochs.
 
static uint64_t CalcDistance (uint64_t start, uint64_t stop)
 Returns the time difference between two expanded time stamps.
 
static double CalcDistanceD (double start, double stop)
 Returns the time difference between two expanded time stamps.
 
static uint32_t RawSize (int fmt)
 

Protected Attributes

uint64_t data
 

Detailed Description

Definition at line 552 of file StETofMessageFormat.h.

Member Function Documentation

uint32_t gdpb::Message::getEpoch2ChipNumber ( ) const
inline

For Epoch2 data: Returns the number of the GET4 chip that send the epoche message (6 bit field)

Definition at line 655 of file StETofMessageFormat.h.

uint32_t gdpb::Message::getEpoch2EpochMissmatch ( ) const
inline

For Epoch2 data: Returns epoch missmatch flag (set in ROC when ROC timestamp and timestamp send by GET4 did not match) (1 bit field)

Definition at line 633 of file StETofMessageFormat.h.

uint32_t gdpb::Message::getEpoch2StampTime ( ) const
inline

For Epoch2 data: Returns the LTS156 bits 11 to 8. This gives information at what time in the Epoche the epoche number was set (2 bit field)

Definition at line 647 of file StETofMessageFormat.h.

uint32_t gdpb::Message::getGet4CRC ( ) const
inline

For Get4 data: Returns the CRC-8 of the rest of the message. For details check the ROC documentation. (8 bit field)

Definition at line 703 of file StETofMessageFormat.h.

uint64_t gdpb::Message::getMsgFullTime ( uint64_t  epoch) const

Returns expanded and adjusted time of message (in ns) epoch should correspond to the message type - epoch2 for Get4, epoch for all others With the DPBs, both GET4 and nXYTER systems operate at the same frequency of 160MHz. When converting from GET4 to nXYTER clocks, one should take into account that initial value of nDPB timestamp counter is 0x80 or 512 ns. Therefore such offset should be applied during conversion => Is it really true? nXYTER or nDPB effect? =====> see '///' lines

Definition at line 504 of file StETofMessageFormat.cxx.

Referenced by operator<().

double gdpb::Message::getMsgFullTimeD ( uint64_t  epoch) const

Returns expanded and adjusted time of message in double (in ns) epoch should correspond to the message type - epoch2 for Get4, epoch for all others Harcoded constants should be implemented better as soon as their value is fixed

TODO: hardcoded -> constant values!!

Definition at line 512 of file StETofMessageFormat.cxx.

uint16_t gdpb::Message::getRocNumber ( ) const
inline

Returns the number of the sending ROC. Valid for all message types.

The field has full 16 bits and allows to aggregate data of up to 64K ROC's in one message stream.

Definition at line 621 of file StETofMessageFormat.h.

void gdpb::Message::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.

Prints a one line representation of the message in to a stream, selected by outType. The stream is cout if outType is kFALSE and FairLogger if outType is kTRUE. The parameter kind is mask with 4 bits

  • gdpb::msg_print_Prefix (1) - ROC number and message type
  • gdpb::msg_print_Data (2) - print all message specific data fields
  • gdpb::msg_print_Hex (4) - print data as hex dump
  • gdpb::msg_print_Human (8) - print in human readable format

If bit msg_print_Human in kind is not set, raw format output is generated. All data fields are shown in hexadecimal. This is the format of choice when chasing hardware problems at the bit level.

If bit msg_print_Human is set, a more human readable output is generated. The timestamp is shown as fully extended and adjusted time as returned by the getMsgFullTime(uint32_t) const method. All data fields are represented in decimal.

Parameters
osoutput stream
kindmask determing output format
epochcurrent epoch number (from last epoch message)

Typical message output in human format looks like

Msg:7 Roc:1 SysType: 1 Nx:0 Data:        0 : DAQ started
Msg:7 Roc:1 SysType: 6 Nx:0 Data:        0 : FIFO reset
Msg:2 Roc:1 EPO @    0.536870912 Epo:     32768 0x00008000 Miss:   0
Msg:0 Roc:0 NOP (raw 80:40:82:0F:00:00)
Msg:2 Roc:1 EPO @    0.646627328 Epo:     39467 0x00009a2b Miss:   0
Msg:1 Roc:1 HIT @    0.646614333 Nx:2 Chn: 12 Ts: 3389-e( 8) Adc:2726 Pu:0 Of:0
Msg:1 Roc:1 HIT @    0.646630717 Nx:2 Chn: 13 Ts: 3389  ( 0) Adc:2745 Pu:0 Of:0
Msg:2 Roc:1 EPO @    0.805306368 Epo:     49152 0x0000c000 Miss:   0
Msg:3 Roc:1 SYN @    0.805306408 Chn:2 Ts:   40   Data:   49152 0x00c000 Flag:0
Msg:7 Roc:1 SysType: 2 Nx:0 Data:        0 : DAQ finished

Typical message output in binary format looks like

Msg:7 Roc:1 SysType: 1 Nx:0 Data:        0 : DAQ started
Msg:7 Roc:1 SysType: 6 Nx:0 Data:        0 : FIFO reset
Msg:2 Roc:1 Epoch:00008000 Missed:00
Msg:1 Roc:1 Nx:2 Chn:0d Ts:3ec9 Last:1 Msb:7 Adc:a22 Pup:0 Oflw:0
Msg:1 Roc:1 Nx:2 Chn:0e Ts:3ec9 Last:0 Msb:7 Adc:a18 Pup:0 Oflw:0
Msg:0 Roc:0 NOP (raw 80:40:82:0F:00:00)
Msg:2 Roc:1 Epoch:00010000 Missed:00
Msg:3 Roc:1 SyncChn:2 EpochLSB:0 Ts:0028 Data:010000 Flag:0
Msg:7 Roc:1 SysType: 2 Nx:0 Data:        0 : DAQ finished

Definition at line 652 of file StETofMessageFormat.cxx.

void gdpb::Message::printDataCout ( unsigned  kind = msg_print_Prefix | msg_print_Data,
uint32_t  epoch = 0 
) const

Print message in human readable format to cout.

Prints a one line representation of the message in to cout. See printData(std::ostream&, unsigned, uint32_t) const for full documentation.

Definition at line 580 of file StETofMessageFormat.cxx.

void gdpb::Message::printDataLog ( unsigned  kind = msg_print_Prefix | msg_print_Data,
uint32_t  epoch = 0 
) const

Print message in human readable format to the Fairroot logger.

Prints a one line representation of the message in to the Fairroot logger. TODO: Add coloring of possible See printData(std::ostream&, unsigned, uint32_t) const for full documentation.

Definition at line 594 of file StETofMessageFormat.cxx.

void gdpb::Message::setEpoch2ChipNumber ( uint32_t  v)
inline

For Epoch2 data: Set the number of the GET4 chip that send the epoche message (6 bit field)

Definition at line 679 of file StETofMessageFormat.h.

void gdpb::Message::setEpoch2StampTime ( uint32_t  v)
inline

For Epoch2 data: Set the LTS156 bits 11 to 8. This gives information at what time in the Epoche the epoche number was set (2 bit field)

Definition at line 672 of file StETofMessageFormat.h.

void gdpb::Message::setGet4CRC ( uint32_t  v)
inline

For Get4 data: Set the CRC-8 of the rest of the message For details check the ROC documentation. (8 bit field)

Definition at line 720 of file StETofMessageFormat.h.


The documentation for this class was generated from the following files: