DABC (Data Acquisition Backbone Core)  2.9.9
Public Member Functions | Protected Attributes
hadaq::RawSubevent Struct Reference

Hadaq subevent structure. More...

#include <hadaq/defines.h>

Inheritance diagram for hadaq::RawSubevent:
hadaq::HadTuId hadaq::HadTu

Public Member Functions

unsigned Alignment () const
 
void CopyDataTo (void *buf, unsigned indx, unsigned datalen)
 
uint32_t Data (unsigned idx) const
 swap-save access to any data. More...
 
void Dump (bool print_raw_data=false)
 Print subevent header and optionally raw data. More...
 
uint32_t * GetDataPtr (unsigned indx) const
 Return pointer on data by index - user should care itself about swapping. More...
 
uint32_t GetErrBits ()
 
unsigned GetNrOfDataWords () const
 
uint32_t GetTrigNr () const
 
uint8_t GetTrigTypeTrb3 () const
 
void Init (uint32_t trigger=0)
 
void PrintRawData (unsigned ix=0, unsigned len=0xffffffff, unsigned prefix=6)
 Print raw data, optionally one can position and portion to print. More...
 
void * RawData () const
 Return pointer where raw data should starts. More...
 
 RawSubevent ()
 
void SetTrigNr (uint32_t trigger)
 
void SetTrigTypeTrb3 (uint8_t typ)
 
- Public Member Functions inherited from hadaq::HadTuId
bool GetDataError () const
 
uint32_t GetId () const
 
 HadTuId ()
 
void SetDataError (bool on)
 
void SetId (uint32_t id)
 
- Public Member Functions inherited from hadaq::HadTu
uint32_t GetDecoding () const
 
uint32_t GetPaddedSize () const
 
uint32_t GetSize () const
 
 HadTu ()
 
bool IsSwapped () const
 msb of decode word is always non zero...? More...
 
void SetDecoding (uint32_t decod)
 
void SetDecodingDirect (uint32_t dec)
 
void SetSize (uint32_t bytes)
 
void SetValue (uint32_t *member, uint32_t val)
 swapsave method to set value stolen from hadtu.h More...
 
uint32_t Value (const uint32_t *member) const
 

Protected Attributes

uint32_t subEvtTrigNr
 
- Protected Attributes inherited from hadaq::HadTuId
uint32_t tuId
 
- Protected Attributes inherited from hadaq::HadTu
uint32_t tuDecoding
 
uint32_t tuSize
 

Detailed Description

Hadaq subevent structure.

Every event contains zero to unspecified many subevents. As an empty event is allowed, data outside of any subevent are not allowed. A subevents consists out of a fixed size subevent header and a varying number of data words.

  The subevent header
  subEvtHeader
  subEvtSize   subEvtDecoding    subEvtId    subEvtTrigNr
      o subEvtSize - size of the subevent: This includes the the subevent header, it is measured in bytes.
      o subEvtDecoding - subevent decoding type: Tells the analysis the binary format of the subevent data, so that it can be handed to a corresponding routine for unpacking into a software usable data structure. For easier decoding of this word, the meaning of some bits is already predefined:
        subEvtDecoding
        msB    ---   ---   lsB
        0   data type   decoding type  nonzero
            + The first (most significant) byte is always zero
            + The second byte contains the word length of the subevent data. 0 = byte, 1 = 16 bit word, 2 = 32 bit word...
            + The remaining two bytes form the actual decoding type, e.g. fixed length, zero suppressed etc.
            + The last byte must not be zero, so the whole subEvtDecoding can be used to check for correct or swapped byte order. It is stated again, that the whole subEvtDecoding is one 32bit word. The above bit assignments are merely a rule how to select this 32bit numbers.
      o subEvtId - subevent identifier: Tells the analysis the semantics of the subevent data, e.g. every subevent builder may get its own subEvtId. So the data structure can be analyzed by the corresponding routine after unpacking.
        1-99   DAQ
        100-199   RICH
        200-299   MDC
        300-399   SHOWER
        400-499   TOF
        500-599   TRIG
        600-699   SLOW
        700-799   TRB_RPC  common TRB, but contents is RPC
        800-899   TRB_HOD  pion-hodoscope
        900-999   TRB_FW   forward wall
        1000-1099    TRB_START   start detector
        1100-1199    TRB_TOF  TOF detector
        1200-1299    TRB RICH    RICH detector

