CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CorrelatedNoisifier.h
Go to the documentation of this file.
1 #ifndef SimAlgos_CorrelatedNoisifier_h
2 #define SimAlgos_CorrelatedNoisifier_h
3 
23 #include "CLHEP/Random/RandGaussQ.h"
25 #include<vector>
26 
27 template<class M>
29 {
30  public:
31 
32  typedef std::vector<double> VecDou ;
33 
34  CorrelatedNoisifier( const M& symCorMat , //correlation matrix
35  CLHEP::HepRandomEngine* engine = 0 ) ;
36 
37  CorrelatedNoisifier( CLHEP::HepRandomEngine* engine ,
38  const M& cholDecMat ) ; //decomposition matrix
39 
40  virtual ~CorrelatedNoisifier() ;
41 
42  void resetCorrelationMatrix( const M& symCorMat ) ;
43 
44  void resetCholDecompMatrix( const M& cholMat ) ;
45 
46  template<class T>
47  void noisify( T& frame , // applies random noise to frame
48  const VecDou* rangau = 0 ) const ; // use these
49 
50  const M& cholMat() const ; // return decomposition
51 
52  const VecDou& vecgau() const ;
53 
54  private:
55 
56  static const double k_precision ; // precision to which 0 & 1 are compared
57 
58  void init( const M& symCorMat ) ;
59 
60  void initChol() ;
61 
62  bool computeDecomposition( const M& symCorMat ) ;
63 
64  bool checkDecomposition( const M& symCorMat ,
65  M& HHtDiff ) const ;
66 
67  void checkOffDiagonal( const M& symCorMat ) ;
68 
69  mutable VecDou m_vecgau ;
70 
71  CLHEP::RandGaussQ* m_rangau ;
72 
73  bool m_isDiagonal ;
74  bool m_isIdentity ;
75 
76  M m_H ;
77 };
78 
79 
80 #endif
adds noise to the given frame.
Definition: EcalCoder.h:11
bool computeDecomposition(const M &symCorMat)
const M & cholMat() const
void init(const M &symCorMat)
void checkOffDiagonal(const M &symCorMat)
virtual ~CorrelatedNoisifier()
void resetCholDecompMatrix(const M &cholMat)
static const double k_precision
CorrelatedNoisifier(const M &symCorMat, CLHEP::HepRandomEngine *engine=0)
bool checkDecomposition(const M &symCorMat, M &HHtDiff) const
const VecDou & vecgau() const
void noisify(T &frame, const VecDou *rangau=0) const
CLHEP::RandGaussQ * m_rangau
void resetCorrelationMatrix(const M &symCorMat)
long double T
std::vector< double > VecDou