CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
CastorPedestalWidth Class Reference

#include <CastorPedestalWidth.h>

Public Member Functions

 CastorPedestalWidth (int fId=0)
 
float getSigma (int fCapId1, int fCapId2) const
 get correlation element for capId1/2 = 0..3 More...
 
const float * getValues () const
 get value for all capId = 0..3, 10 values in total More...
 
float getWidth (int fCapId) const
 get width (sqrt(sigma_i_i)) for capId = 0..3 More...
 
void makeNoise (unsigned fFrames, const double *fGauss, double *fNoise) const
 
uint32_t rawId () const
 
void setSigma (int fCapId1, int fCapId2, float fSigma)
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

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
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Author
Fedor Ratnikov (UMd) POOL object to store PedestalWidth values 4xCapId $Author: ratnikov
Date
2009/03/24 16:05:29
Revision
1.10

Adapted for CASTOR by L. Mundim

Author
Fedor Ratnikov (UMd) correlation matrix for pedestals $Author: ratnikov
Date
2009/03/24 16:05:35
Revision
1.9

Adapted for CASTOR by L. Mundim

Definition at line 16 of file CastorPedestalWidth.h.

Constructor & Destructor Documentation

◆ CastorPedestalWidth()

CastorPedestalWidth::CastorPedestalWidth ( int  fId = 0)

Definition at line 27 of file CastorPedestalWidth.cc.

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

References mps_fire::i, and mSigma00.

Member Function Documentation

◆ getSigma()

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

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

Definition at line 34 of file CastorPedestalWidth.cc.

34  {
35  return *(getValues() + offset(fCapId1, fCapId2));
36 }

References getValues(), and hltrates_dqm_sourceclient-live_cfg::offset.

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

◆ getValues()

const float* CastorPedestalWidth::getValues ( ) const
inline

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

Definition at line 19 of file CastorPedestalWidth.h.

19 { return &mSigma00; }

References mSigma00.

Referenced by getSigma(), and getWidth().

◆ getWidth()

float CastorPedestalWidth::getWidth ( int  fCapId) const

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

Definition at line 32 of file CastorPedestalWidth.cc.

32 { return sqrt(*(getValues() + offset(fCapId, fCapId))); }

References getValues(), hltrates_dqm_sourceclient-live_cfg::offset, and mathSSE::sqrt().

Referenced by CastorDbService::makeCastorCalibrationWidth().

◆ makeNoise()

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

Definition at line 43 of file CastorPedestalWidth.cc.

43  {
44  double s_xx_mean = (getSigma(0, 0) + getSigma(1, 1) + getSigma(2, 2) + getSigma(3, 3)) / 4;
45  double s_xy_mean = (getSigma(1, 0) + getSigma(2, 1) + getSigma(3, 2) + getSigma(3, 0)) / 4;
46  double sigma = sqrt(0.5 * (s_xx_mean + sqrt(s_xx_mean * s_xx_mean - 2 * s_xy_mean * s_xy_mean)));
47  double corr = sigma == 0 ? 0 : 0.5 * s_xy_mean / sigma;
48  for (unsigned i = 0; i < fFrames; i++) {
49  fNoise[i] = fGauss[i] * sigma;
50  if (i > 0)
51  fNoise[i] += fGauss[i - 1] * corr;
52  if (i < fFrames - 1)
53  fNoise[i] += fGauss[i + 1] * corr;
54  }
55 }

References alignCSCRings::corr, getSigma(), mps_fire::i, and mathSSE::sqrt().

Referenced by CastorAmplifier::amplify().

◆ rawId()

uint32_t CastorPedestalWidth::rawId ( ) const
inline

Definition at line 31 of file CastorPedestalWidth.h.

31 { return mId; }

References mId.

◆ serialize()

template<class Archive >
void CastorPedestalWidth::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ setSigma()

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

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 55 of file CastorPedestalWidth.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 55 of file CastorPedestalWidth.h.

Member Data Documentation

◆ mId

uint32_t CastorPedestalWidth::mId
private

Definition at line 37 of file CastorPedestalWidth.h.

Referenced by rawId().

◆ mSigma00

float CastorPedestalWidth::mSigma00
private

Definition at line 38 of file CastorPedestalWidth.h.

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

◆ mSigma01

float CastorPedestalWidth::mSigma01
private

Definition at line 39 of file CastorPedestalWidth.h.

◆ mSigma02

float CastorPedestalWidth::mSigma02
private

Definition at line 40 of file CastorPedestalWidth.h.

◆ mSigma03

float CastorPedestalWidth::mSigma03
private

Definition at line 41 of file CastorPedestalWidth.h.

◆ mSigma10

float CastorPedestalWidth::mSigma10
private

Definition at line 42 of file CastorPedestalWidth.h.

◆ mSigma11

float CastorPedestalWidth::mSigma11
private

Definition at line 43 of file CastorPedestalWidth.h.

◆ mSigma12

float CastorPedestalWidth::mSigma12
private

Definition at line 44 of file CastorPedestalWidth.h.

◆ mSigma13

float CastorPedestalWidth::mSigma13
private

Definition at line 45 of file CastorPedestalWidth.h.

◆ mSigma20

float CastorPedestalWidth::mSigma20
private

Definition at line 46 of file CastorPedestalWidth.h.

◆ mSigma21

float CastorPedestalWidth::mSigma21
private

Definition at line 47 of file CastorPedestalWidth.h.

◆ mSigma22

float CastorPedestalWidth::mSigma22
private

Definition at line 48 of file CastorPedestalWidth.h.

◆ mSigma23

float CastorPedestalWidth::mSigma23
private

Definition at line 49 of file CastorPedestalWidth.h.

◆ mSigma30

float CastorPedestalWidth::mSigma30
private

Definition at line 50 of file CastorPedestalWidth.h.

◆ mSigma31

float CastorPedestalWidth::mSigma31
private

Definition at line 51 of file CastorPedestalWidth.h.

◆ mSigma32

float CastorPedestalWidth::mSigma32
private

Definition at line 52 of file CastorPedestalWidth.h.

◆ mSigma33

float CastorPedestalWidth::mSigma33
private

Definition at line 53 of file CastorPedestalWidth.h.

mps_fire.i
i
Definition: mps_fire.py:355
CastorPedestalWidth::mSigma00
float mSigma00
Definition: CastorPedestalWidth.h:38
alignCSCRings.corr
dictionary corr
Definition: alignCSCRings.py:124
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
CastorPedestalWidth::mId
uint32_t mId
Definition: CastorPedestalWidth.h:37
CastorPedestalWidth::getValues
const float * getValues() const
get value for all capId = 0..3, 10 values in total
Definition: CastorPedestalWidth.h:19
CastorPedestalWidth::getSigma
float getSigma(int fCapId1, int fCapId2) const
get correlation element for capId1/2 = 0..3
Definition: CastorPedestalWidth.cc:34
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:78