Belle II Software  release-06-02-00
SendHeader.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #ifndef SENDHEADER_H
10 #define SENDHEADER_H
11 
12 #include "rawdata/dataobjects/RawHeader_latest.h"
13 
14 namespace Belle2 {
20  // class SendHeader : public TObject {
21  class SendHeader {
22  public:
23 
25  SendHeader();
26 
28  SendHeader(int*);
30  ~SendHeader();
31 
33  int* GetBuffer(void);
34 
36  void SetBuffer(int* hdr);
37 
38  void Initialize();
39 
40  void SetNwords(int total_data_nwords);
41 
42  void SetNumEventsinPacket(int num_events);
43  void SetNumNodesinPacket(int num_nodes);
44  void SetEventNumber(int eve_num);
45  void SetNodeID(int node_id);
46 
47  void SetExpRunWord(unsigned int exp_run);
48 
49 
50  void SetRunNum(int run_num);
51  void SetSubRunNum(int subrun_num);
52  void SetExpNum(int exp_num);
53 
54  int GetTotalNwords();
55  int GetHdrNwords();
57  int GetNumNodesinPacket();
58  int GetEventNumber();
59  int GetNodeID();
60 
61  int GetRunNum();
62  int GetSubRunNum();
63  int GetExpNum();
64  int GetRunNumSubRunNum();
65 
66  /* Data Format : Node info */
67  enum {
68  SENDHDR_NWORDS = 6
69  };
70 
71  private:
72 
73  /* Data Format : Fixed length part*/
74  enum {
75  POS_NWORDS = 0,
76  POS_HDR_NWORDS = 1,
77  POS_NUM_EVE_NUM_NODES = 2,
78  POS_EXP_RUN_NUM = 3,
79  POS_EVE_NUM = 4,
80  POS_NODE_ID = 5
81  };
82 
83  /* Data Format in EXP_RUN_NUM word: Same as in RawHeader_v2.h */
84  enum {
85  EXP_MASK = 0xFFC00000,
86  EXP_SHIFT = 22,
87  RUNNO_MASK = 0x003FFF00,
88  RUNNO_SHIFT = 8,
89  SUBRUNNO_MASK = 0x000000FF
90  };
91 
92  int m_buffer[ SENDHDR_NWORDS ];
93 
94  // ClassDef(SendHeader, 1);
95  };
96 
97 
98 
99 
101 }
102 
103 #endif
void SetBuffer(int *hdr)
set buffer
Definition: SendHeader.cc:37
~SendHeader()
Destructor.
Definition: SendHeader.cc:28
void SetNumEventsinPacket(int num_events)
set contents of Header
Definition: SendHeader.cc:61
int GetHdrNwords()
get contents of Header
Definition: SendHeader.cc:124
void SetNwords(int total_data_nwords)
initialize Header
Definition: SendHeader.cc:51
int GetNumEventsinPacket()
get contents of Header
Definition: SendHeader.cc:125
int * GetBuffer(void)
Get Header contents.
Definition: SendHeader.cc:32
SendHeader()
Default constructor.
Definition: SendHeader.cc:16
Abstract base class for different kinds of events.