CMS 3D CMS Logo

Public Member Functions | Private Attributes

CastorPedestalWidth Class Reference

#include <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 mSigma01
float mSigma02
float mSigma03
float mSigma10
float mSigma11
float mSigma12
float mSigma13
float mSigma20
float mSigma21
float mSigma22
float mSigma23
float mSigma30
float mSigma31
float mSigma32
float mSigma33

Detailed Description

Author:
Fedor Ratnikov (UMd) POOL object to store PedestalWidth values 4xCapId $Author: ratnikov
Date:
2009/03/26 18:03:15
Revision:
1.2

Adapted for CASTOR by L. Mundim

Author:
Fedor Ratnikov (UMd) correlation matrix for pedestals $Author: ratnikov
Date:
2009/03/26 18:03:16
Revision:
1.2

Adapted for CASTOR by L. Mundim

Definition at line 15 of file CastorPedestalWidth.h.


Constructor & Destructor Documentation

CastorPedestalWidth::CastorPedestalWidth ( int  fId = 0)

Definition at line 27 of file CastorPedestalWidth.cc.

References i, and mSigma00.

                                                 : mId (fId) {
  for (int i = 16; --i >= 0; *(&mSigma00 + i) = 0) {}
}

Member Function Documentation

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

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

Definition at line 35 of file CastorPedestalWidth.cc.

References getValues(), and evf::evtn::offset().

Referenced by CastorPedestalAnalysis::CastorPedVal(), and makeNoise().

                                                                   {
  return *(getValues () + offset (fCapId1, fCapId2));
}
const float* CastorPedestalWidth::getValues ( ) const [inline]

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

Definition at line 18 of file CastorPedestalWidth.h.

References mSigma00.

Referenced by getSigma(), and getWidth().

{return &mSigma00;}
float CastorPedestalWidth::getWidth ( int  fCapId) const

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

Definition at line 31 of file CastorPedestalWidth.cc.

References getValues(), evf::evtn::offset(), and mathSSE::sqrt().

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

                                                     {
  return sqrt (*(getValues () + offset (fCapId, fCapId)));
}
void CastorPedestalWidth::makeNoise ( unsigned  fFrames,
const double *  fGauss,
double *  fNoise 
) const

Definition at line 44 of file CastorPedestalWidth.cc.

References corr, getSigma(), i, ExpressReco_HICollisions_FallBack::sigma, and mathSSE::sqrt().

Referenced by CastorAmplifier::amplify().

                                                                                                 {
  double s_xx_mean = (getSigma (0,0) + getSigma (1,1) + getSigma (2,2) + getSigma (3,3)) / 4;
  double s_xy_mean = (getSigma (1,0) + getSigma (2,1) + getSigma (3,2) + getSigma (3,0)) / 4;
  double sigma = sqrt (0.5 * (s_xx_mean + sqrt (s_xx_mean*s_xx_mean - 2*s_xy_mean*s_xy_mean)));
  double corr = sigma == 0 ? 0 : 0.5*s_xy_mean / sigma;
  for (unsigned i = 0; i < fFrames; i++) {
    fNoise [i] = fGauss[i]*sigma;
    if (i > 0) fNoise [i] += fGauss[i-1]*corr;
    if (i < fFrames-1) fNoise [i] += fGauss[i+1]*corr;
  }
}
uint32_t CastorPedestalWidth::rawId ( ) const [inline]

Definition at line 30 of file CastorPedestalWidth.h.

References mId.

{return mId;}
void CastorPedestalWidth::setSigma ( int  fCapId1,
int  fCapId2,
float  fSigma 
)

Member Data Documentation

uint32_t CastorPedestalWidth::mId [private]

Definition at line 36 of file CastorPedestalWidth.h.

Referenced by rawId().

Definition at line 37 of file CastorPedestalWidth.h.

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

Definition at line 38 of file CastorPedestalWidth.h.

Definition at line 39 of file CastorPedestalWidth.h.

Definition at line 40 of file CastorPedestalWidth.h.

Definition at line 41 of file CastorPedestalWidth.h.

Definition at line 42 of file CastorPedestalWidth.h.

Definition at line 43 of file CastorPedestalWidth.h.

Definition at line 44 of file CastorPedestalWidth.h.

Definition at line 45 of file CastorPedestalWidth.h.

Definition at line 46 of file CastorPedestalWidth.h.

Definition at line 47 of file CastorPedestalWidth.h.

Definition at line 48 of file CastorPedestalWidth.h.

Definition at line 49 of file CastorPedestalWidth.h.

Definition at line 50 of file CastorPedestalWidth.h.

Definition at line 51 of file CastorPedestalWidth.h.

Definition at line 52 of file CastorPedestalWidth.h.