Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:50:53

0001 #ifndef CastorQIECoder_h
0002 #define CastorQIECoder_h
0003 
0004 /** 
0005 \class CastorQIECoder
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 Modified for CASTOR by L. Mundim
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   /// ADC [0..127] + capid [0..3] -> fC conversion
0059   float charge(const CastorQIEShape& fShape, unsigned fAdc, unsigned fCapId) const;
0060   /// fC + capid [0..3] -> ADC conversion
0061   unsigned adc(const CastorQIEShape& fShape, float fCharge, unsigned fCapId) const;
0062 
0063   // following methods are not for use by consumers
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