Belle II Software development
TRGGDLDBUnpacker.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#pragma once
9
10#include <TObject.h>
11
12namespace Belle2 {
28 class TRGGDLDBUnpacker: public TObject {
29 public:
30
32 TRGGDLDBUnpacker(): m_nLeafs(0), m_nLeafsExtra(0), m_nClks(0), m_nBits(0), m_conf(0), m_LeafNames{{0}}, m_LeafMap{0}, m_BitMap{{0}},
33 m_nword_header(0), m_nword_input(0), m_nword_output(0), m_BitMap_extra{{0}} {}
34
36 TRGGDLDBUnpacker(const TRGGDLDBUnpacker& b): TObject(b)
37 {
38 m_nLeafs = b.m_nLeafs;
39 m_nLeafsExtra = b.m_nLeafsExtra;
40 m_nClks = b.m_nClks;
41 for (int i = 0; i < 320; i++) {
42 strcpy(m_LeafNames[i], b.m_LeafNames[i]);
43 m_LeafMap[i] = b.m_LeafMap[i];
44 }
45 for (int i = 0; i < 320; i++) {
46 for (int j = 0; j < 2; j++) {
47 m_BitMap[i][j] = b.m_BitMap[i][j];
48 }
49 }
50 for (int i = 0; i < 320; i++) {
51 for (int j = 0; j < 3; j++) {
52 m_BitMap_extra[i][j] = b.m_BitMap_extra[i][j];
53 }
54 }
55 m_nword_header = b.m_nword_header;
56 m_nword_input = b.m_nword_input;
57 m_nword_output = b.m_nword_output;
58 }
61 {
62 m_nLeafs = b.m_nLeafs;
63 m_nLeafsExtra = b.m_nLeafsExtra;
64 m_nClks = b.m_nClks;
65 m_nBits = b.m_nBits;
66 m_conf = b.m_conf;
67 for (int i = 0; i < 320; i++) {
68 strcpy(m_LeafNames[i], b.m_LeafNames[i]);
69 m_LeafMap[i] = b.m_LeafMap[i];
70 }
71 for (int i = 0; i < 320; i++) {
72 for (int j = 0; j < 2; j++) {
73 m_BitMap[i][j] = b.m_BitMap[i][j];
74 }
75 }
76 for (int i = 0; i < 320; i++) {
77 for (int j = 0; j < 3; j++) {
78 m_BitMap_extra[i][j] = b.m_BitMap_extra[i][j];
79 }
80 }
81 m_nword_header = b.m_nword_header;
82 m_nword_input = b.m_nword_input;
83 m_nword_output = b.m_nword_output;
84 return *this;
85 }
86
87 void setnLeafs(int i)
88 {
89 m_nLeafs = i;
90 }
91 void setnLeafsExtra(int i)
92 {
93 m_nLeafsExtra = i;
94 }
95 void setnClks(int i)
96 {
97 m_nClks = i;
98 }
99 void setnBits(int i)
100 {
101 m_nBits = i;
102 }
103 void setconf(int i)
104 {
105 m_conf = i;
106 }
107 void setLeafName(int i, const char* c)
108 {
109 strcpy(m_LeafNames[i], c);
110 }
111 void setLeafMap(int i, int j)
112 {
113 m_LeafMap[i] = j;
114 }
115 void setBitMap(int i, int j, int k)
116 {
117 m_BitMap[i][j] = k;
118 }
119 void set_nword_header(int i)
120 {
121 m_nword_header = i;
122 }
123 void set_nword_input(int i)
124 {
125 m_nword_input = i;
126 }
127 void set_nword_output(int i)
128 {
129 m_nword_output = i;
130 }
131 void setBitMap_extra(int i, int j, int k)
132 {
133 m_BitMap_extra[i][j] = k;
134 }
135
136 int getnLeafs() const
137 {
138 return m_nLeafs;
139 }
140 int getnLeafsExtra() const
141 {
142 return m_nLeafsExtra;
143 }
144 int getnClks() const
145 {
146 return m_nClks;
147 }
148 int getnBits() const
149 {
150 return m_nBits;
151 }
152 int getconf() const
153 {
154 return m_conf;
155 }
156 const char* getLeafnames(int i) const
157 {
158 return m_LeafNames[i];
159 }
160 int getLeafMap(int i) const
161 {
162 return m_LeafMap[i];
163 }
164 int getBitMap(int i, int j) const
165 {
166 return m_BitMap[i][j];
167 }
168 int get_nword_header() const
169 {
170 return m_nword_header;
171 }
172 int get_nword_input() const
173 {
174 return m_nword_input;
175 }
176 int get_nword_output() const
177 {
178 return m_nword_output;
179 }
180 int getBitMap_extra(int i, int j) const
181 {
182 return m_BitMap_extra[i][j];
183 }
184
185
186
187 private:
188
191
194
197
199 int m_nBits = 0;
200
202 int m_conf = 0;
203
205 char m_LeafNames[320][100];
206
208 int m_LeafMap[320];
209
211 int m_BitMap[320][2];
212
215
218
221
223 int m_BitMap_extra[320][3];
224
225
227 };
228
230} // end of namespace Belle2
The payload class for PXD cluster charge calibrations.
TRGGDLDBUnpacker & operator=(const TRGGDLDBUnpacker &b)
assignment operator
int m_nLeafs
num of leafs in data_b2l
int m_nLeafsExtra
num of leafs for others
TRGGDLDBUnpacker(const TRGGDLDBUnpacker &b)
copy constructor
int m_nword_input
DAM input word size.
int m_nword_output
DAM output word size.
TRGGDLDBUnpacker()
Default constructor.
ClassDef(TRGGDLDBUnpacker, 1)
ClassDef, must be the last term before the closing {}.
char m_LeafNames[320][100]
leaf names
int m_nClks
num of clk time window
Abstract base class for different kinds of events.