CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CastorQIECoder.h
Go to the documentation of this file.
1 #ifndef CastorQIECoder_h
2 #define CastorQIECoder_h
3 
14 
15 #include <vector>
16 #include <algorithm>
17 #include <cstdint>
18 
19 class CastorQIEShape;
20 
22 public:
23  CastorQIECoder(unsigned long fId = 0)
24  : mId(fId),
25  mOffset00(0),
26  mOffset01(0),
27  mOffset02(0),
28  mOffset03(0),
29  mOffset10(0),
30  mOffset11(0),
31  mOffset12(0),
32  mOffset13(0),
33  mOffset20(0),
34  mOffset21(0),
35  mOffset22(0),
36  mOffset23(0),
37  mOffset30(0),
38  mOffset31(0),
39  mOffset32(0),
40  mOffset33(0),
41  mSlope00(0),
42  mSlope01(0),
43  mSlope02(0),
44  mSlope03(0),
45  mSlope10(0),
46  mSlope11(0),
47  mSlope12(0),
48  mSlope13(0),
49  mSlope20(0),
50  mSlope21(0),
51  mSlope22(0),
52  mSlope23(0),
53  mSlope30(0),
54  mSlope31(0),
55  mSlope32(0),
56  mSlope33(0){};
57 
59  float charge(const CastorQIEShape& fShape, unsigned fAdc, unsigned fCapId) const;
61  unsigned adc(const CastorQIEShape& fShape, float fCharge, unsigned fCapId) const;
62 
63  // following methods are not for use by consumers
64  float offset(unsigned fCapId, unsigned fRange) const;
65  float slope(unsigned fCapId, unsigned fRange) const;
66 
67  void setOffset(unsigned fCapId, unsigned fRange, float fValue);
68  void setSlope(unsigned fCapId, unsigned fRange, float fValue);
69 
70  uint32_t rawId() const { return mId; }
71 
72 private:
73  uint32_t mId;
74  float mOffset00;
75  float mOffset01;
76  float mOffset02;
77  float mOffset03;
78  float mOffset10;
79  float mOffset11;
80  float mOffset12;
81  float mOffset13;
82  float mOffset20;
83  float mOffset21;
84  float mOffset22;
85  float mOffset23;
86  float mOffset30;
87  float mOffset31;
88  float mOffset32;
89  float mOffset33;
90  float mSlope00;
91  float mSlope01;
92  float mSlope02;
93  float mSlope03;
94  float mSlope10;
95  float mSlope11;
96  float mSlope12;
97  float mSlope13;
98  float mSlope20;
99  float mSlope21;
100  float mSlope22;
101  float mSlope23;
102  float mSlope30;
103  float mSlope31;
104  float mSlope32;
105  float mSlope33;
106 
108 };
109 
110 #endif
uint32_t rawId() const
void setSlope(unsigned fCapId, unsigned fRange, float fValue)
float charge(const CastorQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -&gt; fC conversion.
void setOffset(unsigned fCapId, unsigned fRange, float fValue)
CastorQIECoder(unsigned long fId=0)
#define COND_SERIALIZABLE
Definition: Serializable.h:39
float offset(unsigned fCapId, unsigned fRange) const
unsigned adc(const CastorQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -&gt; ADC conversion
float slope(unsigned fCapId, unsigned fRange) const