File indexing completed on 2024-04-06 12:02:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include <cmath>
0011 #include <iostream>
0012
0013 #include "CondFormats/HcalObjects/interface/HcalPedestalWidth.h"
0014
0015 namespace {
0016 int offset(int fCapId1, int fCapId2) {
0017
0018
0019
0020
0021
0022 return fCapId1 * 4 + fCapId2;
0023 }
0024 }
0025
0026 HcalPedestalWidth::HcalPedestalWidth(int fId) : mId(fId) {
0027 for (int i = 16; --i >= 0; *(&mSigma00 + i) = 0) {
0028 }
0029 }
0030
0031 float HcalPedestalWidth::getWidth(int fCapId) const { return sqrt(*(getValues() + offset(fCapId, fCapId))); }
0032
0033 float HcalPedestalWidth::getSigma(int fCapId1, int fCapId2) const { return *(getValues() + offset(fCapId1, fCapId2)); }
0034
0035 void HcalPedestalWidth::setSigma(int fCapId1, int fCapId2, float fSigma) {
0036 *(&mSigma00 + offset(fCapId1, fCapId2)) = fSigma;
0037 }