Belle II Software  release-08-01-10
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 
13 namespace Belle2 {
34  class ECLDspData: public TObject {
35  private:
37  unsigned char m_boardNumber;
39  unsigned char m_verMaj;
41  unsigned char m_verMin;
43  unsigned char m_ka;
45  unsigned char m_kb;
47  unsigned char m_kc;
49  unsigned char m_y0Startr;
55  short int m_chiThresh;
57  unsigned char m_k1Chi;
59  unsigned char m_k2Chi;
61  short int m_hitThresh;
63  short int m_lowAmpThresh;
65  short int m_skipThresh;
67  short int m_adcAlwThresh;
69  std::vector<short int> m_fg31 = {};
71  std::vector<short int> m_fg32 = {};
73  std::vector<short int> m_fg33 = {};
75  std::vector<short int> m_fg41 = {};
77  std::vector<short int> m_fg43 = {};
79  std::vector<short int> m_f = {};
81  std::vector<short int> m_f1 = {};
92  std::vector<short int> m_extraData;
93 
98  static const short int c_packerVersion = 2;
99 
100  public:
105  explicit ECLDspData(unsigned char board_number = 0) :
106  m_boardNumber(board_number),
107  m_verMaj(0),
108  m_verMin(0),
109  m_ka(0),
110  m_kb(0),
111  m_kc(0),
112  m_y0Startr(0),
113  m_chiThresh(0),
114  m_k1Chi(0),
115  m_k2Chi(0),
116  m_hitThresh(0),
117  m_lowAmpThresh(0),
118  m_skipThresh(0),
119  m_adcAlwThresh(0)
120  {}
122  ~ECLDspData() {};
123 
124  /*************/
126  /*************/
127 
129  static constexpr short int getPackerVersion() { return c_packerVersion; }
130 
135  std::vector<short int> getExtraData() const { return m_extraData; }
136 
140  void getF(std::vector<short int>& dst) const { unpackCoefVector(m_f, dst); }
144  void getF1(std::vector<short int>& dst) const { unpackCoefVector(m_f1, dst); }
149  void getF31(std::vector<short int>& dst) const { unpackCoefVector(m_fg31, dst); }
156  void getF32(std::vector<short int>& dst) const { unpackCoefVector(m_fg32, dst); }
162  void getF33(std::vector<short int>& dst) const { unpackCoefVector(m_fg33, dst); }
166  void getF41(std::vector<short int>& dst) const { unpackCoefVector(m_fg41, dst); }
170  void getF43(std::vector<short int>& dst) const { unpackCoefVector(m_fg43, dst); }
172  unsigned char getverMaj() const { return m_verMaj; }
174  unsigned char getverMin() const { return m_verMin; }
178  short int getaAT() const { return m_adcAlwThresh; }
182  short int getlAT() const { return m_lowAmpThresh; }
186  short int getsT() const { return m_skipThresh; }
190  short int gethT() const { return m_hitThresh; }
192  short int getchiThresh() const { return m_chiThresh; }
194  unsigned char getk1() const { return m_k1Chi; }
196  unsigned char getk2() const { return m_k2Chi; }
198  unsigned char getka() const { return m_ka; }
200  unsigned char getkb() const { return m_kb; }
202  unsigned char getkc() const { return m_kc; }
204  unsigned char gety0Startr() const { return m_y0Startr; }
205 
207  unsigned char getBoardNumber() const { return m_boardNumber; }
208 
209  /*************/
211  /*************/
212 
217  void setExtraData(const std::vector<short int>& newval) { m_extraData = newval; }
218 
222  void setF(const std::vector<short int>& src) { packCoefVector(src, m_f); }
226  void setF1(const std::vector<short int>& src) { packCoefVector(src, m_f1); }
231  void setF31(const std::vector<short int>& src) { packCoefVector(src, m_fg31); }
238  void setF32(const std::vector<short int>& src) { packCoefVector(src, m_fg32); }
244  void setF33(const std::vector<short int>& src) { packCoefVector(src, m_fg33); }
248  void setF41(const std::vector<short int>& src) { packCoefVector(src, m_fg41); }
252  void setF43(const std::vector<short int>& src) { packCoefVector(src, m_fg43); }
253 
255  void setverMaj(unsigned char val) { m_verMaj = val; }
257  void setverMin(unsigned char val) { m_verMin = val; }
261  void setaAT(short int val) { m_adcAlwThresh = val; }
265  void setlAT(short int val) { m_lowAmpThresh = val; }
269  void setsT(short int val) { m_skipThresh = val; }
273  void sethT(short int val) { m_hitThresh = val; }
275  void setchiThresh(short int val) { m_chiThresh = val; }
277  void setk1(unsigned char val) { m_k1Chi = val; }
279  void setk2(unsigned char val) { m_k2Chi = val; }
281  void setka(unsigned char val) { m_ka = val; }
283  void setkb(unsigned char val) { m_kb = val; }
285  void setkc(unsigned char val) { m_kc = val; }
287  void sety0Startr(unsigned char val) { m_y0Startr = val; }
288 
289  private:
298  void packCoefVector(const std::vector<short int>& src, std::vector<short int>& dst);
304  void unpackCoefVector(const std::vector<short int>& src, std::vector<short int>& dst) const;
305 
307  };
309 }
310 
This object contains ECL DSP coefs – electromagnetic calorimeter digital signal processing coefficien...
Definition: ECLDspData.h:34
unsigned char m_k2Chi
multipliers power of 2 for chi2 calculation
Definition: ECLDspData.h:59
void sethT(short int val)
Set Hit threshold (https://confluence.desy.de/display/BI/Electronics+Thresholds)
Definition: ECLDspData.h:273
unsigned char getkb() const
Number of bits for FG32.
Definition: ECLDspData.h:200
short int getchiThresh() const
chi2 threshold for fit quality flag
Definition: ECLDspData.h:192
void setkc(unsigned char val)
Set number of bits for FG33, FG43.
Definition: ECLDspData.h:285
void getF43(std::vector< short int > &dst) const
Alternative for FG33 for signals with small amplitude.
Definition: ECLDspData.h:170
void setchiThresh(short int val)
Set chi2 threshold for fit quality flag.
Definition: ECLDspData.h:275
void setka(unsigned char val)
Set number of bits for FG31, FG41.
Definition: ECLDspData.h:281
short int m_lowAmpThresh
See https://confluence.desy.de/display/BI/Electronics+Thresholds.
Definition: ECLDspData.h:63
void setk1(unsigned char val)
Set multipliers power of 2 for f, f1.
Definition: ECLDspData.h:277
std::vector< short int > m_f1
See documentation for method 'getF1'.
Definition: ECLDspData.h:81
short int m_chiThresh
chi2 threshold for quality bit
Definition: ECLDspData.h:55
std::vector< short int > m_fg33
See documentation for method 'getF33'.
Definition: ECLDspData.h:73
void setverMin(unsigned char val)
Sets minor version of DSP coefficients.
Definition: ECLDspData.h:257
void setlAT(short int val)
Set Low amp threshold (https://confluence.desy.de/display/BI/Electronics+Thresholds)
Definition: ECLDspData.h:265
std::vector< short int > m_fg41
See documentation for method 'getF41'.
Definition: ECLDspData.h:75
void setF(const std::vector< short int > &src)
Array with tabulated signal waveform.
Definition: ECLDspData.h:222
void setkb(unsigned char val)
Set number of bits for FG32.
Definition: ECLDspData.h:283
void setverMaj(unsigned char val)
Sets major version of DSP coefficients.
Definition: ECLDspData.h:255
short int getlAT() const
Definition: ECLDspData.h:182
unsigned char m_y0Startr
start point for pedestal calculation
Definition: ECLDspData.h:49
unsigned char getverMin() const
Definition: ECLDspData.h:174
short int m_skipThresh
See https://confluence.desy.de/display/BI/Electronics+Thresholds.
Definition: ECLDspData.h:65
short int m_hitThresh
See https://confluence.desy.de/display/BI/Electronics+Thresholds.
Definition: ECLDspData.h:61
short int getaAT() const
Definition: ECLDspData.h:178
unsigned char getverMaj() const
Definition: ECLDspData.h:172
void setF41(const std::vector< short int > &src)
Alternative for FG31 for signals with small amplitude.
Definition: ECLDspData.h:248
void sety0Startr(unsigned char val)
Set start point for pedestal calculation.
Definition: ECLDspData.h:287
ECLDspData(unsigned char board_number=0)
Initialize DSP coefficients class from binary file.
Definition: ECLDspData.h:105
unsigned char gety0Startr() const
start point for pedestal calculation
Definition: ECLDspData.h:204
void setF31(const std::vector< short int > &src)
Array FG31, used to estimate signal amplitude.
Definition: ECLDspData.h:231
void getF(std::vector< short int > &dst) const
Array with tabulated signal waveform.
Definition: ECLDspData.h:140
unsigned char m_boardNumber
ShaperDSP board number, 0..11.
Definition: ECLDspData.h:37
unsigned char m_verMin
Minor version of DSP coefficients.
Definition: ECLDspData.h:41
void setF1(const std::vector< short int > &src)
Array with tabulated derivative of signal waveform.
Definition: ECLDspData.h:226
short int m_adcAlwThresh
See https://confluence.desy.de/display/BI/Electronics+Thresholds.
Definition: ECLDspData.h:67
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:92
void setF33(const std::vector< short int > &src)
Array FG33, used to estimate pedestal height in signal.
Definition: ECLDspData.h:244
void setF43(const std::vector< short int > &src)
Alternative for FG33 for signals with small amplitude.
Definition: ECLDspData.h:252
void setaAT(short int val)
Set Low amp threshold (https://confluence.desy.de/display/BI/Electronics+Thresholds)
Definition: ECLDspData.h:261
void getF31(std::vector< short int > &dst) const
Array FG31, used to estimate signal amplitude.
Definition: ECLDspData.h:149
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:196
void setsT(short int val)
Set Skip threshold (https://confluence.desy.de/display/BI/Electronics+Thresholds)
Definition: ECLDspData.h:269
unsigned char m_ka
Number of bits for FG31, FG41.
Definition: ECLDspData.h:43
void setF32(const std::vector< short int > &src)
Array FG32, used to estimate A * delta_t.
Definition: ECLDspData.h:238
unsigned char m_verMaj
Major version of DSP coefficients.
Definition: ECLDspData.h:39
short int getsT() const
Definition: ECLDspData.h:186
static constexpr short int getPackerVersion()
GETTERS.
Definition: ECLDspData.h:129
unsigned char getBoardNumber() const
Return ShaperDSP board number, 0..11.
Definition: ECLDspData.h:207
unsigned char m_kb
Number of bits for FG32.
Definition: ECLDspData.h:45
void setk2(unsigned char val)
Set multipliers power of 2 for chi2 calculation.
Definition: ECLDspData.h:279
void getF33(std::vector< short int > &dst) const
Array FG33, used to estimate pedestal height in signal.
Definition: ECLDspData.h:162
short int gethT() const
Definition: ECLDspData.h:190
std::vector< short int > m_fg43
See documentation for method 'getF43'.
Definition: ECLDspData.h:77
std::vector< short int > m_f
See documentation for method 'getF'.
Definition: ECLDspData.h:79
std::vector< short int > m_fg32
See documentation for method 'getF32'.
Definition: ECLDspData.h:71
unsigned char getka() const
Number of bits for FG31, FG41.
Definition: ECLDspData.h:198
std::vector< short int > m_fg31
See documentation for method 'getF31'.
Definition: ECLDspData.h:69
std::vector< short int > getExtraData() const
Definition: ECLDspData.h:135
void setExtraData(const std::vector< short int > &newval)
SETTERS.
Definition: ECLDspData.h:217
unsigned char getk1() const
multipliers power of 2 for f, f1
Definition: ECLDspData.h:194
unsigned char m_k1Chi
multipliers power of 2 for f, f1
Definition: ECLDspData.h:57
void getF32(std::vector< short int > &dst) const
Array FG32, used to estimate A * delta_t.
Definition: ECLDspData.h:156
static const short int c_packerVersion
Version of packer used in packCoefVector by default Versioon of unpacker is dynamically determined fr...
Definition: ECLDspData.h:98
void getF41(std::vector< short int > &dst) const
Alternative for FG31 for signals with small amplitude.
Definition: ECLDspData.h:166
unsigned char m_kc
Number of bits for FG33, FG43.
Definition: ECLDspData.h:47
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:144
unsigned char getkc() const
Number of bits for FG33, FG43.
Definition: ECLDspData.h:202
Abstract base class for different kinds of events.