Belle II Software development
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
 
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;
 
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
 
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 Enumeration Documentation

◆ anonymous enum

anonymous enum

Definition at line 161 of file RawHeader_v0.h.

161 {
162 FORMAT_VERSION__MASK = 0x0000FF00,
163 FORMAT_VERSION_SHIFT = 8
164 };

◆ anonymous enum

anonymous enum

Definition at line 166 of file RawHeader_v0.h.

166 {
167 EXP_MASK = 0xFFC00000,
168 EXP_SHIFT = 22,
169 RUNNO_MASK = 0x003FFF00,
170 RUNNO_SHIFT = 8,
171 SUBRUNNO_MASK = 0x000000FF
172 };

◆ anonymous enum

anonymous enum

Definition at line 174 of file RawHeader_v0.h.

174 {
175 RAWHEADER_NWORDS = 20
176 };

◆ anonymous enum

anonymous enum

Definition at line 179 of file RawHeader_v0.h.

179 {
180 POS_NWORDS = 0,
181 POS_HDR_NWORDS = 1,
182 POS_EXP_RUN_NO = 2,
183 POS_EVE_NO = 3,
184 POS_TTCTIME_TRGTYPE = 4,
185 POS_TTUTIME = 5,
186 POS_NODE_ID = 6,
187 POS_TRUNC_MASK_DATATYPE = 7,
188 POS_OFFSET_1ST_FINESSE = 8,
189 POS_OFFSET_2ND_FINESSE = 9,
190 POS_OFFSET_3RD_FINESSE = 10,
191 POS_OFFSET_4TH_FINESSE = 11,
192 POS_RESVD_1 = 12,
193 POS_RESVD_2 = 13,
194 POS_NUM_NODES = 14,
195 POS_NODES_1 = 15,
196 POS_NODES_2 = 16,
197 POS_NODES_3 = 17,
198 POS_NODES_4 = 18,
199 POS_TERM_HEADER = 19
200 };

◆ anonymous enum

anonymous enum

Definition at line 202 of file RawHeader_v0.h.

202 {
203 NUM_MAX_NODES = 4 /* (NUM_MAX_NODES + 1) slots are available in m_buffer.
204 (NUM_MAX_NODES +1 )th slot is filled with -1, when the number of total nodes
205 exceeds NUM_MAX_NODES */
206 };

◆ anonymous enum

anonymous enum

Definition at line 209 of file RawHeader_v0.h.

209 {
210 MAGIC_WORD_TERM_HEADER = 0x7fff0005
211 };

◆ anonymous enum

anonymous enum

Definition at line 214 of file RawHeader_v0.h.

214 {
215 TTCTIME_MASK = 0x7FFFFFF0,
216 TTCTIME_SHIFT = 4,
217 TRGTYPE_MASK = 0xF
218 };

Constructor & Destructor Documentation

◆ RawHeader_v0() [1/2]

Default constructor.

Definition at line 17 of file RawHeader_v0.cc.

18{
19 m_buffer = NULL;
20 // initialize();
21 // cout << "RawHeader_v0 NULL constructor" << endl;
22}
int * m_buffer
do not record buffer ( RawCOPPER includes buffer of RawHeader_v0 and RawTrailer )
Definition: RawHeader_v0.h:222

◆ RawHeader_v0() [2/2]

RawHeader_v0 ( int *  buffer)
explicit

Constructor using existing pointer to raw data buffer.

Definition at line 24 of file RawHeader_v0.cc.

25{
26 m_buffer = buffer;
27}

◆ ~RawHeader_v0()

Destructor.

Definition at line 29 of file RawHeader_v0.cc.

30{
31}

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}
void CheckSetBuffer()
initialize header
Definition: RawHeader_v0.h:230
int GetNumNodes()
get contents of header
Definition: RawHeader_v0.h:463

◆ GetBuffer()

int * GetBuffer ( )
inline

Get header contents.

Definition at line 46 of file RawHeader_v0.h.

46{ return m_buffer; }

◆ GetNodeInfo()

int GetNodeInfo ( int  node_no,
int *  node_id 
)

get contents of header

Definition at line 48 of file RawHeader_v0.cc.

49{
51 if (node_no >= GetNumNodes()) {
52 return -1;
53 }
54 *node_id = m_buffer[ POS_NODES_1 + node_no ];
55
56 return 0;
57}
void CheckGetBuffer()
check if m_buffer exists
Definition: RawHeader_v0.h:237

◆ SetBuffer()

void SetBuffer ( int *  bufin)
inline

set buffer

Definition at line 49 of file RawHeader_v0.h.

49{ m_buffer = bufin; }

Member Data Documentation

◆ m_buffer

int* m_buffer
private

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

Definition at line 222 of file RawHeader_v0.h.


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