CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
CorrelatedNoisifier< M > Class Template Reference

adds noise to the given frame. More...

#include <EcalCoder.h>

Public Types

typedef std::vector< double > VecDou
 

Public Member Functions

const M & cholMat () const
 
 CorrelatedNoisifier (const M &symCorMat)
 
 CorrelatedNoisifier (int *dummy, const M &cholDecMat)
 
template<class T >
void noisify (T &frame, CLHEP::HepRandomEngine *, const VecDou *rangau=0) const
 
void resetCholDecompMatrix (const M &cholMat)
 
void resetCorrelationMatrix (const M &symCorMat)
 
const VecDouvecgau () const
 
virtual ~CorrelatedNoisifier ()
 

Private Member Functions

bool checkDecomposition (const M &symCorMat, M &HHtDiff) const
 
void checkOffDiagonal (const M &symCorMat)
 
bool computeDecomposition (const M &symCorMat)
 
void init (const M &symCorMat)
 
void initChol ()
 

Private Attributes

m_H
 
bool m_isDiagonal
 
bool m_isIdentity
 
VecDou m_vecgau
 

Static Private Attributes

static const double k_precision
 

Detailed Description

template<typename M>
class CorrelatedNoisifier< M >

adds noise to the given frame.

Takes input correlation matrix C and from it creates an upper-triangular matrix H such that H*Htranspose = C.

Algorithm taken from http://cg.scs.carleton.ca/~luc/chapter_eleven.pdf, p 564-567 Uses a Cholesky decomposition

Any input array f is "noisified" with f += H*r where r is an array of random numbers

The above matrix multiplication is expedited in the trivial cases of a purely diagonal or identity correlation matrix.

Definition at line 11 of file EcalCoder.h.

Member Typedef Documentation

template<typename M >
typedef std::vector<double> CorrelatedNoisifier< M >::VecDou

Definition at line 35 of file CorrelatedNoisifier.h.

Constructor & Destructor Documentation

template<typename M >
CorrelatedNoisifier< M >::CorrelatedNoisifier ( const M &  symCorMat)
template<typename M >
CorrelatedNoisifier< M >::CorrelatedNoisifier ( int *  dummy,
const M &  cholDecMat 
)
template<typename M >
virtual CorrelatedNoisifier< M >::~CorrelatedNoisifier ( )
virtual

Member Function Documentation

template<typename M >
bool CorrelatedNoisifier< M >::checkDecomposition ( const M &  symCorMat,
M &  HHtDiff 
) const
private
template<typename M >
void CorrelatedNoisifier< M >::checkOffDiagonal ( const M &  symCorMat)
private
template<typename M >
const M& CorrelatedNoisifier< M >::cholMat ( ) const
template<typename M >
bool CorrelatedNoisifier< M >::computeDecomposition ( const M &  symCorMat)
private
template<typename M >
void CorrelatedNoisifier< M >::init ( const M &  symCorMat)
private
template<typename M >
void CorrelatedNoisifier< M >::initChol ( )
private
template<typename M >
template<class T >
template void CorrelatedNoisifier< M >::noisify ( T frame,
CLHEP::HepRandomEngine *  ,
const VecDou rangau = 0 
) const
template<typename M >
void CorrelatedNoisifier< M >::resetCholDecompMatrix ( const M &  cholMat)
template<typename M >
void CorrelatedNoisifier< M >::resetCorrelationMatrix ( const M &  symCorMat)
template<typename M >
const VecDou& CorrelatedNoisifier< M >::vecgau ( ) const

Member Data Documentation

template<typename M >
const double CorrelatedNoisifier< M >::k_precision
staticprivate

Definition at line 58 of file CorrelatedNoisifier.h.

template<typename M >
M CorrelatedNoisifier< M >::m_H
private

Definition at line 76 of file CorrelatedNoisifier.h.

template<typename M >
bool CorrelatedNoisifier< M >::m_isDiagonal
private

Definition at line 73 of file CorrelatedNoisifier.h.

template<typename M >
bool CorrelatedNoisifier< M >::m_isIdentity
private

Definition at line 74 of file CorrelatedNoisifier.h.

template<typename M >
VecDou CorrelatedNoisifier< M >::m_vecgau
mutableprivate

Definition at line 71 of file CorrelatedNoisifier.h.