Go to the documentation of this file.00001 #ifndef CastorQIECoder_h
00002 #define CastorQIECoder_h
00003
00013 #include <boost/cstdint.hpp>
00014
00015 #include <vector>
00016 #include <algorithm>
00017
00018 class CastorQIEShape;
00019
00020 class CastorQIECoder {
00021 public:
00022 CastorQIECoder (unsigned long fId = 0) : mId (fId), mOffset00(0), mOffset01(0), mOffset02(0),
00023 mOffset03(0), mOffset10(0), mOffset11(0), mOffset12(0), mOffset13(0),
00024 mOffset20(0), mOffset21(0), mOffset22(0), mOffset23(0), mOffset30(0),
00025 mOffset31(0), mOffset32(0), mOffset33(0), mSlope00(0), mSlope01(0),
00026 mSlope02(0), mSlope03(0), mSlope10(0), mSlope11(0), mSlope12(0),
00027 mSlope13(0), mSlope20(0), mSlope21(0), mSlope22(0), mSlope23(0),
00028 mSlope30(0), mSlope31(0), mSlope32(0), mSlope33(0) {};
00029
00031 float charge (const CastorQIEShape& fShape, unsigned fAdc, unsigned fCapId) const;
00033 unsigned adc (const CastorQIEShape& fShape, float fCharge, unsigned fCapId) const;
00034
00035
00036 float offset (unsigned fCapId, unsigned fRange) const;
00037 float slope (unsigned fCapId, unsigned fRange) const;
00038
00039 void setOffset (unsigned fCapId, unsigned fRange, float fValue);
00040 void setSlope (unsigned fCapId, unsigned fRange, float fValue);
00041
00042 uint32_t rawId () const {return mId;}
00043
00044 private:
00045 uint32_t mId;
00046 float mOffset00;
00047 float mOffset01;
00048 float mOffset02;
00049 float mOffset03;
00050 float mOffset10;
00051 float mOffset11;
00052 float mOffset12;
00053 float mOffset13;
00054 float mOffset20;
00055 float mOffset21;
00056 float mOffset22;
00057 float mOffset23;
00058 float mOffset30;
00059 float mOffset31;
00060 float mOffset32;
00061 float mOffset33;
00062 float mSlope00;
00063 float mSlope01;
00064 float mSlope02;
00065 float mSlope03;
00066 float mSlope10;
00067 float mSlope11;
00068 float mSlope12;
00069 float mSlope13;
00070 float mSlope20;
00071 float mSlope21;
00072 float mSlope22;
00073 float mSlope23;
00074 float mSlope30;
00075 float mSlope31;
00076 float mSlope32;
00077 float mSlope33;
00078 };
00079
00080 #endif