Belle II Software development
SndHdrTemp Class Reference
Inheritance diagram for SndHdrTemp:

Public Types

enum  { SENDHDR_NWORDS = 6 }
 

Public Member Functions

 SndHdrTemp ()
 Default constructor.
 
 SndHdrTemp (int *)
 Constructor using existing pointer to raw data buffer.
 
 ~SndHdrTemp ()
 Destructor.
 
int * GetBuffer (void)
 Get Header contents.
 
void SetBuffer (int *hdr)
 set buffer
 
void Initialize ()
 
void SetNwords (int total_data_nwords)
 initialize Header
 
void SetNumEventsinPacket (int num_events)
 set contents of Header
 
void SetNumNodesinPacket (int num_nodes)
 
void SetEventNumber (int eve_num)
 
void SetNodeID (int node_id)
 
void SetExpRunWord (unsigned int exp_run)
 
void SetRunNum (int run_num)
 
void SetSubRunNum (int subrun_num)
 
void SetExpNum (int exp_num)
 
int GetTotalNwords ()
 
int GetHdrNwords ()
 get contents of Header
 
int GetNumEventsinPacket ()
 get contents of Header
 
int GetNumNodesinPacket ()
 
int GetEventNumber ()
 
int GetNodeID ()
 
int GetRunNum ()
 
int GetSubRunNum ()
 
int GetExpNum ()
 
int GetRunNumSubRunNum ()
 

Public Attributes

RawHeader_latest tmp_header
 

Private Types

enum  {
  POS_NWORDS = 0 ,
  POS_HDR_NWORDS = 1 ,
  POS_NUM_EVE_NUM_NODES = 2 ,
  POS_EXP_RUN_NUM = 3 ,
  POS_EVE_NUM = 4 ,
  POS_NODE_ID = 5
}
 

Private Member Functions

 ClassDef (SndHdrTemp, 1)
 

Private Attributes

int m_buffer [SENDHDR_NWORDS]
 

Detailed Description

Definition at line 22 of file SndHdrTemp.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Definition at line 71 of file SndHdrTemp.h.

71 {
72 SENDHDR_NWORDS = 6
73 };

◆ anonymous enum

anonymous enum
private

Definition at line 78 of file SndHdrTemp.h.

78 {
79 POS_NWORDS = 0,
80 POS_HDR_NWORDS = 1,
81 POS_NUM_EVE_NUM_NODES = 2,
82 POS_EXP_RUN_NUM = 3,
83 POS_EVE_NUM = 4,
84 POS_NODE_ID = 5
85 };

Constructor & Destructor Documentation

◆ SndHdrTemp() [1/2]

Default constructor.

Definition at line 15 of file SndHdrTemp.cc.

16{
17 Initialize();
18 // cout << "SndHdrTemp NULL constructor" << endl;
19}

◆ SndHdrTemp() [2/2]

SndHdrTemp ( int *  buffer)

Constructor using existing pointer to raw data buffer.

Definition at line 21 of file SndHdrTemp.cc.

22{
23 // cout << "SndHdrTemp constructor with buffer" << endl;
24 memcpy(m_buffer, buffer, SENDHDR_NWORDS * sizeof(int));
25}

◆ ~SndHdrTemp()

~SndHdrTemp ( )

Destructor.

Definition at line 27 of file SndHdrTemp.cc.

28{
29}

Member Function Documentation

◆ GetBuffer()

int * GetBuffer ( void  )

Get Header contents.

Definition at line 31 of file SndHdrTemp.cc.

32{
33 return m_buffer;
34}

◆ GetEventNumber()

int GetEventNumber ( )

Definition at line 132 of file SndHdrTemp.cc.

132{ return m_buffer[ POS_EVE_NUM ]; }

◆ GetExpNum()

int GetExpNum ( )

Definition at line 154 of file SndHdrTemp.cc.

155{
156
157 return (((unsigned int)(m_buffer[ POS_EXP_RUN_NUM ]) & tmp_header.EXP_MASK) >> tmp_header.EXP_SHIFT);
158}

◆ GetHdrNwords()

int GetHdrNwords ( )

get contents of Header

Definition at line 123 of file SndHdrTemp.cc.

123{ return SENDHDR_NWORDS; }

◆ GetNodeID()

int GetNodeID ( )

Definition at line 134 of file SndHdrTemp.cc.

134{ return m_buffer[ POS_NODE_ID ]; }

◆ GetNumEventsinPacket()

int GetNumEventsinPacket ( )

get contents of Header

Definition at line 124 of file SndHdrTemp.cc.

125{
126 return
127 ((m_buffer[ POS_NUM_EVE_NUM_NODES ] & 0xFFFF0000) >> 16) & 0x0000FFFF;
128
129}

◆ GetNumNodesinPacket()

int GetNumNodesinPacket ( )

Definition at line 130 of file SndHdrTemp.cc.

130{ return m_buffer[ POS_NUM_EVE_NUM_NODES ] & 0x0000FFFF; }

◆ GetRunNum()

int GetRunNum ( )

Definition at line 136 of file SndHdrTemp.cc.

