CMS 3D CMS Logo

CastorPedestalWidth Class Reference

Author:
Panos Katsas (UoA) POOL object to store PedestalWidth values 4xCapId $Author: katsas
More...

#include <CondFormats/CastorObjects/interface/CastorPedestalWidth.h>

List of all members.

Public Member Functions

 CastorPedestalWidth (int fId=0)
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
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:
Panos Katsas (UoA) POOL object to store PedestalWidth values 4xCapId $Author: katsas

Author:
Panos Katsas (UoA) correlation matrix for pedestals

Definition at line 12 of file CastorPedestalWidth.h.


Constructor & Destructor Documentation

CastorPedestalWidth::CastorPedestalWidth ( int  fId = 0  ) 

Definition at line 22 of file CastorPedestalWidth.cc.

References i, and mSigma00.

00022                                                  : mId (fId) {
00023   for (int i = 10; --i >= 0; *(&mSigma00 + i) = 0) {}
00024 }


Member Function Documentation

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

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

Definition at line 30 of file CastorPedestalWidth.cc.

References getValues(), and offset.

Referenced by CastorPedestalWidths::getSigma(), and makeNoise().

00030                                                                    {
00031   return *(getValues () + offset (fCapId1, fCapId2));
00032 }

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

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

Definition at line 15 of file CastorPedestalWidth.h.

References mSigma00.

Referenced by getSigma(), and getWidth().

00015 {return &mSigma00;}

float CastorPedestalWidth::getWidth ( int  fCapId  )  const

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

Definition at line 26 of file CastorPedestalWidth.cc.

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

Referenced by CastorPedestalWidths::getWidth(), CastorDbService::makeCastorCalibrationWidth(), and CastorDbHardcode::makePedestal().

00026                                                      {
00027   return sqrt (*(getValues () + offset (fCapId, fCapId)));
00028 }

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

Definition at line 39 of file CastorPedestalWidth.cc.

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

Referenced by CastorAmplifier::amplify().

00039                                                                                                  {
00040   double s_xx_mean = (getSigma (0,0) + getSigma (1,1) + getSigma (2,2) + getSigma (3,3)) / 4;
00041   double s_xy_mean = (getSigma (1,0) + getSigma (2,1) + getSigma (3,2) + getSigma (3,0)) / 4;
00042   double sigma = sqrt (0.5 * (s_xx_mean + sqrt (s_xx_mean*s_xx_mean - 2*s_xy_mean*s_xy_mean)));
00043   double corr = sigma == 0 ? 0 : 0.5*s_xy_mean / sigma;
00044   for (unsigned i = 0; i < fFrames; i++) {
00045     fNoise [i] = fGauss[i]*sigma;
00046     if (i > 0) fNoise [i] += fGauss[i-1]*corr;
00047     if (i < fFrames-1) fNoise [i] += fGauss[i+1]*corr;
00048   }
00049 }

uint32_t CastorPedestalWidth::rawId (  )  const [inline]

Definition at line 27 of file CastorPedestalWidth.h.

References mId.

00027 {return mId;}

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

Definition at line 34 of file CastorPedestalWidth.cc.

References mSigma00, and offset.

Referenced by CastorPedestalAnalysis::CastorPedVal().

00034                                                                           {
00035   *(&mSigma00 + offset (fCapId1, fCapId2)) = fSigma;
00036 }


Member Data Documentation

uint32_t CastorPedestalWidth::mId [private]

Definition at line 33 of file CastorPedestalWidth.h.

Referenced by rawId().

float CastorPedestalWidth::mSigma00 [private]

Definition at line 34 of file CastorPedestalWidth.h.

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

float CastorPedestalWidth::mSigma10 [private]

Definition at line 35 of file CastorPedestalWidth.h.

float CastorPedestalWidth::mSigma11 [private]

Definition at line 36 of file CastorPedestalWidth.h.

float CastorPedestalWidth::mSigma20 [private]

Definition at line 37 of file CastorPedestalWidth.h.

float CastorPedestalWidth::mSigma21 [private]

Definition at line 38 of file CastorPedestalWidth.h.

float CastorPedestalWidth::mSigma22 [private]

Definition at line 39 of file CastorPedestalWidth.h.

float CastorPedestalWidth::mSigma30 [private]

Definition at line 40 of file CastorPedestalWidth.h.

float CastorPedestalWidth::mSigma31 [private]

Definition at line 41 of file CastorPedestalWidth.h.

float CastorPedestalWidth::mSigma32 [private]

Definition at line 42 of file CastorPedestalWidth.h.

float CastorPedestalWidth::mSigma33 [private]

Definition at line 43 of file CastorPedestalWidth.h.


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