Belle II Software  release-08-01-10
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  /* Data Format : Fixed length part*/
72  enum {
73  POS_NWORDS = 0,
74  POS_HDR_NWORDS = 1,
75  POS_NUM_EVE_NUM_NODES = 2,
76  POS_EXP_RUN_NUM = 3,
77  POS_EVE_NUM = 4,
78  POS_NODE_ID = 5
79  };
80 
81  /* Data Format in EXP_RUN_NUM word: Same as in RawHeader_v2.h */
82  enum {
83  EXP_MASK = 0xFFC00000,
84  EXP_SHIFT = 22,
85  RUNNO_MASK = 0x003FFF00,
86  RUNNO_SHIFT = 8,
87  SUBRUNNO_MASK = 0x000000FF
88  };
89 
90  private:
91  int m_buffer[ SENDHDR_NWORDS ];
92 
93  // ClassDef(SendHeader, 1);
94  };
95 
96 
97 
98 
100 }
101 
102 #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.