Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef HcalCalibrationQIECoder_h
0002 #define HcalCalibrationQIECoder_h
0003 
0004 /** 
0005 \class HcalQIECoder
0006 \author Fedor Ratnikov (UMd)
0007 POOL object to store calibration mode QIE coder parameters for one channel
0008 $Id
0009 */
0010 
0011 #include "CondFormats/Serialization/interface/Serializable.h"
0012 
0013 #include <vector>
0014 #include <algorithm>
0015 #include <cstdint>
0016 
0017 class HcalCalibrationQIECoder {
0018 public:
0019   HcalCalibrationQIECoder(unsigned long fId = 0) : mId(fId) {}
0020   /// ADC [0..31] -> fC conversion
0021   float charge(const unsigned fAdc) const;
0022   /// fC -> ADC conversion
0023   unsigned adc(const float fCharge) const;
0024 
0025   // following methods are not for use by consumers
0026   float minCharge(unsigned fBin) const;
0027   // 32 values
0028   const float* minCharges() const;
0029   void setMinCharge(unsigned fBin, float fValue);
0030   void setMinCharges(const float fValue[32]);
0031   uint32_t rawId() const { return mId; }
0032 
0033 private:
0034   uint32_t mId;
0035   float bin0;
0036   float bin1;
0037   float bin2;
0038   float bin3;
0039   float bin4;
0040   float bin5;
0041   float bin6;
0042   float bin7;
0043   float bin8;
0044   float bin9;
0045   float bin10;
0046   float bin11;
0047   float bin12;
0048   float bin13;
0049   float bin14;
0050   float bin15;
0051   float bin16;
0052   float bin17;
0053   float bin18;
0054   float bin19;
0055   float bin20;
0056   float bin21;
0057   float bin22;
0058   float bin23;
0059   float bin24;
0060   float bin25;
0061   float bin26;
0062   float bin27;
0063   float bin28;
0064   float bin29;
0065   float bin30;
0066   float bin31;
0067   const float* base() const { return &bin0; }
0068   float* base() { return &bin0; }
0069 
0070   COND_SERIALIZABLE;
0071 };
0072 
0073 #endif