adds noise to the given frame. More...
#include <CorrelatedNoisifier.h>
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 VecDou & | vecgau () 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 | m_H |
bool | m_isDiagonal |
bool | m_isIdentity |
CLHEP::RandGaussQ * | m_rangau |
VecDou | m_vecgau |
Static Private Attributes | |
static const double | k_precision |
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.
typedef std::vector<double> CorrelatedNoisifier< M >::VecDou |
Definition at line 32 of file CorrelatedNoisifier.h.
CorrelatedNoisifier< M >::CorrelatedNoisifier | ( | const M & | symCorMat, |
CLHEP::HepRandomEngine * | engine = 0 |
||
) |
CorrelatedNoisifier< M >::CorrelatedNoisifier | ( | CLHEP::HepRandomEngine * | engine, |
const M & | cholDecMat | ||
) |
virtual CorrelatedNoisifier< M >::~CorrelatedNoisifier | ( | ) | [virtual] |
bool CorrelatedNoisifier< M >::checkDecomposition | ( | const M & | symCorMat, |
M & | HHtDiff | ||
) | const [private] |
void CorrelatedNoisifier< M >::checkOffDiagonal | ( | const M & | symCorMat | ) | [private] |
const M& CorrelatedNoisifier< M >::cholMat | ( | ) | const |
bool CorrelatedNoisifier< M >::computeDecomposition | ( | const M & | symCorMat | ) | [private] |
void CorrelatedNoisifier< M >::init | ( | const M & | symCorMat | ) | [private] |
void CorrelatedNoisifier< M >::initChol | ( | ) | [private] |
void CorrelatedNoisifier< M >::noisify | ( | T & | frame, |
const VecDou * | rangau = 0 |
||
) | const |
Referenced by EcalCoder::encode(), and CSCStripConditions::noisify().
void CorrelatedNoisifier< M >::resetCholDecompMatrix | ( | const M & | cholMat | ) |
void CorrelatedNoisifier< M >::resetCorrelationMatrix | ( | const M & | symCorMat | ) |
const VecDou& CorrelatedNoisifier< M >::vecgau | ( | ) | const |
const double CorrelatedNoisifier< M >::k_precision [static, private] |
Definition at line 56 of file CorrelatedNoisifier.h.
M CorrelatedNoisifier< M >::m_H [private] |
Definition at line 76 of file CorrelatedNoisifier.h.
bool CorrelatedNoisifier< M >::m_isDiagonal [private] |
Definition at line 73 of file CorrelatedNoisifier.h.
bool CorrelatedNoisifier< M >::m_isIdentity [private] |
Definition at line 74 of file CorrelatedNoisifier.h.
CLHEP::RandGaussQ* CorrelatedNoisifier< M >::m_rangau [private] |
Definition at line 71 of file CorrelatedNoisifier.h.
VecDou CorrelatedNoisifier< M >::m_vecgau [mutable, private] |
Definition at line 69 of file CorrelatedNoisifier.h.