Belle II Software development
ECLDspData.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#pragma once
10#include <TObject.h>
11#include <vector>
12
13namespace Belle2 {
33 class ECLDspData: public TObject {
34 private:
36 unsigned char m_boardNumber;
38 unsigned char m_verMaj;
40 unsigned char m_verMin;
42 unsigned char m_ka;
44 unsigned char m_kb;
46 unsigned char m_kc;
48 unsigned char m_y0Startr;
54 short int m_chiThresh;
56 unsigned char m_k1Chi;
58 unsigned char m_k2Chi;
60 short int m_hitThresh;
62 short int m_lowAmpThresh;
64 short int m_skipThresh;
66 short int m_adcAlwThresh;
68 std::vector<short int> m_fg31 = {};
70 std::vector<short int> m_fg32 = {};
72 std::vector<short int> m_fg33 = {};
74 std::vector<short int> m_fg41 = {};
76 std::vector<short int> m_fg43 = {};
78 std::vector<short int> m_f = {};
80 std::vector<short int> m_f1 = {};
91 std::vector<short int> m_extraData;
92
97 static const short int c_packerVersion = 2;
98
99 public:
104 explicit ECLDspData(unsigned char board_number = 0) :
105 m_boardNumber(board_number),
106 m_verMaj(0),
107 m_verMin(0),
108 m_ka(0),
109 m_kb(0),
110 m_kc(0),
111 m_y0Startr(0),
112 m_chiThresh(0),
113 m_k1Chi(0),
114 m_k2Chi(0),
115 m_hitThresh(0),
117 m_skipThresh(0),
119 {}
121 ~ECLDspData() {};
122
123 /*************/
125 /*************/
126
128 static constexpr short int getPackerVersion() { return c_packerVersion; }
129
134 std::vector<short int> getExtraData() const { return m_extraData; }
135
139 void getF(std::vector<short int>& dst) const { unpackCoefVector(m_f, dst); }
143 void getF1(std::vector<short int>& dst) const { unpackCoefVector(m_f1, dst); }
148 void getF31(std::vector<short int>& dst) const { unpackCoefVector(m_fg31, dst); }
155 void getF32(std::vector<short int>& dst) const { unpackCoefVector(m_fg32, dst); }
161 void getF33(std::vector<short int>& dst) const { unpackCoefVector(m_fg33, dst); }
165 void getF41(std::vector<short int>& dst) const { unpackCoefVector(m_fg41, dst); }
169 void getF43(std::vector<short int>& dst) const { unpackCoefVector(m_fg43, dst); }
171 unsigned char getverMaj() const { return m_verMaj; }
173 unsigned char getverMin() const { return m_verMin; }
177 short int getaAT() const { return m_adcAlwThresh; }
181 short int getlAT() const { return m_lowAmpThresh; }
185 short int getsT() const { return m_skipThresh; }
189 short int gethT() const { return m_hitThresh; }
191 short int getchiThresh() const { return m_chiThresh; }
193 unsigned char getk1() const { return m_k1Chi; }
195 unsigned char getk2() const { return m_k2Chi; }
197 unsigned char getka() const { return m_ka; }
199 unsigned char getkb() const { return m_kb; }
201 unsigned char getkc() const { return m_kc; }
203 unsigned char gety0Startr() const { return m_y0Startr; }
204
206 unsigned char getBoardNumber() const { return m_boardNumber; }
207
208 /*************/
210 /*************/
211
216 void setExtraData(const std::vector<short int>& newval) { m_extraData = newval; }
217
221 void setF(const std::vector<short int>& src) { packCoefVector(src, m_f); }
225 void setF1(const std::vector<short int>& src) { packCoefVector(src, m_f1); }
230 void setF31(const std::vector<short int>& src) { packCoefVector(src, m_fg31); }
237 void setF32(const std::vector<short int>& src) { packCoefVector(src, m_fg32); }
243 void setF33(const std::vector<short int>& src) { packCoefVector(src, m_fg33); }
247 void setF41(const std::vector<short int>& src) { packCoefVector(src, m_fg41); }
251 void setF43(const std::vector<short int>& src) { packCoefVector(src, m_fg43); }
252
254 void setverMaj(unsigned char val) { m_verMaj = val; }
256 void setverMin(unsigned char val) { m_verMin = val; }
260 void setaAT(short int val) { m_adcAlwThresh = val; }
264 void setlAT(short int val) { m_lowAmpThresh = val; }
268 void setsT(short int val) { m_skipThresh = val; }
272 void sethT(short int val) { m_hitThresh = val; }
274 void setchiThresh(short int val) { m_chiThresh = val; }
276 void setk1(unsigned char val) { m_k1Chi = val; }
278 void setk2(unsigned char val) { m_k2Chi = val; }
280 void setka(unsigned char val) { m_ka = val; }
282 void setkb(unsigned char val) { m_kb = val; }
284 void setkc(unsigned char val) { m_kc = val; }
286 void sety0Startr(unsigned char val) { m_y0Startr = val; }
287
288 private:
297 void packCoefVector(const std::vector<short int>& src, std::vector<short int>& dst);
303 void unpackCoefVector(const std::vector<short int>& src, std::vector<short int>& dst) const;
304
306 };
308}
309
This object contains ECL DSP coefs – electromagnetic calorimeter digital signal processing coefficien...
Definition: ECLDspData.h:33
unsigned char m_k2Chi
multipliers power of 2 for chi2 calculation
Definition: ECLDspData.h:58
void sethT(short int val)
Set Hit threshold (https://xwiki.desy.de/xwiki/rest/p/545bc)
Definition: ECLDspData.h:272
unsigned char getkb() const
Number of bits for FG32.
Definition: ECLDspData.h:199
short int getchiThresh() const
chi2 threshold for fit quality flag
Definition: ECLDspData.h:191
void setkc(unsigned char val)
Set number of bits for FG33, FG43.
Definition: ECLDspData.h:284
void getF43(std::vector< short int > &dst) const
Alternative for FG33 for signals with small amplitude.
Definition: ECLDspData.h:169
std::vector< short int > getExtraData() const
Definition: ECLDspData.h:134
void setchiThresh(short int val)
Set chi2 threshold for fit quality flag.
Definition: ECLDspData.h:274
void setka(unsigned char val)
Set number of bits for FG31, FG41.
Definition: ECLDspData.h:280
short int m_lowAmpThresh
See https://xwiki.desy.de/xwiki/rest/p/545bc.
Definition: ECLDspData.h:62
void setk1(unsigned char val)
Set multipliers power of 2 for f, f1.
Definition: ECLDspData.h:276
std::vector< short int > m_f1
See documentation for method 'getF1'.
Definition: ECLDspData.h:80
short int m_chiThresh
chi2 threshold for quality bit
Definition: ECLDspData.h:54
std::vector< short int > m_fg33
See documentation for method 'getF33'.
Definition: ECLDspData.h:72
void setverMin(unsigned char val)
Sets minor version of DSP coefficients.
Definition: ECLDspData.h:256
void setlAT(short int val)
Set Low amp threshold (https://xwiki.desy.de/xwiki/rest/p/545bc)
Definition: ECLDspData.h:264
std::vector< short int > m_fg41
See documentation for method 'getF41'.
Definition: ECLDspData.h:74
void setF(const std::vector< short int > &src)
Array with tabulated signal waveform.
Definition: ECLDspData.h:221
void setkb(unsigned char val)
Set number of bits for FG32.
Definition: ECLDspData.h:282
void setverMaj(unsigned char val)
Sets major version of DSP coefficients.
Definition: ECLDspData.h:254
short int getlAT() const
Definition: ECLDspData.h:181
unsigned char m_y0Startr
start point for pedestal calculation
Definition: ECLDspData.h:48
unsigned char getverMin() const
Definition: ECLDspData.h:173
short int m_skipThresh
See https://xwiki.desy.de/xwiki/rest/p/545bc.
Definition: ECLDspData.h:64
short int m_hitThresh
See https://xwiki.desy.de/xwiki/rest/p/545bc.
Definition: ECLDspData.h:60
short int getaAT() const
Definition: ECLDspData.h:177
unsigned char getverMaj() const
Definition: ECLDspData.h:171
void setF41(const std::vector< short int > &src)
Alternative for FG31 for signals with small amplitude.
Definition: ECLDspData.h:247
void sety0Startr(unsigned char val)
Set start point for pedestal calculation.
Definition: ECLDspData.h:286
ECLDspData(unsigned char board_number=0)
Initialize DSP coefficients class from binary file.
Definition: ECLDspData.h:104
unsigned char gety0Startr() const
start point for pedestal calculation
Definition: ECLDspData.h:203
void setF31(const std::vector< short int > &src)
Array FG31, used to estimate signal amplitude.
Definition: ECLDspData.h:230
void getF(std::vector< short int > &dst) const
Array with tabulated signal waveform.
Definition: ECLDspData.h:139
unsigned char m_boardNumber
ShaperDSP board number, 0..11.
Definition: ECLDspData.h:36
unsigned char m_verMin
Minor version of DSP coefficients.
Definition: ECLDspData.h:40
void setF1(const std::vector< short int > &src)
Array with tabulated derivative of signal waveform.
Definition: ECLDspData.h:225
short int m_adcAlwThresh
See https://xwiki.desy.de/xwiki/rest/p/545bc.
Definition: ECLDspData.h:66
std::vector< short int > m_extraData
This vector contains all parameters that didn't exist in the initial version of ECL DSP file format.
Definition: ECLDspData.h:91
void setF33(const std::vector< short int > &src)
Array FG33, used to estimate pedestal height in signal.
Definition: ECLDspData.h:243
void setF43(const std::vector< short int > &src)
Alternative for FG33 for signals with small amplitude.
Definition: ECLDspData.h:251
void setaAT(short int val)
Set Low amp threshold (https://xwiki.desy.de/xwiki/rest/p/545bc)
Definition: ECLDspData.h:260
void getF31(std::vector< short int > &dst) const
Array FG31, used to estimate signal amplitude.
Definition: ECLDspData.h:148
void packCoefVector(const std::vector< short int > &src, std::vector< short int > &dst)
Convert vector of DSP coefficients (src) to ECLDspData internal format (dst).
Definition: ECLDspData.cc:12
ClassDef(ECLDspData, 1)
ClassDef.
unsigned char getk2() const
multipliers power of 2 for chi2 calculation
Definition: ECLDspData.h:195
void setsT(short int val)
Set Skip threshold (https://xwiki.desy.de/xwiki/rest/p/545bc)
Definition: ECLDspData.h:268
unsigned char m_ka
Number of bits for FG31, FG41.
Definition: ECLDspData.h:42
void setF32(const std::vector< short int > &src)
Array FG32, used to estimate A * delta_t.
Definition: ECLDspData.h:237
unsigned char m_verMaj
Major version of DSP coefficients.
Definition: ECLDspData.h:38
short int getsT() const
Definition: ECLDspData.h:185
static constexpr short int getPackerVersion()
GETTERS.
Definition: ECLDspData.h:128
unsigned char getBoardNumber() const
Return ShaperDSP board number, 0..11.
Definition: ECLDspData.h:206
unsigned char m_kb
Number of bits for FG32.
Definition: ECLDspData.h:44
void setk2(unsigned char val)
Set multipliers power of 2 for chi2 calculation.
Definition: ECLDspData.h:278
void getF33(std::vector< short int > &dst) const
Array FG33, used to estimate pedestal height in signal.
Definition: ECLDspData.h:161
short int gethT() const
Definition: ECLDspData.h:189
std::vector< short int > m_fg43
See documentation for method 'getF43'.
Definition: ECLDspData.h:76
std::vector< short int > m_f
See documentation for method 'getF'.
Definition: ECLDspData.h:78
std::vector< short int > m_fg32
See documentation for method 'getF32'.
Definition: ECLDspData.h:70
unsigned char getka() const
Number of bits for FG31, FG41.
Definition: ECLDspData.h:197
std::vector< short int > m_fg31
See documentation for method 'getF31'.
Definition: ECLDspData.h:68
void setExtraData(const std::vector< short int > &newval)
SETTERS.
Definition: ECLDspData.h:216
unsigned char getk1() const
multipliers power of 2 for f, f1
Definition: ECLDspData.h:193
unsigned char m_k1Chi
multipliers power of 2 for f, f1
Definition: ECLDspData.h:56
void getF32(std::vector< short int > &dst) const
Array FG32, used to estimate A * delta_t.
Definition: ECLDspData.h:155
static const short int c_packerVersion
Version of packer used in packCoefVector by default Version of unpacker is dynamically determined fro...
Definition: ECLDspData.h:97
void getF41(std::vector< short int > &dst) const
Alternative for FG31 for signals with small amplitude.
Definition: ECLDspData.h:165
unsigned char m_kc
Number of bits for FG33, FG43.
Definition: ECLDspData.h:46
void unpackCoefVector(const std::vector< short int > &src, std::vector< short int > &dst) const
Convert vector of DSP coefficients (src) to ECLDspData internal format (dst).
Definition: ECLDspData.cc:79
void getF1(std::vector< short int > &dst) const
Array with tabulated derivative of signal waveform.
Definition: ECLDspData.h:143
unsigned char getkc() const
Number of bits for FG33, FG43.
Definition: ECLDspData.h:201
Abstract base class for different kinds of events.