HcalPedestal

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
#ifndef HcalPedestal_h
#define HcalPedestal_h

/** 
\class HcalPedestal
\author Fedor Ratnikov (UMd)
POOL object to store Pedestal values 4xCapId
$Author: ratnikov
$Date: 2007/12/14 13:19:53 $
$Revision: 1.7 $
*/
#include "CondFormats/Serialization/interface/Serializable.h"
#include <cstdint>

class HcalPedestal {
public:
  /// get value for all capId = 0..3
  const float* getValues() const { return &mValue0; }
  /// get value for capId = 0..3
  float getValue(int fCapId) const { return *(getValues() + fCapId); }

  /// get width for all capId = 0..3
  const float* getWidths() const { return &mWidth0; }
  /// get width for capId = 0..3
  float getWidth(int fCapId) const { return *(getWidths() + fCapId); }

  // functions below are not supposed to be used by consumer applications

  HcalPedestal()
      : mId(0), mValue0(0), mValue1(0), mValue2(0), mValue3(0), mWidth0(0), mWidth1(0), mWidth2(0), mWidth3(0) {}

  HcalPedestal(unsigned long fId,
               float fCap0,
               float fCap1,
               float fCap2,
               float fCap3,
               float wCap0 = 0,
               float wCap1 = 0,
               float wCap2 = 0,
               float wCap3 = 0)
      : mId(fId),
        mValue0(fCap0),
        mValue1(fCap1),
        mValue2(fCap2),
        mValue3(fCap3),
        mWidth0(wCap0),
        mWidth1(wCap1),
        mWidth2(wCap2),
        mWidth3(wCap3) {}

  uint32_t rawId() const { return mId; }

private:
  uint32_t mId;
  float mValue0;
  float mValue1;
  float mValue2;
  float mValue3;
  float mWidth0;
  float mWidth1;
  float mWidth2;
  float mWidth3;

  COND_SERIALIZABLE;
};

#endif