Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:14

0001 #ifndef HcalQIEShape_h
0002 #define HcalQIEShape_h
0003 
0004 /** 
0005 \class HcalQIEData
0006 \author Fedor Ratnikov (UMd)
0007 POOL object to store QIE basic shape
0008 $Author: ratnikov
0009 $Date: 2012/11/02 14:13:13 $
0010 $Revision: 1.4 $
0011 */
0012 
0013 #include <vector>
0014 #include <algorithm>
0015 
0016 // N QIE channels
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     //6 bit mantissa in QIE10, 5 in QIE8
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