Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef HcalQIECoder_h
0002 #define HcalQIECoder_h
0003 
0004 /** 
0005 \class HcalQIECoder
0006 \author Fedor Ratnikov (UMd)
0007 POOL object to store QIE coder parameters for one channel
0008 $Author: ratnikov
0009 $Date: 2008/03/05 10:38:03 $
0010 $Revision: 1.9 $
0011 */
0012 #include "CondFormats/Serialization/interface/Serializable.h"
0013 
0014 #include <vector>
0015 #include <algorithm>
0016 #include <cstdint>
0017 
0018 class HcalQIEShape;
0019 
0020 class HcalQIECoder {
0021 public:
0022   HcalQIECoder(unsigned long fId = 0) : mId(fId) {}
0023 
0024   /// ADC [0..127] + capid [0..3] -> fC conversion
0025   float charge(const HcalQIEShape& fShape, unsigned fAdc, unsigned fCapId) const;
0026   /// fC + capid [0..3] -> ADC conversion
0027   unsigned adc(const HcalQIEShape& fShape, float fCharge, unsigned fCapId) const;
0028 
0029   // following methods are not for use by consumers
0030   float offset(unsigned fCapId, unsigned fRange) const;
0031   float slope(unsigned fCapId, unsigned fRange) const;
0032 
0033   void setOffset(unsigned fCapId, unsigned fRange, float fValue);
0034   void setSlope(unsigned fCapId, unsigned fRange, float fValue);
0035 
0036   uint32_t rawId() const { return mId; }
0037 
0038 private:
0039   uint32_t mId;
0040   float mOffset00;
0041   float mOffset01;
0042   float mOffset02;
0043   float mOffset03;
0044   float mOffset10;
0045   float mOffset11;
0046   float mOffset12;
0047   float mOffset13;
0048   float mOffset20;
0049   float mOffset21;
0050   float mOffset22;
0051   float mOffset23;
0052   float mOffset30;
0053   float mOffset31;
0054   float mOffset32;
0055   float mOffset33;
0056   float mSlope00;
0057   float mSlope01;
0058   float mSlope02;
0059   float mSlope03;
0060   float mSlope10;
0061   float mSlope11;
0062   float mSlope12;
0063   float mSlope13;
0064   float mSlope20;
0065   float mSlope21;
0066   float mSlope22;
0067   float mSlope23;
0068   float mSlope30;
0069   float mSlope31;
0070   float mSlope32;
0071   float mSlope33;
0072 
0073   COND_SERIALIZABLE;
0074 };
0075 
0076 #endif