Additionally, all subEvtIds may have the MSB set. This indicates a sub event of the corresponding id that contains broken data (e.g. parity check failed, sub event was too long etc.).

      o subEvtTrigNr - subevent Trigger Number: This is the event tag that is produced by the trigger system and is used for checking the correct assembly of several sub entities. In general, this number is not counting sequentially. The lowest significant byte represents the trigger tag generated by the CTU and has to be same for all detector subsystems in one event. The rest is filled by the EB.
  The data words: The format of the data words (word length, compression algorithm, sub-sub-event format) is defined by the subEvtDecoding and apart from this it is completely free. The meaning of the data words (detector, geographical position, error information) is defined by the subEvtId and apart from this it is completely unknown to the data acquisition system.

Definition at line 262 of file defines.h.

Constructor & Destructor Documentation

◆ RawSubevent()

hadaq::RawSubevent::RawSubevent ( )
inline

Definition at line 270 of file defines.h.

Member Function Documentation

◆ Alignment()

unsigned hadaq::RawSubevent::Alignment ( ) const
inline

Definition at line 272 of file defines.h.

◆ GetTrigNr()

uint32_t hadaq::RawSubevent::GetTrigNr ( ) const
inline

Definition at line 274 of file defines.h.

◆ SetTrigNr()

void hadaq::RawSubevent::SetTrigNr ( uint32_t  trigger)
inline

Definition at line 275 of file defines.h.

◆ GetTrigTypeTrb3()

uint8_t hadaq::RawSubevent::GetTrigTypeTrb3 ( ) const
inline

Definition at line 278 of file defines.h.

◆ SetTrigTypeTrb3()

void hadaq::RawSubevent::SetTrigTypeTrb3 ( uint8_t  typ)
inline

Definition at line 280 of file defines.h.

◆ Init()

void hadaq::RawSubevent::Init ( uint32_t  trigger = 0)
inline

Definition at line 286 of file defines.h.

◆ GetDataPtr()

uint32_t* hadaq::RawSubevent::GetDataPtr ( unsigned  indx) const
inline

Return pointer on data by index - user should care itself about swapping.

Definition at line 292 of file defines.h.

◆ GetNrOfDataWords()

unsigned hadaq::RawSubevent::GetNrOfDataWords ( ) const
inline

Definition at line 298 of file defines.h.

◆ Data()

uint32_t hadaq::RawSubevent::Data ( unsigned  idx) const
inline

swap-save access to any data.

stolen from hadtu.h

Definition at line 309 of file defines.h.

◆ GetErrBits()

uint32_t hadaq::RawSubevent::GetErrBits ( )
inline

Definition at line 329 of file defines.h.

◆ CopyDataTo()

void hadaq::RawSubevent::CopyDataTo ( void *  buf,
unsigned  indx,
unsigned  datalen 
)
inline

Definition at line 334 of file defines.h.

◆ RawData()

void* hadaq::RawSubevent::RawData ( ) const
inline

Return pointer where raw data should starts.

Definition at line 344 of file defines.h.

◆ Dump()

void hadaq::RawSubevent::Dump ( bool  print_raw_data = false)

Print subevent header and optionally raw data.

Definition at line 97 of file defines.cxx.

◆ PrintRawData()

void hadaq::RawSubevent::PrintRawData ( unsigned  ix = 0,
unsigned  len = 0xffffffff,
unsigned  prefix = 6 
)

Print raw data, optionally one can position and portion to print.

Definition at line 79 of file defines.cxx.

Field Documentation

◆ subEvtTrigNr

uint32_t hadaq::RawSubevent::subEvtTrigNr
protected

Definition at line 266 of file defines.h.


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