CMS 3D CMS Logo

HcalPedestalWidth.cc
Go to the documentation of this file.
1 
10 #include <cmath>
11 #include <iostream>
12 
14 
15 namespace {
16  int offset(int fCapId1, int fCapId2) {
17  // static int offsets [4] = {0, 1, 3, 6};
18  // if (fCapId1 < fCapId2) { // swap
19  // int tmp = fCapId1; fCapId1 = fCapId2; fCapId2 = tmp;
20  // }
21  // return offsets [fCapId1] + fCapId2;
22  return fCapId1 * 4 + fCapId2;
23  }
24 } // namespace
25 
27  for (int i = 16; --i >= 0; *(&mSigma00 + i) = 0) {
28  }
29 }
30 
31 float HcalPedestalWidth::getWidth(int fCapId) const { return sqrt(*(getValues() + offset(fCapId, fCapId))); }
32 
33 float HcalPedestalWidth::getSigma(int fCapId1, int fCapId2) const { return *(getValues() + offset(fCapId1, fCapId2)); }
34 
35 void HcalPedestalWidth::setSigma(int fCapId1, int fCapId2, float fSigma) {
36  *(&mSigma00 + offset(fCapId1, fCapId2)) = fSigma;
37 }
T sqrt(T t)
Definition: SSEVec.h:23
float getSigma(int fCapId1, int fCapId2) const
get correlation element for capId1/2 = 0..3
const float * getValues() const
get value for all capId = 0..3, 10 values in total
HcalPedestalWidth(int fId=0)
void setSigma(int fCapId1, int fCapId2, float fSigma)
float getWidth(int fCapId) const
get width (sqrt(sigma_i_i)) for capId = 0..3