HcalCalibrationQIECoder

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
#ifndef HcalCalibrationQIECoder_h
#define HcalCalibrationQIECoder_h

/** 
\class HcalQIECoder
\author Fedor Ratnikov (UMd)
POOL object to store calibration mode QIE coder parameters for one channel
$Id
*/

#include "CondFormats/Serialization/interface/Serializable.h"

#include <vector>
#include <algorithm>
#include <cstdint>

class HcalCalibrationQIECoder {
public:
  HcalCalibrationQIECoder(unsigned long fId = 0) : mId(fId) {}
  /// ADC [0..31] -> fC conversion
  float charge(const unsigned fAdc) const;
  /// fC -> ADC conversion
  unsigned adc(const float fCharge) const;

  // following methods are not for use by consumers
  float minCharge(unsigned fBin) const;
  // 32 values
  const float* minCharges() const;
  void setMinCharge(unsigned fBin, float fValue);
  void setMinCharges(const float fValue[32]);
  uint32_t rawId() const { return mId; }

private:
  uint32_t mId;
  float bin0;
  float bin1;
  float bin2;
  float bin3;
  float bin4;
  float bin5;
  float bin6;
  float bin7;
  float bin8;
  float bin9;
  float bin10;
  float bin11;
  float bin12;
  float bin13;
  float bin14;
  float bin15;
  float bin16;
  float bin17;
  float bin18;
  float bin19;
  float bin20;
  float bin21;
  float bin22;
  float bin23;
  float bin24;
  float bin25;
  float bin26;
  float bin27;
  float bin28;
  float bin29;
  float bin30;
  float bin31;
  const float* base() const { return &bin0; }
  float* base() { return &bin0; }

  COND_SERIALIZABLE;
};

#endif