Belle II Software  release-05-02-19
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  {}
124  ~ECLDspData() {};
125 
126  /*************/
128  /*************/
129 
131  static short int getPackerVersion() { return c_packerVersion; }
132 
137  std::vector<short int> getExtraData() const { return m_extraData; }
138 
142  void getF(std::vector<short int>& dst) const { unpackCoefVector(m_f, dst); }
146  void getF1(std::vector<short int>& dst) const { unpackCoefVector(m_f1, dst); }
151  void getF31(std::vector<short int>& dst) const { unpackCoefVector(m_fg31, dst); }
158  void getF32(std::vector<short int>& dst) const { unpackCoefVector(m_fg32, dst); }
164  void getF33(std::vector<short int>& dst) const { unpackCoefVector(m_fg33, dst); }
168  void getF41(std::vector<short int>& dst) const { unpackCoefVector(m_fg41, dst); }
172  void getF43(std::vector<short int>& dst) const { unpackCoefVector(m_fg43, dst); }
174  unsigned char getverMaj() const { return m_verMaj; }
176  unsigned char getverMin() const { return m_verMin; }
180  short int getaAT() const { return m_adcAlwThresh; }
184  short int getlAT() const { return m_lowAmpThresh; }
188  short int getsT() const { return m_skipThresh; }
192  short int gethT() const { return m_hitThresh; }
194  short int getchiThresh() const { return m_chiThresh; }
196  unsigned char getk1() const { return m_k1Chi; }
198  unsigned char getk2() const { return m_k2Chi; }
200  unsigned char getka() const { return m_ka; }
202  unsigned char getkb() const { return m_kb; }
204  unsigned char getkc() const { return m_kc; }
206  unsigned char gety0Startr() const { return m_y0Startr; }
207 
209  unsigned char getBoardNumber() const { return m_boardNumber; }
210 
211  /*************/
213  /*************/
214 
219  void setExtraData(const std::vector<short int>& newval) { m_extraData = newval; }
220 
224  void setF(const std::vector<short int>& src) { packCoefVector(src, m_f); }
228  void setF1(const std::vector<short int>& src) { packCoefVector(src, m_f1); }
233  void setF31(const std::vector<short int>& src) { packCoefVector(src, m_fg31); }
240  void setF32(const std::vector<short int>& src) { packCoefVector(src, m_fg32); }
246  void setF33(const std::vector<short int>& src) { packCoefVector(src, m_fg33); }
250  void setF41(const std::vector<short int>& src) { packCoefVector(src, m_fg41); }
254  void setF43(const std::vector<short int>& src) { packCoefVector(src, m_fg43); }
255 
257  void setverMaj(unsigned char val) { m_verMaj = val; }
259  void setverMin(unsigned char val) { m_verMin = val; }
263  void setaAT(short int val) { m_adcAlwThresh = val; }
267  void setlAT(short int val) { m_lowAmpThresh = val; }
271  void setsT(short int val) { m_skipThresh = val; }
275  void sethT(short int val) { m_hitThresh = val; }
277  void setchiThresh(short int val) { m_chiThresh = val; }
279  void setk1(unsigned char val) { m_k1Chi = val; }
281  void setk2(unsigned char val) { m_k2Chi = val; }
283  void setka(unsigned char val) { m_ka = val; }
285  void setkb(unsigned char val) { m_kb = val; }
287  void setkc(unsigned char val) { m_kc = val; }
289  void sety0Startr(unsigned char val) { m_y0Startr = val; }
290 
291  private:
300  void packCoefVector(const std::vector<short int>& src, std::vector<short int>& dst);
306  void unpackCoefVector(const std::vector<short int>& src, std::vector<short int>& dst) const;
307 
308  ClassDef(ECLDspData, 1);
309  };
311 }
312 
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::setF32
void setF32(const std::vector< short int > &src)
Array FG32, used to estimate A * delta_t.
Definition: ECLDspData.h:248
Belle2::ECLDspData::getF31
void getF31(std::vector< short int > &dst) const
Array FG31, used to estimate signal amplitude.
Definition: ECLDspData.h:159
Belle2::ECLDspData::setaAT
void setaAT(short int val)
Set Low amp threshold (https://confluence.desy.de/display/BI/Electronics+Thresholds)
Definition: ECLDspData.h:271
Belle2::ECLDspData::getk1
unsigned char getk1() const
multipliers power of 2 for f, f1
Definition: ECLDspData.h:204
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:227
Belle2::ECLDspData::setchiThresh
void setchiThresh(short int val)
Set chi2 threshold for fit quality flag.
Definition: ECLDspData.h:285
Belle2::ECLDspData::getaAT
short int getaAT() const
Definition: ECLDspData.h:188
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:202
Belle2::ECLDspData::m_fg43
std::vector< short int > m_fg43
See documentation for method 'getF43'.
Definition: ECLDspData.h:87
Belle2::ECLDspData::setF1
void setF1(const std::vector< short int > &src)
Array with tabulated derivative of signal waveform.
Definition: ECLDspData.h:236
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::setF
void setF(const std::vector< short int > &src)
Array with tabulated signal waveform.
Definition: ECLDspData.h:232
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:176
Belle2::ECLDspData::setk2
void setk2(unsigned char val)
Set multipliers power of 2 for chi2 calculation.
Definition: ECLDspData.h:289
Belle2::ECLDspData::getlAT
short int getlAT() const
Definition: ECLDspData.h:192
Belle2::ECLDspData::getverMin
unsigned char getverMin() const
Definition: ECLDspData.h:184
Belle2::ECLDspData::sety0Startr
void sety0Startr(unsigned char val)
Set start point for pedestal calculation.
Definition: ECLDspData.h:297
Belle2::ECLDspData::getkc
unsigned char getkc() const
Number of bits for FG33, FG43.
Definition: ECLDspData.h:212
Belle2::ECLDspData::setverMin
void setverMin(unsigned char val)
Sets minor version of DSP coefficients.
Definition: ECLDspData.h:267
Belle2::ECLDspData::setka
void setka(unsigned char val)
Set number of bits for FG31, FG41.
Definition: ECLDspData.h:291
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:295
Belle2::ECLDspData::setF31
void setF31(const std::vector< short int > &src)
Array FG31, used to estimate signal amplitude.
Definition: ECLDspData.h:241
Belle2::ECLDspData::getBoardNumber
unsigned char getBoardNumber() const
Return ShaperDSP board number, 0..11.
Definition: ECLDspData.h:217
Belle2::ECLDspData::getverMaj
unsigned char getverMaj() const
Definition: ECLDspData.h:182
Belle2::ECLDspData::m_chiThresh
short int m_chiThresh
chi2 threshold for quality bit
Definition: ECLDspData.h:65
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:265
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:283
Belle2::ECLDspData::setk1
void setk1(unsigned char val)
Set multipliers power of 2 for f, f1.
Definition: ECLDspData.h:287
Belle2::ECLDspData::m_adcAlwThresh
short int m_adcAlwThresh
See https://confluence.desy.de/display/BI/Electronics+Thresholds.
Definition: ECLDspData.h:77
Belle2::ECLDspData::setF43
void setF43(const std::vector< short int > &src)
Alternative for FG33 for signals with small amplitude.
Definition: ECLDspData.h:262
Belle2::ECLDspData::gethT
short int gethT() const
Definition: ECLDspData.h:200
Belle2::ECLDspData::getF
void getF(std::vector< short int > &dst) const
Array with tabulated signal waveform.
Definition: ECLDspData.h:150
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:208
Belle2::ECLDspData::setF33
void setF33(const std::vector< short int > &src)
Array FG33, used to estimate pedestal height in signal.
Definition: ECLDspData.h:254
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:172
Belle2::ECLDspData::getF43
void getF43(std::vector< short int > &dst) const
Alternative for FG33 for signals with small amplitude.
Definition: ECLDspData.h:180
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:154
Belle2::ECLDspData::m_boardNumber
unsigned char m_boardNumber
ShaperDSP board number, 0..11.
Definition: ECLDspData.h:47
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:275
Belle2::ECLDspData::setF41
void setF41(const std::vector< short int > &src)
Alternative for FG31 for signals with small amplitude.
Definition: ECLDspData.h:258
Belle2::ECLDspData::gety0Startr
unsigned char gety0Startr() const
start point for pedestal calculation
Definition: ECLDspData.h:214
Belle2::ECLDspData::setkb
void setkb(unsigned char val)
Set number of bits for FG32.
Definition: ECLDspData.h:293
Belle2::ECLDspData::getk2
unsigned char getk2() const
multipliers power of 2 for chi2 calculation
Definition: ECLDspData.h:206
Belle2::ECLDspData::getExtraData
std::vector< short int > getExtraData() const
Definition: ECLDspData.h:145
Belle2::ECLDspData::m_fg32
std::vector< short int > m_fg32
See documentation for method 'getF32'.
Definition: ECLDspData.h:81
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:139
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:196
Belle2::ECLDspData::getF32
void getF32(std::vector< short int > &dst) const
Array FG32, used to estimate A * delta_t.
Definition: ECLDspData.h:166
Belle2::ECLDspData::getkb
unsigned char getkb() const
Number of bits for FG32.
Definition: ECLDspData.h:210
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:279
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::m_hitThresh
short int m_hitThresh
See https://confluence.desy.de/display/BI/Electronics+Thresholds.
Definition: ECLDspData.h:71