CMS 3D CMS Logo

HcalPedestalWidth Class Reference

Author:
Fedor Ratnikov (UMd) POOL object to store PedestalWidth values 4xCapId $Author: ratnikov
Date
2007/12/14 13:31:50
Revision
1.8
More...

#include <CondFormats/HcalObjects/interface/HcalPedestalWidth.h>

List of all members.

Public Member Functions

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
float getWidth (int fCapId) const
 get width (sqrt(sigma_i_i)) for capId = 0..3
 HcalPedestalWidth (int fId=0)
void makeNoise (unsigned fFrames, const double *fGauss, double *fNoise) const
uint32_t rawId () const
void setSigma (int fCapId1, int fCapId2, float fSigma)

Private Attributes

uint32_t mId
float mSigma00
float mSigma10
float mSigma11
float mSigma20
float mSigma21
float mSigma22
float mSigma30
float mSigma31
float mSigma32
float mSigma33


Detailed Description

Author:
Fedor Ratnikov (UMd) POOL object to store PedestalWidth values 4xCapId $Author: ratnikov
Date
2007/12/14 13:31:50
Revision
1.8

Author:
Fedor Ratnikov (UMd) correlation matrix for pedestals $Author: ratnikov
Date
2008/10/03 09:17:43
Revision
1.6.2.1

Definition at line 14 of file HcalPedestalWidth.h.


Constructor & Destructor Documentation

HcalPedestalWidth::HcalPedestalWidth ( int  fId = 0  ) 

Definition at line 25 of file HcalPedestalWidth.cc.

References i, and mSigma00.

00025                                              : mId (fId) {
00026   for (int i = 10; --i >= 0; *(&mSigma00 + i) = 0) {}
00027 }


Member Function Documentation

float HcalPedestalWidth::getSigma ( int  fCapId1,
int  fCapId2 
) const

get correlation element for capId1/2 = 0..3

Definition at line 33 of file HcalPedestalWidth.cc.

References getValues(), and offset.

Referenced by XMLDocument::addData(), HcalDeadCellMonitor::createMaps(), HcalHotCellMonitor::createMaps(), dumpData(), HcalPedestalMonitor::fillDBValues(), XMLDocument::makeData(), makeNoise(), and HcalRecHitsMaker::noiseInfCfromDB().

00033                                                                  {
00034   return *(getValues () + offset (fCapId1, fCapId2));
00035 }

const float* HcalPedestalWidth::getValues (  )  const [inline]

get value for all capId = 0..3, 10 values in total

Definition at line 17 of file HcalPedestalWidth.h.

References mSigma00.

Referenced by HcalPedestalWidthsCheck::analyze(), getSigma(), and getWidth().

00017 {return &mSigma00;}

float HcalPedestalWidth::getWidth ( int  fCapId  )  const

get width (sqrt(sigma_i_i)) for capId = 0..3

Definition at line 29 of file HcalPedestalWidth.cc.

References getValues(), offset, and funct::sqrt().

Referenced by HcalDbService::makeHcalCalibrationWidth(), and HcalDigiTester::reco().

00029                                                    {
00030   return sqrt (*(getValues () + offset (fCapId, fCapId)));
00031 }

void HcalPedestalWidth::makeNoise ( unsigned  fFrames,
const double *  fGauss,
double *  fNoise 
) const

Definition at line 42 of file HcalPedestalWidth.cc.

References getSigma(), i, and funct::sqrt().

Referenced by HcalAmplifier::amplify().

00042                                                                                                {
00043 
00044   double s_xx_mean = (getSigma (0,0) + getSigma (1,1) + getSigma (2,2) + getSigma (3,3)) / 4;
00045 
00046   // S. Abdullin, 22.09.2008
00047   // replacing this sum (not quite correct, anyway, as it should be  
00048   // (0,1), (1,2), (2,3), (3,0) from the full *asymmetric* matrix.
00049   //  double s_xy_mean =  (getSigma (1,0) + getSigma (2,1)
00050   //                     + getSigma (3,2) + getSigma (3,0)) / 4;
00051   // with just a (fixed as optimal) fraction of diagonal elements:
00052   double s_xy_mean = -0.5 * s_xx_mean;
00053 
00054   // added a simple protection against negative sqrt() arguments in case of 
00055   // improperly big off-diaigonal terms (S.Abdullin, 27.03.2008)
00056   double term  = s_xx_mean*s_xx_mean - 2.*s_xy_mean*s_xy_mean;
00057   if (term < 0.) term = 1.e-50 ;
00058   double sigma = sqrt (0.5 * (s_xx_mean + sqrt(term)));
00059   double corr = sigma == 0. ? 0. : 0.5*s_xy_mean / sigma;
00060 
00061   for (unsigned i = 0; i < fFrames; i++) {
00062     fNoise [i] = fGauss[i]*sigma;
00063     if (i > 0) fNoise [i] += fGauss[i-1]*corr;
00064     if (i < fFrames-1) fNoise [i] += fGauss[i+1]*corr;
00065   }
00066 }

uint32_t HcalPedestalWidth::rawId (  )  const [inline]

Definition at line 29 of file HcalPedestalWidth.h.

References mId.

00029 {return mId;}

void HcalPedestalWidth::setSigma ( int  fCapId1,
int  fCapId2,
float  fSigma 
)

Definition at line 37 of file HcalPedestalWidth.cc.

References mSigma00, and offset.

Referenced by HcalDbXml::dumpObject(), HcalDbOnline::getObject(), HcalPedestalAnalysis::HcalPedVal(), and HcalPedestalsAnalysis::~HcalPedestalsAnalysis().

00037                                                                         {
00038   *(&mSigma00 + offset (fCapId1, fCapId2)) = fSigma;
00039 }


Member Data Documentation

uint32_t HcalPedestalWidth::mId [private]

Definition at line 35 of file HcalPedestalWidth.h.

Referenced by rawId().

float HcalPedestalWidth::mSigma00 [private]

Definition at line 36 of file HcalPedestalWidth.h.

Referenced by getValues(), HcalPedestalWidth(), and setSigma().

float HcalPedestalWidth::mSigma10 [private]

Definition at line 37 of file HcalPedestalWidth.h.

float HcalPedestalWidth::mSigma11 [private]

Definition at line 38 of file HcalPedestalWidth.h.

float HcalPedestalWidth::mSigma20 [private]

Definition at line 39 of file HcalPedestalWidth.h.

float HcalPedestalWidth::mSigma21 [private]

Definition at line 40 of file HcalPedestalWidth.h.

float HcalPedestalWidth::mSigma22 [private]

Definition at line 41 of file HcalPedestalWidth.h.

float HcalPedestalWidth::mSigma30 [private]

Definition at line 42 of file HcalPedestalWidth.h.

float HcalPedestalWidth::mSigma31 [private]

Definition at line 43 of file HcalPedestalWidth.h.

float HcalPedestalWidth::mSigma32 [private]

Definition at line 44 of file HcalPedestalWidth.h.

float HcalPedestalWidth::mSigma33 [private]

Definition at line 45 of file HcalPedestalWidth.h.


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:23:49 2009 for CMSSW by  doxygen 1.5.4