CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/CondFormats/HcalObjects/src/HcalCholeskyMatrix.cc

Go to the documentation of this file.
00001 #include "CondFormats/HcalObjects/interface/HcalCholeskyMatrix.h"
00002 #include <cmath>
00003 
00004 HcalCholeskyMatrix::HcalCholeskyMatrix(int fId) : mId (fId)
00005 {
00006    for(int cap = 0; cap != 4; cap++)
00007       for(int i = 0; i != 55; i++)
00008          cmatrix[cap][i] = 0;
00009 }
00010 
00011 float
00012 HcalCholeskyMatrix::getValue(int capid, int i,int j) const
00013 {
00014    if(i < j) return 0;
00015    int ii = i + 1;
00016    int jj = j + 1;
00017    float blah = (float)(cmatrix[capid][(ii*(ii-1)/2+jj)-1]);
00018    return blah/1000;
00019 }
00020 
00021 void
00022 HcalCholeskyMatrix::setValue(int capid, int i, int j, float val)
00023 {
00024    if(i < j) return;
00025    int ii = i + 1;
00026    int jj = j + 1;
00027    cmatrix[capid][(int)(ii*(ii-1)/2+jj)-1] = (signed short int)(floor)(val*10000);
00028 }
00029