Public Member Functions | Static Public Member Functions | Protected Attributes

nxyter::DataDebug Class Reference

Class to hold message data retrieved through the 'debug' interface. More...

#include <DataDebug.h>

Public Member Functions

 DataDebug (uint32_t adc=0, uint32_t nx=0, uint32_t ltslow=0, uint32_t ltshigh=0)
 Default constructor, initialize all fields.
uint32_t getRawAdc () const
 Returns raw ROC_ADC_DATA data.
uint32_t getRawNx () const
 Returns raw ROC_NX_DATA data.
uint32_t getRawLtsLow () const
 Returns raw ROC_LT_LOW data.
uint32_t getRawLtsHigh () const
 Returns raw ROC_LT_HIGH data.
uint64_t getRawLts () const
 Returns full 64bit ROC local timestamp (unit=4ns 250 MHz clock).
uint32_t getRawMessageType () const
 Returns raw message type.
uint32_t getNxAdcValue () const
 Returns nXYTER ADC value.
uint32_t getNxNumber () const
 Returns nXYTER number.
uint32_t getRawNxChNum () const
 Returns raw (gray encoded) nXYTER channel number.
uint32_t getNxChNum () const
 Returns ungrayed nXYTER channel number.
uint32_t getRawNxTs () const
 Returns raw (gray encoded) nXYTER timestamp (unit=1ns).
uint32_t getNxTs () const
 Returns ungrayed nXYTER timestamp.
uint32_t getNxParity () const
 Returns nXYTER parity bit as send from chip.
uint32_t getNxParityCheck () const
 Returns nXYTER parity re-calculated from data.
void print (std::ostream &os) const
 Print message to stream os.

Static Public Member Functions

static uint32_t ungray (uint32_t val, int n)
 Returns the first n bits of val after Gray decoding.

Protected Attributes

uint32_t fAdc
 data from ROC_ADC_DATA
uint32_t fNx
 data from ROC_NX_DATA
uint32_t fLtsLow
 data from ROC_LT_LOW
uint32_t fLtsHigh
 data from ROC_LT_HIGH

Detailed Description

Class to hold message data retrieved through the 'debug' interface.

The 'debug' port provided via registers ROC_ADC_DATA, ROC_NX_DATA and ROC_LT_LOW / ROC_LT_HIGH gives direct access to the 'wide FIFO' in the ROC logic.

For nXYTER message the 'wide-fifo' holds the raw data from ADC and nXYTER which contains information not available in the final message. For non-nXYTER messages final 48 bit message is stored in the 16 bit 'ADC' and 32 bit 'NX' part of the FIFO.

The data format is:

ROC_ADC_DATA
  • bit 15:12 indicate the message type
    • '000': nXYTER message
    • '011': Sync message
    • '100': aux message
    • '111': GPIO parity message
  • bit 11:0 hold ADC data for nXYTER message, and the upper 12 bits of of a non-nXYTER message
ROC_NX_DATA
Holds the raw nXYTER data as they come from the chip in case of nXYTER messages, only difference is that the nXYTER number is packed into bit 4:3. Note that bit 7,15,23 and 31 hold the 4 phases of the 'valid bit', which should ne 0,0,0, and 1 respectively for a valid hit. In case of non-nXYTER messages this register holds the 32 LSB of the respective message.
ROC_LT_HIGH/ ROC_LT_LOW
Holds the local timestamp counter of the ROC latched at the time of data capture. This counter runs at 250 MHz clock, the LSB thus corresponds to 4 ns.

Definition at line 9 of file DataDebug.h.


Constructor & Destructor Documentation

nxyter::DataDebug::DataDebug ( uint32_t  adc = 0,
uint32_t  nx = 0,
uint32_t  ltslow = 0,
uint32_t  ltshigh = 0 
) [inline, explicit]

Default constructor, initialize all fields.

Definition at line 19 of file DataDebug.h.


Member Function Documentation

uint32_t nxyter::DataDebug::getNxAdcValue (  )  const [inline]

Returns nXYTER ADC value.

Definition at line 46 of file DataDebug.h.

References fAdc.

Referenced by print().

uint32_t nxyter::DataDebug::getNxChNum (  )  const [inline]

Returns ungrayed nXYTER channel number.

Definition at line 58 of file DataDebug.h.

References getRawNxChNum(), and ungray().

Referenced by print().

uint32_t nxyter::DataDebug::getNxNumber (  )  const [inline]

Returns nXYTER number.

Definition at line 50 of file DataDebug.h.

References fNx.

Referenced by print().

uint32_t nxyter::DataDebug::getNxParity (  )  const [inline]

Returns nXYTER parity bit as send from chip.

See also:
getNxParityCheck()

Definition at line 70 of file DataDebug.h.

References fNx.

Referenced by print().

uint32_t nxyter::DataDebug::getNxParityCheck (  )  const

Returns nXYTER parity re-calculated from data.

Calculates the parity from data, XOR'ing Bits 30:24, 21:16, 14:8 and 2:0.

See also:
getNxParity()

Definition at line 177 of file DataDebug.cxx.

References fNx.

Referenced by print().

uint32_t nxyter::DataDebug::getNxTs (  )  const [inline]

Returns ungrayed nXYTER timestamp.

Definition at line 66 of file DataDebug.h.

References getRawNxTs(), and ungray().

Referenced by print().

uint32_t nxyter::DataDebug::getRawAdc (  )  const [inline]

