File indexing completed on 2024-04-06 12:02:14
0001 #ifndef HcalQIEShape_h
0002 #define HcalQIEShape_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include <vector>
0014 #include <algorithm>
0015
0016
0017 class HcalQIEShape {
0018 public:
0019 HcalQIEShape();
0020 ~HcalQIEShape();
0021 float lowEdge(unsigned fAdc) const;
0022 float highEdge(unsigned fAdc) const;
0023 float center(unsigned fAdc) const;
0024 bool setLowEdges(unsigned int nVals, const float *fValue);
0025 unsigned range(unsigned fAdc) const {
0026
0027 return (nbins_ == 32) ? (fAdc >> 5) & 0x3 : (fAdc >> 6) & 0x3;
0028 }
0029 unsigned local(unsigned fAdc) const {
0030 unsigned tmp = nbins_ == 32 ? (fAdc & 0x1f) : (fAdc & 0x3f);
0031 return tmp;
0032 }
0033 unsigned nbins() const { return nbins_; }
0034
0035 protected:
0036 private:
0037 void expand();
0038 bool setLowEdge(float fValue, unsigned fAdc);
0039 std::vector<float> mValues;
0040 unsigned int nbins_;
0041 };
0042
0043 #endif