Belle II Software  release-05-01-25
ECLDspData.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Sergei Gribanov, Mikhail Remnev *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 #include <TObject.h>
13 #include <vector>
14 
15 namespace Belle2 {
36  class ECLDspData: public TObject {
37  private:
39  unsigned char m_boardNumber;
41  unsigned char m_verMaj;
43  unsigned char m_verMin;
45  unsigned char m_ka;
47  unsigned char m_kb;
49  unsigned char m_kc;
51  unsigned char m_y0Startr;
57  short int m_chiThresh;
59  unsigned char m_k1Chi;
61  unsigned char m_k2Chi;
63  short int m_hitThresh;
65  short int m_lowAmpThresh;
67  short int m_skipThresh;
69  short int m_adcAlwThresh;
71  std::vector<short int> m_fg31;
73  std::vector<short int> m_fg32;
75  std::vector<short int> m_fg33;
77  std::vector<short int> m_fg41;
79  std::vector<short int> m_fg43;
81  std::vector<short int> m_f;
83  std::vector<short int> m_f1;
94  std::vector<short int> m_extraData;
95 
100  static const short int c_packerVersion = 2;
101 
102  public:
107  explicit ECLDspData(unsigned char board_number = 0) :
108  m_boardNumber(board_number),
109  m_verMaj(0),
110  m_verMin(0),
111  m_ka(0),
112  m_kb(0),
113  m_kc(0),
114  m_y0Startr(0),
116  m_k1Chi(0),
117  m_k2Chi(0),
118  m_hitThresh(0),
119  m_lowAmpThresh(0),
120  m_skipThresh(0),
121  m_adcAlwThresh(0),
122  m_fg31(49152),
123  m_fg32(49152),
124  m_fg33(49152),
125  m_fg41(6144),
126  m_fg43(6144),
127  m_f(49152),
128  m_f1(49152)
129  {}
131  ~ECLDspData() {};
132 
133  /*************/
135  /*************/
136 
138  static short int getPackerVersion() { return c_packerVersion; }
139 
144  std::vector<short int> getExtraData() const { return m_extraData; }
145 
149  void getF(std::vector<short int>& dst) const { unpackCoefVector(m_f, dst); }
153  void getF1(std::vector<short int>& dst) const { unpackCoefVector(m_f1, dst); }
158  void getF31(std::vector<short int>& dst) const { unpackCoefVector(m_fg31, dst); }
165  void getF32(std::vector<short int>& dst) const { unpackCoefVector(m_fg32, dst); }
171  void getF33(std::vector<short int>& dst) const { unpackCoefVector(m_fg33, dst); }
175  void getF41(std::vector<short int>& dst) const { unpackCoefVector(m_fg41, dst); }
179  void getF43(std::vector<short int>& dst) const { unpackCoefVector(m_fg43, dst); }
181  unsigned char getverMaj() const { return m_verMaj; }
183  unsigned char getverMin() const { return m_verMin; }
187  short int getaAT() const { return m_adcAlwThresh; }
191  short int getlAT() const { return m_lowAmpThresh; }
195  short int getsT() const { return m_skipThresh; }
199  short int gethT() const { return m_hitThresh; }
201  short int getchiThresh() const { return m_chiThresh; }
203  unsigned char getk1() const { return m_k1Chi; }
205  unsigned char getk2() const { return m_k2Chi; }
207  unsigned char getka() const { return m_ka; }
209  unsigned char getkb() const { return m_kb; }
211  unsigned char getkc() const { return m_kc; }
213  unsigned char gety0Startr() const { return m_y0Startr; }
214 
216  unsigned char getBoardNumber() const { return m_boardNumber; }
217 
218  /*************/
220  /*************/
221 
226  void setExtraData(const std::vector<short int>& newval) { m_extraData = newval; }
227 
231  void setF(std::vector<short int>& src) { packCoefVector(src, m_f); }
235  void setF1(std::vector<short int>& src) { packCoefVector(src, m_f1); }
240  void setF31(std::vector<short int>& src) { packCoefVector(src, m_fg31); }
247  void setF32(std::vector<short int>& src) { packCoefVector(src, m_fg32); }
253  void setF33(std::vector<short int>& src) { packCoefVector(src, m_fg33); }
257  void setF41(std::vector<short int>& src) { packCoefVector(src, m_fg41); }
261  void setF43(std::vector<short int>& src) { packCoefVector(src, m_fg43); }
262 
264  void setverMaj(unsigned char val) { m_verMaj = val; }
266  void setverMin(unsigned char val) { m_verMin = val; }
270  void setaAT(short int val) { m_adcAlwThresh = val; }
274  void setlAT(short int val) { m_lowAmpThresh = val; }
278  void setsT(short int val) { m_skipThresh = val; }
282  void sethT(short int val) { m_hitThresh = val; }
284  void setchiThresh(short int val) { m_chiThresh = val; }
286  void setk1(unsigned char val) { m_k1Chi = val; }
288  void setk2(unsigned char val) { m_k2Chi = val; }
290  void setka(unsigned char val) { m_ka = val; }
292  void setkb(unsigned char val) { m_kb = val; }
294  void setkc(unsigned char val) { m_kc = val; }
296  void sety0Startr(unsigned char val) { m_y0Startr = val; }
297 
298  private:
307  void packCoefVector(const std::vector<short int>& src, std::vector<short int>& dst);
313  void unpackCoefVector(const std::vector<short int>& src, std::vector<short int>& dst) const;
314 
315  ClassDef(ECLDspData, 1);
316  };
318 }
319 
Belle2::ECLDspData::m_kb
unsigned char m_kb
Number of bits for FG32.
Definition: ECLDspData.h:55
Belle2::ECLDspData::m_f
std::vector< short int > m_f
See documentation for method 'getF'.
Definition: ECLDspData.h:89
Belle2::ECLDspData::getF31
void getF31(std::vector< short int > &dst) const
Array FG31, used to estimate signal amplitude.
Definition: ECLDspData.h:166
Belle2::ECLDspData::setaAT
void setaAT(short int val)
Set Low amp threshold (https://confluence.desy.de/display/BI/Electronics+Thresholds)
Definition: ECLDspData.h:278
Belle2::ECLDspData::getk1
unsigned char getk1() const
multipliers power of 2 for f, f1
Definition: ECLDspData.h:211
Belle2::ECLDspData::m_lowAmpThresh
short int m_lowAmpThresh
See https://confluence.desy.de/display/BI/Electronics+Thresholds.
Definition: ECLDspData.h:73
Belle2::ECLDspData::setExtraData
void setExtraData(const std::vector< short int > &newval)
SETTERS.
Definition: ECLDspData.h:234
Belle2::ECLDspData::setchiThresh
void setchiThresh(short int val)
Set chi2 threshold for fit quality flag.
Definition: ECLDspData.h:292
Belle2::ECLDspData::getaAT
short int getaAT() const
Definition: ECLDspData.h:195
Belle2::ECLDspData::m_verMaj
unsigned char m_verMaj
Major version of DSP coefficients.
Definition: ECLDspData.h:49
Belle2::ECLDspData::getchiThresh
short int getchiThresh() const
chi2 threshold for fit quality flag
Definition: ECLDspData.h:209
Belle2::ECLDspData::m_fg43
std::vector< short int > m_fg43
See documentation for method 'getF43'.
Definition: ECLDspData.h:87
Belle2::ECLDspData::m_extraData
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:102
Belle2::ECLDspData::setF33
void setF33(std::vector< short int > &src)
Array FG33, used to estimate pedestal height in signal.
Definition: ECLDspData.h:261
Belle2::ECLDspData::m_fg41
std::vector< short int > m_fg41
See documentation for method 'getF41'.
Definition: ECLDspData.h:85
Belle2::ECLDspData::getF41
void getF41(std::vector< short int > &dst) const
Alternative for FG31 for signals with small amplitude.
Definition: ECLDspData.h:183
Belle2::ECLDspData::setk2
void setk2(unsigned char val)
Set multipliers power of 2 for chi2 calculation.
Definition: ECLDspData.h:296
Belle2::ECLDspData::getlAT
short int getlAT() const
Definition: ECLDspData.h:199
Belle2::ECLDspData::getverMin
unsigned char getverMin() const
Definition: ECLDspData.h:191
Belle2::ECLDspData::sety0Startr
void sety0Startr(unsigned char val)
Set start point for pedestal calculation.
Definition: ECLDspData.h:304
Belle2::ECLDspData::getkc
unsigned char getkc() const
Number of bits for FG33, FG43.
Definition: ECLDspData.h:219
Belle2::ECLDspData::setF43
void setF43(std::vector< short int > &src)
Alternative for FG33 for signals with small amplitude.
Definition: ECLDspData.h:269
Belle2::ECLDspData::setverMin
void setverMin(unsigned char val)
Sets minor version of DSP coefficients.
Definition: ECLDspData.h:274
Belle2::ECLDspData::setka
void setka(unsigned char val)
Set number of bits for FG31, FG41.
Definition: ECLDspData.h:298
Belle2::ECLDspData::m_verMin
unsigned char m_verMin
Minor version of DSP coefficients.
Definition: ECLDspData.h:51
Belle2::ECLDspData::setkc
void setkc(unsigned char val)
Set number of bits for FG33, FG43.
Definition: ECLDspData.h:302
Belle2::ECLDspData::getBoardNumber
unsigned char getBoardNumber() const
Return ShaperDSP board number, 0..11.
Definition: ECLDspData.h:224
Belle2::ECLDspData::getverMaj
unsigned char getverMaj() const
Definition: ECLDspData.h:189
Belle2::ECLDspData::m_chiThresh
short int m_chiThresh
chi2 threshold for quality bit
Definition: ECLDspData.h:65
Belle2::ECLDspData::setF
void setF(std::vector< short int > &src)
Array with tabulated signal waveform.
Definition: ECLDspData.h:239
Belle2::ECLDspData::c_packerVersion
static const short int c_packerVersion
Version of packer used in packCoefVector by default Versioon of unpacker is dynamically determined fr...
Definition: ECLDspData.h:108
Belle2::ECLDspData::setverMaj
void setverMaj(unsigned char val)
Sets major version of DSP coefficients.
Definition: ECLDspData.h:272
Belle2::ECLDspData
This object contains ECL DSP coefs – electromagnetic calorimeter digital signal processing coefficien...
Definition: ECLDspData.h:44
Belle2::ECLDspData::ClassDef
ClassDef(ECLDspData, 1)
ClassDef.
Belle2::ECLDspData::sethT
void sethT(short int val)
Set Hit threshold (https://confluence.desy.de/display/BI/Electronics+Thresholds)
Definition: ECLDspData.h:290
Belle2::ECLDspData::setk1
void setk1(unsigned char val)
Set multipliers power of 2 for f, f1.
Definition: ECLDspData.h:294
Belle2::ECLDspData::m_adcAlwThresh
short int m_adcAlwThresh
See https://confluence.desy.de/display/BI/Electronics+Thresholds.
Definition: ECLDspData.h:77
Belle2::ECLDspData::gethT
short int gethT() const
Definition: ECLDspData.h:207
Belle2::ECLDspData::getF
void getF(std::vector< short int > &dst) const
Array with tabulated signal waveform.
Definition: ECLDspData.h:157
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ECLDspData::getka
unsigned char getka() const
Number of bits for FG31, FG41.
Definition: ECLDspData.h:215
Belle2::ECLDspData::packCoefVector
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:5
Belle2::ECLDspData::getF33
void getF33(std::vector< short int > &dst) const
Array FG33, used to estimate pedestal height in signal.
Definition: ECLDspData.h:179
Belle2::ECLDspData::getF43
void getF43(std::vector< short int > &dst) const
Alternative for FG33 for signals with small amplitude.
Definition: ECLDspData.h:187
Belle2::ECLDspData::setF31
void setF31(std::vector< short int > &src)
Array FG31, used to estimate signal amplitude.
Definition: ECLDspData.h:248
Belle2::ECLDspData::m_fg31
std::vector< short int > m_fg31
See documentation for method 'getF31'.
Definition: ECLDspData.h:79
Belle2::ECLDspData::getF1
void getF1(std::vector< short int > &dst) const
Array with tabulated derivative of signal waveform.
Definition: ECLDspData.h:161
Belle2::ECLDspData::m_boardNumber
unsigned char m_boardNumber
ShaperDSP board number, 0..11.
Definition: ECLDspData.h:47
Belle2::ECLDspData::setF32
void setF32(std::vector< short int > &src)
Array FG32, used to estimate A * delta_t.
Definition: ECLDspData.h:255
Belle2::ECLDspData::m_skipThresh
short int m_skipThresh
See https://confluence.desy.de/display/BI/Electronics+Thresholds.
Definition: ECLDspData.h:75
Belle2::ECLDspData::setlAT
void setlAT(short int val)
Set Low amp threshold (https://confluence.desy.de/display/BI/Electronics+Thresholds)
Definition: ECLDspData.h:282
Belle2::ECLDspData::gety0Startr
unsigned char gety0Startr() const
start point for pedestal calculation
Definition: ECLDspData.h:221
Belle2::ECLDspData::setkb
void setkb(unsigned char val)
Set number of bits for FG32.
Definition: ECLDspData.h:300
Belle2::ECLDspData::getk2
unsigned char getk2() const
multipliers power of 2 for chi2 calculation
Definition: ECLDspData.h:213
Belle2::ECLDspData::getExtraData
std::vector< short int > getExtraData() const
Definition: ECLDspData.h:152
Belle2::ECLDspData::m_fg32
std::vector< short int > m_fg32
See documentation for method 'getF32'.
Definition: ECLDspData.h:81
Belle2::ECLDspData::setF1
void setF1(std::vector< short int > &src)
Array with tabulated derivative of signal waveform.
Definition: ECLDspData.h:243
Belle2::ECLDspData::m_k2Chi
unsigned char m_k2Chi
multipliers power of 2 for chi2 calculation
Definition: ECLDspData.h:69
Belle2::ECLDspData::m_f1
std::vector< short int > m_f1
See documentation for method 'getF1'.
Definition: ECLDspData.h:91
Belle2::ECLDspData::getPackerVersion
static short int getPackerVersion()
GETTERS.
Definition: ECLDspData.h:146
Belle2::ECLDspData::m_ka
unsigned char m_ka
Number of bits for FG31, FG41.
Definition: ECLDspData.h:53
Belle2::ECLDspData::getsT
short int getsT() const
Definition: ECLDspData.h:203
Belle2::ECLDspData::getF32
void getF32(std::vector< short int > &dst) const
Array FG32, used to estimate A * delta_t.
Definition: ECLDspData.h:173
Belle2::ECLDspData::getkb
unsigned char getkb() const
Number of bits for FG32.
Definition: ECLDspData.h:217
Belle2::ECLDspData::m_kc
unsigned char m_kc
Number of bits for FG33, FG43.
Definition: ECLDspData.h:57
Belle2::ECLDspData::m_k1Chi
unsigned char m_k1Chi
multipliers power of 2 for f, f1
Definition: ECLDspData.h:67
Belle2::ECLDspData::setsT
void setsT(short int val)
Set Skip threshold (https://confluence.desy.de/display/BI/Electronics+Thresholds)
Definition: ECLDspData.h:286
Belle2::ECLDspData::m_fg33
std::vector< short int > m_fg33
See documentation for method 'getF33'.
Definition: ECLDspData.h:83
Belle2::ECLDspData::m_y0Startr
unsigned char m_y0Startr
start point for pedestal calculation
Definition: ECLDspData.h:59
Belle2::ECLDspData::ECLDspData
ECLDspData(unsigned char board_number=0)
Initialize DSP coefficients class from binary file.
Definition: ECLDspData.h:115
Belle2::ECLDspData::unpackCoefVector
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:72
Belle2::ECLDspData::setF41
void setF41(std::vector< short int > &src)
Alternative for FG31 for signals with small amplitude.
Definition: ECLDspData.h:265
Belle2::ECLDspData::m_hitThresh
short int m_hitThresh
See https://confluence.desy.de/display/BI/Electronics+Thresholds.
Definition: ECLDspData.h:71