00001 #ifndef CastorCalibrationQIECoder_h 00002 #define CastorCalibrationQIECoder_h 00003 00011 #include <vector> 00012 #include <algorithm> 00013 #include <boost/cstdint.hpp> 00014 00015 class CastorCalibrationQIECoder { 00016 public: 00017 CastorCalibrationQIECoder (unsigned long fId = 0) : mId (fId) {} 00019 float charge (const unsigned fAdc) const; 00021 unsigned adc (const float fCharge) const; 00022 00023 // following methods are not for use by consumers 00024 float minCharge (unsigned fBin) const; 00025 // 32 values 00026 const float* minCharges () const; 00027 void setMinCharge (unsigned fBin, float fValue); 00028 void setMinCharges (const float fValue [32]); 00029 uint32_t rawId () const {return mId;} 00030 private: 00031 uint32_t mId; 00032 float bin0; 00033 float bin1; 00034 float bin2; 00035 float bin3; 00036 float bin4; 00037 float bin5; 00038 float bin6; 00039 float bin7; 00040 float bin8; 00041 float bin9; 00042 float bin10; 00043 float bin11; 00044 float bin12; 00045 float bin13; 00046 float bin14; 00047 float bin15; 00048 float bin16; 00049 float bin17; 00050 float bin18; 00051 float bin19; 00052 float bin20; 00053 float bin21; 00054 float bin22; 00055 float bin23; 00056 float bin24; 00057 float bin25; 00058 float bin26; 00059 float bin27; 00060 float bin28; 00061 float bin29; 00062 float bin30; 00063 float bin31; 00064 const float* base () const {return &bin0;} 00065 float* base () {return &bin0;} 00066 }; 00067 00068 #endif