Belle II Software  release-08-01-10
RawHeader_v0 Class Reference

The Raw Header class ver.0 ( from August, 2013 to April, 2014 ) This class defines the format of the header of RawCOPPER class data and used for extracting header info from RawCOPPER object. More...

#include <RawHeader_v0.h>

Public Types

enum  {
  FORMAT_VERSION__MASK = 0x0000FF00 ,
  FORMAT_VERSION_SHIFT = 8
}
 
enum  {
  EXP_MASK = 0xFFC00000 ,
  EXP_SHIFT = 22 ,
  RUNNO_MASK = 0x003FFF00 ,
  RUNNO_SHIFT = 8 ,
  SUBRUNNO_MASK = 0x000000FF
}
 
enum  { RAWHEADER_NWORDS = 20 }
 
enum  {
  POS_NWORDS = 0 ,
  POS_HDR_NWORDS = 1 ,
  POS_EXP_RUN_NO = 2 ,
  POS_EVE_NO = 3 ,
  POS_TTCTIME_TRGTYPE = 4 ,
  POS_TTUTIME = 5 ,
  POS_NODE_ID = 6 ,
  POS_TRUNC_MASK_DATATYPE = 7 ,
  POS_OFFSET_1ST_FINESSE = 8 ,
  POS_OFFSET_2ND_FINESSE = 9 ,
  POS_OFFSET_3RD_FINESSE = 10 ,
  POS_OFFSET_4TH_FINESSE = 11 ,
  POS_RESVD_1 = 12 ,
  POS_RESVD_2 = 13 ,
  POS_NUM_NODES = 14 ,
  POS_NODES_1 = 15 ,
  POS_NODES_2 = 16 ,
  POS_NODES_3 = 17 ,
  POS_NODES_4 = 18 ,
  POS_TERM_HEADER = 19
}
 
enum  { NUM_MAX_NODES = 4 }
 
enum  { MAGIC_WORD_TERM_HEADER = 0x7fff0005 }
 
enum  {
  TTCTIME_MASK = 0x7FFFFFF0 ,
  TTCTIME_SHIFT = 4 ,
  TRGTYPE_MASK = 0xF
}
 

Public Member Functions

 RawHeader_v0 ()
 Default constructor.
 
 RawHeader_v0 (int *)
 Constructor using existing pointer to raw data buffer.
 
 ~RawHeader_v0 ()
 Destructor.
 
int * GetBuffer ()
 Get header contents.
 
void SetBuffer (int *bufin)
 set buffer
 
void CheckSetBuffer ()
 initialize header
 
void CheckGetBuffer ()
 check if m_buffer exists
 
void Initialize ()
 initialize header
 
void SetNwords (int nwords)
 set contents of header
 
void SetEveNo (unsigned int eve_no)
 set contents of header
 
void SetNodeID (unsigned int node_id)
 set contents of header
 
void SetDataType (int data_type)
 set contents of header
 
void SetTruncMask (int trunc_mask)
 set contents of header
 
void SetFTSW2Words (unsigned int word1, unsigned int word2)
 set contents of header More...
 
void SetExpRunNumber (int *exprun_buf)
 Set a word consists of exp #, run # and subrun #.
 
void SetOffset1stFINESSE (int offset_1st_FINESSE)
 set contents of header
 
void SetOffset2ndFINESSE (int offset_2nd_FINESSE)
 set contents of header
 
void SetOffset3rdFINESSE (int offset_3rd_FINESSE)
 set contents of header
 
void SetOffset4thFINESSE (int offset_4th_FINESSE)
 set contents of header
 
void SetMagicWordEntireHeader ()
 set contents of header
 
int AddNodeInfo (int node_id)
 set magic words; More...
 
int GetNwords ()
 get contents of header
 
int GetHdrNwords ()
 get contents of header
 
unsigned int GetExpRunSubrun ()
 get contents of header
 
int GetExpNo ()
 get a run/exp number combined word
 
int GetRunNo ()
 get contents of header
 
int GetSubRunNo ()
 get run # (14bit)
 
unsigned int GetEveNo ()
 get restart #(8bit)
 
unsigned int GetNodeID ()
 get contents of header
 
int GetDataType ()
 get contents of header
 
int GetTruncMask ()
 get contents of header
 
unsigned int GetErrorBitFlag ()
 get contents of header More...
 
void AddErrorBitFlag (unsigned int error_bit_flag)
 Add Detected Error bitflag.
 
int GetOffset1stFINESSE ()
 get contents of header
 
int GetOffset2ndFINESSE ()
 get contents of header
 
int GetOffset3rdFINESSE ()
 get contents of header
 
int GetOffset4thFINESSE ()
 get contents of header
 
int GetNumNodes ()
 get contents of header
 
int GetNodeInfo (int node_no, int *node_id)
 get contents of header
 
unsigned int GetTTCtimeTRGType ()
 get contents of header
 
int GetTTCtime ()
 get contents of header
 
int GetTRGType ()
 get TRGType
 
unsigned int GetTTUtime ()
 get contents of header
 
void GetTTTimeVal (struct timeval *tv)
 get contents of header
 
unsigned int GetMagicWordEntireHeader ()
 Get magic word to check the data corruption.
 

Private Attributes

int * m_buffer
 do not record buffer ( RawCOPPER includes buffer of RawHeader_v0 and RawTrailer )
 

Detailed Description

The Raw Header class ver.0 ( from August, 2013 to April, 2014 ) This class defines the format of the header of RawCOPPER class data and used for extracting header info from RawCOPPER object.

Definition at line 34 of file RawHeader_v0.h.

Member Function Documentation

◆ AddNodeInfo()

int AddNodeInfo ( int  node_id)

set magic words;

Add nodeinfo in trace area

Definition at line 34 of file RawHeader_v0.cc.

35 {
37  // When the number of total nodes exceeds NUM_MAX_NODES
38  if (GetNumNodes() >= NUM_MAX_NODES) {
39  m_buffer[ POS_NUM_NODES ]++;
40  return -1;
41  }
42 
43  m_buffer[ POS_NODES_1 + m_buffer[ POS_NUM_NODES ] ] = node_id;
44  m_buffer[ POS_NUM_NODES ]++;
45  return 0;
46 }
int * m_buffer
do not record buffer ( RawCOPPER includes buffer of RawHeader_v0 and RawTrailer )
Definition: RawHeader_v0.h:222
void CheckSetBuffer()
initialize header
Definition: RawHeader_v0.h:230
int GetNumNodes()
get contents of header
Definition: RawHeader_v0.h:463

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