137{
138 return (((unsigned int)(m_buffer[ POS_EXP_RUN_NUM ]) & tmp_header.RUNNO_MASK) >> tmp_header.RUNNO_SHIFT);
139}

◆ GetRunNumSubRunNum()

int GetRunNumSubRunNum ( )

Definition at line 146 of file SndHdrTemp.cc.

147{
148
149 return ((unsigned int)(m_buffer[ POS_EXP_RUN_NUM ]) &
150 (tmp_header.RUNNO_MASK | tmp_header.SUBRUNNO_MASK));
151}

◆ GetSubRunNum()

int GetSubRunNum ( )

Definition at line 141 of file SndHdrTemp.cc.

142{
143 return ((unsigned int)(m_buffer[ POS_EXP_RUN_NUM ]) & tmp_header.SUBRUNNO_MASK);
144}

◆ GetTotalNwords()

int GetTotalNwords ( )

Definition at line 122 of file SndHdrTemp.cc.

122{ return m_buffer[ POS_NWORDS ];}

◆ Initialize()

void Initialize ( )

Definition at line 41 of file SndHdrTemp.cc.

42{
43 memset(m_buffer, 0, sizeof(int)* SENDHDR_NWORDS);
44 m_buffer[ POS_HDR_NWORDS ] = SENDHDR_NWORDS;
45}

◆ SetBuffer()

void SetBuffer ( int *  hdr)

set buffer

Definition at line 36 of file SndHdrTemp.cc.

37{
38 memcpy(m_buffer, bufin, SENDHDR_NWORDS * sizeof(int));
39}

◆ SetEventNumber()

void SetEventNumber ( int  eve_num)

Definition at line 75 of file SndHdrTemp.cc.

76{
77 m_buffer[ POS_EVE_NUM ] = eve_num;
78}

◆ SetExpNum()

void SetExpNum ( int  exp_num)

Definition at line 107 of file SndHdrTemp.cc.

108{
109
110 unsigned int inv_mask = ~((unsigned int)(tmp_header.EXP_MASK));
111 m_buffer[ POS_EXP_RUN_NUM ] =
112 ((unsigned int)m_buffer[ POS_EXP_RUN_NUM ] & inv_mask) |
113 (((unsigned int)exp_num << tmp_header.EXP_SHIFT) & tmp_header.EXP_MASK);
114
115 return;
116}

◆ SetExpRunWord()

void SetExpRunWord ( unsigned int  exp_run)

Definition at line 55 of file SndHdrTemp.cc.

56{
57 m_buffer[ POS_EXP_RUN_NUM ] = exp_run;
58}

◆ SetNodeID()

void SetNodeID ( int  node_id)

Definition at line 81 of file SndHdrTemp.cc.

82{
83 m_buffer[ POS_NODE_ID ] = node_id;
84}

◆ SetNumEventsinPacket()

void SetNumEventsinPacket ( int  num_events)

set contents of Header

Definition at line 60 of file SndHdrTemp.cc.

61{
62 m_buffer[ POS_NUM_EVE_NUM_NODES ] =
63 (m_buffer[ POS_NUM_EVE_NUM_NODES ] & 0x0000FFFF) |
64 ((num_events << 16) & 0xFFFF0000);
65}

◆ SetNumNodesinPacket()

void SetNumNodesinPacket ( int  num_nodes)

Definition at line 67 of file SndHdrTemp.cc.

68{
69 m_buffer[ POS_NUM_EVE_NUM_NODES ] =
70 (m_buffer[ POS_NUM_EVE_NUM_NODES ] & 0xFFFF0000) |
71 (num_nodes & 0x0000FFFF);
72}

◆ SetNwords()

void SetNwords ( int  total_data_nwords)

initialize Header

Definition at line 50 of file SndHdrTemp.cc.

51{
52 m_buffer[ POS_NWORDS ] = total_data_nwords;
53}

◆ SetRunNum()

void SetRunNum ( int  run_num)

Definition at line 87 of file SndHdrTemp.cc.

88{
89
90 unsigned int inv_mask = ~((unsigned int)(tmp_header.RUNNO_MASK));
91 m_buffer[ POS_EXP_RUN_NUM ] =
92 ((unsigned int)m_buffer[ POS_EXP_RUN_NUM ] & inv_mask) |
93 (((unsigned int)run_num << tmp_header.RUNNO_SHIFT) & tmp_header.RUNNO_MASK);
94
95 return;
96}

◆ SetSubRunNum()

void SetSubRunNum ( int  subrun_num)

Definition at line 98 of file SndHdrTemp.cc.

99{
100
101 unsigned int inv_mask = ~((unsigned int)(tmp_header.SUBRUNNO_MASK));
102 m_buffer[ POS_EXP_RUN_NUM ] =
103 ((unsigned int)m_buffer[ POS_EXP_RUN_NUM ] & inv_mask) | ((unsigned int)subrun_num & tmp_header.SUBRUNNO_MASK);
104 return;
105}

Member Data Documentation

◆ m_buffer

int m_buffer[SENDHDR_NWORDS]
private

Definition at line 89 of file SndHdrTemp.h.

◆ tmp_header

RawHeader_latest tmp_header

Definition at line 68 of file SndHdrTemp.h.


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