CMS 3D CMS Logo

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 <CorrelatedNoisifier.h>

List of all members.

Public Types

typedef std::vector< double > VecDou

Public Member Functions

const M & cholMat () const
 CorrelatedNoisifier (CLHEP::HepRandomEngine *engine, const M &cholDecMat)
 CorrelatedNoisifier (const M &symCorMat, CLHEP::HepRandomEngine *engine=0)
template<class T >
void noisify (T &frame, 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
CLHEP::RandGaussQ * m_rangau
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 https://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 28 of file CorrelatedNoisifier.h.


Member Typedef Documentation

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

Definition at line 32 of file CorrelatedNoisifier.h.


Constructor & Destructor Documentation

template<class M>
CorrelatedNoisifier< M >::CorrelatedNoisifier ( const M &  symCorMat,
CLHEP::HepRandomEngine *  engine = 0 
)
template<class M>
CorrelatedNoisifier< M >::CorrelatedNoisifier ( CLHEP::HepRandomEngine *  engine,
const M &  cholDecMat 
)
template<class M>
virtual CorrelatedNoisifier< M >::~CorrelatedNoisifier ( ) [virtual]

Member Function Documentation

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

Member Data Documentation

template<class M>
const double CorrelatedNoisifier< M >::k_precision [static, private]

Definition at line 56 of file CorrelatedNoisifier.h.

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

Definition at line 76 of file CorrelatedNoisifier.h.

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

Definition at line 73 of file CorrelatedNoisifier.h.

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

Definition at line 74 of file CorrelatedNoisifier.h.

template<class M>
CLHEP::RandGaussQ* CorrelatedNoisifier< M >::m_rangau [private]

Definition at line 71 of file CorrelatedNoisifier.h.

template<class M>
VecDou CorrelatedNoisifier< M >::m_vecgau [mutable, private]

Definition at line 69 of file CorrelatedNoisifier.h.