CMS 3D CMS Logo

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=nullptr) 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<class 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 12 of file EcalCoder.h.

Member Typedef Documentation

◆ VecDou

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

Definition at line 33 of file CorrelatedNoisifier.h.

Constructor & Destructor Documentation

◆ CorrelatedNoisifier() [1/2]

template<class M >
CorrelatedNoisifier< M >::CorrelatedNoisifier ( const M &  symCorMat)

◆ CorrelatedNoisifier() [2/2]

template<class M >
CorrelatedNoisifier< M >::CorrelatedNoisifier ( int *  dummy,
const M &  cholDecMat 
)

◆ ~CorrelatedNoisifier()

template<class M >
virtual CorrelatedNoisifier< M >::~CorrelatedNoisifier ( )
virtual

Member Function Documentation

◆ checkDecomposition()

template<class M >
bool CorrelatedNoisifier< M >::checkDecomposition ( const M &  symCorMat,
M &  HHtDiff 
) const
private

◆ checkOffDiagonal()

template<class M >
void CorrelatedNoisifier< M >::checkOffDiagonal ( const M &  symCorMat)
private

◆ cholMat()

template<class M >
const M& CorrelatedNoisifier< M >::cholMat ( ) const

◆ computeDecomposition()

template<class M >
bool CorrelatedNoisifier< M >::computeDecomposition ( const M &  symCorMat)
private

◆ init()

template<class M >
void CorrelatedNoisifier< M >::init ( const M &  symCorMat)
private

◆ initChol()

template<class M >
void CorrelatedNoisifier< M >::initChol ( )
private

◆ noisify()

template<class M >
template<class T >
template void CorrelatedNoisifier< M >::noisify ( T frame,
CLHEP::HepRandomEngine *  ,
const VecDou rangau = nullptr 
) const

◆ resetCholDecompMatrix()

template<class M >
void CorrelatedNoisifier< M >::resetCholDecompMatrix ( const M &  cholMat)

◆ resetCorrelationMatrix()

template<class M >
void CorrelatedNoisifier< M >::resetCorrelationMatrix ( const M &  symCorMat)

◆ vecgau()

template<class M >
const VecDou& CorrelatedNoisifier< M >::vecgau ( ) const

Member Data Documentation

◆ k_precision

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

Definition at line 55 of file CorrelatedNoisifier.h.

◆ m_H

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

Definition at line 72 of file CorrelatedNoisifier.h.

◆ m_isDiagonal

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

Definition at line 69 of file CorrelatedNoisifier.h.

◆ m_isIdentity

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

Definition at line 70 of file CorrelatedNoisifier.h.

◆ m_vecgau

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

Definition at line 67 of file CorrelatedNoisifier.h.