CMS 3D CMS Logo

CastorQIECoder.h
Go to the documentation of this file.
1 #ifndef CastorQIECoder_h
2 #define CastorQIECoder_h
3 
14 
15 #include <boost/cstdint.hpp>
16 
17 #include <vector>
18 #include <algorithm>
19 
20 class CastorQIEShape;
21 
23  public:
24  CastorQIECoder (unsigned long fId = 0) : mId (fId), mOffset00(0), mOffset01(0), mOffset02(0),
25  mOffset03(0), mOffset10(0), mOffset11(0), mOffset12(0), mOffset13(0),
26  mOffset20(0), mOffset21(0), mOffset22(0), mOffset23(0), mOffset30(0),
27  mOffset31(0), mOffset32(0), mOffset33(0), mSlope00(0), mSlope01(0),
28  mSlope02(0), mSlope03(0), mSlope10(0), mSlope11(0), mSlope12(0),
29  mSlope13(0), mSlope20(0), mSlope21(0), mSlope22(0), mSlope23(0),
30  mSlope30(0), mSlope31(0), mSlope32(0), mSlope33(0) {};
31 
33  float charge (const CastorQIEShape& fShape, unsigned fAdc, unsigned fCapId) const;
35  unsigned adc (const CastorQIEShape& fShape, float fCharge, unsigned fCapId) const;
36 
37  // following methods are not for use by consumers
38  float offset (unsigned fCapId, unsigned fRange) const;
39  float slope (unsigned fCapId, unsigned fRange) const;
40 
41  void setOffset (unsigned fCapId, unsigned fRange, float fValue);
42  void setSlope (unsigned fCapId, unsigned fRange, float fValue);
43 
44  uint32_t rawId () const {return mId;}
45 
46  private:
47  uint32_t mId;
48  float mOffset00;
49  float mOffset01;
50  float mOffset02;
51  float mOffset03;
52  float mOffset10;
53  float mOffset11;
54  float mOffset12;
55  float mOffset13;
56  float mOffset20;
57  float mOffset21;
58  float mOffset22;
59  float mOffset23;
60  float mOffset30;
61  float mOffset31;
62  float mOffset32;
63  float mOffset33;
64  float mSlope00;
65  float mSlope01;
66  float mSlope02;
67  float mSlope03;
68  float mSlope10;
69  float mSlope11;
70  float mSlope12;
71  float mSlope13;
72  float mSlope20;
73  float mSlope21;
74  float mSlope22;
75  float mSlope23;
76  float mSlope30;
77  float mSlope31;
78  float mSlope32;
79  float mSlope33;
80 
82 };
83 
84 #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] -> fC conversion.
void setOffset(unsigned fCapId, unsigned fRange, float fValue)
CastorQIECoder(unsigned long fId=0)
#define COND_SERIALIZABLE
Definition: Serializable.h:38
float offset(unsigned fCapId, unsigned fRange) const
unsigned adc(const CastorQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -> ADC conversion
float slope(unsigned fCapId, unsigned fRange) const