File indexing completed on 2024-09-07 04:35:36
0001 #ifndef CastorQIECoder_h
0002 #define CastorQIECoder_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include "CondFormats/Serialization/interface/Serializable.h"
0014
0015 #include <vector>
0016 #include <algorithm>
0017 #include <cstdint>
0018
0019 class CastorQIEShape;
0020
0021 class CastorQIECoder {
0022 public:
0023 CastorQIECoder(unsigned long fId = 0)
0024 : mId(fId),
0025 mOffset00(0),
0026 mOffset01(0),
0027 mOffset02(0),
0028 mOffset03(0),
0029 mOffset10(0),
0030 mOffset11(0),
0031 mOffset12(0),
0032 mOffset13(0),
0033 mOffset20(0),
0034 mOffset21(0),
0035 mOffset22(0),
0036 mOffset23(0),
0037 mOffset30(0),
0038 mOffset31(0),
0039 mOffset32(0),
0040 mOffset33(0),
0041 mSlope00(0),
0042 mSlope01(0),
0043 mSlope02(0),
0044 mSlope03(0),
0045 mSlope10(0),
0046 mSlope11(0),
0047 mSlope12(0),
0048 mSlope13(0),
0049 mSlope20(0),
0050 mSlope21(0),
0051 mSlope22(0),
0052 mSlope23(0),
0053 mSlope30(0),
0054 mSlope31(0),
0055 mSlope32(0),
0056 mSlope33(0) {}
0057
0058
0059 float charge(const CastorQIEShape& fShape, unsigned fAdc, unsigned fCapId) const;
0060
0061 unsigned adc(const CastorQIEShape& fShape, float fCharge, unsigned fCapId) const;
0062
0063
0064 float offset(unsigned fCapId, unsigned fRange) const;
0065 float slope(unsigned fCapId, unsigned fRange) const;
0066
0067 void setOffset(unsigned fCapId, unsigned fRange, float fValue);
0068 void setSlope(unsigned fCapId, unsigned fRange, float fValue);
0069
0070 uint32_t rawId() const { return mId; }
0071
0072 private:
0073 uint32_t mId;
0074 float mOffset00;
0075 float mOffset01;
0076 float mOffset02;
0077 float mOffset03;
0078 float mOffset10;
0079 float mOffset11;
0080 float mOffset12;
0081 float mOffset13;
0082 float mOffset20;
0083 float mOffset21;
0084 float mOffset22;
0085 float mOffset23;
0086 float mOffset30;
0087 float mOffset31;
0088 float mOffset32;
0089 float mOffset33;
0090 float mSlope00;
0091 float mSlope01;
0092 float mSlope02;
0093 float mSlope03;
0094 float mSlope10;
0095 float mSlope11;
0096 float mSlope12;
0097 float mSlope13;
0098 float mSlope20;
0099 float mSlope21;
0100 float mSlope22;
0101 float mSlope23;
0102 float mSlope30;
0103 float mSlope31;
0104 float mSlope32;
0105 float mSlope33;
0106
0107 COND_SERIALIZABLE;
0108 };
0109
0110 #endif