Returns raw ROC_ADC_DATA data.

Definition at line 25 of file DataDebug.h.

References fAdc.

uint64_t nxyter::DataDebug::getRawLts (  )  const [inline]

Returns full 64bit ROC local timestamp (unit=4ns 250 MHz clock).

Definition at line 38 of file DataDebug.h.

References fLtsHigh, and fLtsLow.

Referenced by print().

uint32_t nxyter::DataDebug::getRawLtsHigh (  )  const [inline]

Returns raw ROC_LT_HIGH data.

Definition at line 34 of file DataDebug.h.

References fLtsHigh.

uint32_t nxyter::DataDebug::getRawLtsLow (  )  const [inline]

Returns raw ROC_LT_LOW data.

Definition at line 31 of file DataDebug.h.

References fLtsLow.

uint32_t nxyter::DataDebug::getRawMessageType (  )  const [inline]

Returns raw message type.

Definition at line 42 of file DataDebug.h.

References fAdc.

Referenced by print().

uint32_t nxyter::DataDebug::getRawNx (  )  const [inline]

Returns raw ROC_NX_DATA data.

Definition at line 28 of file DataDebug.h.

References fNx.

uint32_t nxyter::DataDebug::getRawNxChNum (  )  const [inline]

Returns raw (gray encoded) nXYTER channel number.

Definition at line 54 of file DataDebug.h.

References fNx.

Referenced by getNxChNum().

uint32_t nxyter::DataDebug::getRawNxTs (  )  const [inline]

Returns raw (gray encoded) nXYTER timestamp (unit=1ns).

Definition at line 62 of file DataDebug.h.

References fNx.

Referenced by getNxTs().

void nxyter::DataDebug::print ( std::ostream &  os  )  const

Print message to stream os.

A nXYTER message is printed in the format

H: a:2817 nx:1000:1a:1d:00:00  0,  0, 9027 lts:0:00000024:8ee 00149742   +3,5,1
H: a:2789 nx:1000:1a:1c:00:11  2,  0, 9026 lts:0:00000024:8ee 00149742   +3,5,2
H: a:2801 nx:1000:1a:1d:00:18  3,  0, 9027 lts:0:00000024:8ee 00149742   +3,5,1
        ^    ^    ^          ^ ^   ^     ^     ^              ^           ^ ^ ^
        |    |    |          | |   |     |     |              |           | | |
        |    |    nx rawdata | |   |     |     ROC local      timestamp   delta 
        |    |    bytes, bit | |   |     |     timestamp      in decimal  time
        |    |    6:0 only   | |   |     |                                stamp
        |    |               | |   |     nx Timestamp (ungrayed)          see  
        |    nx raw data     | |   nx channel number                      below
        |    valid bits      | nx number (ungrayed)                           
        |                    |                                                 
        nx ADC value         Indicator for nx Parity Error ("P")               

The difference between the ROC local time stamp and the nXYTER timestamp is represented in the format "+a,b,c" with

  • first part representing the 'read-out clock difference, measured in 31.25 MHz clock cycles (1 count = 32 ns). This part is signed and can vary between -7 and +505.
  • second part is the 250 MHz subslot used in the ROC to capture the data. (1 count = 4 ns).
  • third part is the 'fine time' and reflect the 2 LSB of the nXYTER timestamp (1 count = 1 ns).

A non-nXYTER message is currently simply dumped in the format

M:  typ:3 dat:0000:50000080 lts:0:00000020:09f 00131231
M:  typ:3 dat:0000:50000100 lts:0:00000040:09f 00262303
M:  typ:3 dat:0000:50000180 lts:0:00000060:09f 00393375
        ^     ^    ^            ^          
        |     |    |            |
        |     |    |            ROC local Timestamp as for nXYTER messages
        |     |    bits 31:0 of message
        |     bits 44:32 of message
        raw message type: 3=sync; 4=aux; 7=system
 

Definition at line 99 of file DataDebug.cxx.

References fAdc, fLtsLow, fNx, getNxAdcValue(), getNxChNum(), getNxNumber(), getNxParity(), getNxParityCheck(), getNxTs(), getRawLts(), and getRawMessageType().

uint32_t nxyter::DataDebug::ungray ( uint32_t  val,
int  n 
) [static]

Returns the first n bits of val after Gray decoding.

Definition at line 193 of file DataDebug.cxx.

Referenced by getNxChNum(), and getNxTs().


Field Documentation

uint32_t nxyter::DataDebug::fAdc [protected]

data from ROC_ADC_DATA

Definition at line 12 of file DataDebug.h.

Referenced by getNxAdcValue(), getRawAdc(), getRawMessageType(), and print().

uint32_t nxyter::DataDebug::fLtsHigh [protected]

data from ROC_LT_HIGH

Definition at line 15 of file DataDebug.h.

Referenced by getRawLts(), and getRawLtsHigh().

uint32_t nxyter::DataDebug::fLtsLow [protected]

data from ROC_LT_LOW

Definition at line 14 of file DataDebug.h.

Referenced by getRawLts(), getRawLtsLow(), and print().

uint32_t nxyter::DataDebug::fNx [protected]

data from ROC_NX_DATA

Definition at line 13 of file DataDebug.h.

Referenced by getNxNumber(), getNxParity(), getNxParityCheck(), getRawNx(), getRawNxChNum(), getRawNxTs(), and print().


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