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 
24 #include<vector>
25 
26 namespace CLHEP {
27  class HepRandomEngine;
28 }
29 
30 template<class M>
32 {
33  public:
34 
35  typedef std::vector<double> VecDou ;
36 
37  CorrelatedNoisifier( const M& symCorMat ); //correlation matrix
38 
39  CorrelatedNoisifier( int* dummy, const M& cholDecMat ); //decomposition matrix
40 
41  virtual ~CorrelatedNoisifier() ;
42 
43  void resetCorrelationMatrix( const M& symCorMat ) ;
44 
45  void resetCholDecompMatrix( const M& cholMat ) ;
46 
47  template<class T>
48  void noisify( T& frame , // applies random noise to frame
49  CLHEP::HepRandomEngine*,
50  const VecDou* rangau = 0 ) const ; // use these
51 
52  const M& cholMat() const ; // return decomposition
53 
54  const VecDou& vecgau() const ;
55 
56  private:
57 
58  static const double k_precision ; // precision to which 0 & 1 are compared
59 
60  void init( const M& symCorMat ) ;
61 
62  void initChol() ;
63 
64  bool computeDecomposition( const M& symCorMat ) ;
65 
66  bool checkDecomposition( const M& symCorMat ,
67  M& HHtDiff ) const ;
68 
69  void checkOffDiagonal( const M& symCorMat ) ;
70 
71  mutable VecDou m_vecgau ;
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 noisify(T &frame, CLHEP::HepRandomEngine *, const VecDou *rangau=0) const
void init(const M &symCorMat)
CorrelatedNoisifier(const M &symCorMat)
void checkOffDiagonal(const M &symCorMat)
virtual ~CorrelatedNoisifier()
void resetCholDecompMatrix(const M &cholMat)
static const double k_precision
bool checkDecomposition(const M &symCorMat, M &HHtDiff) const
const VecDou & vecgau() const
void resetCorrelationMatrix(const M &symCorMat)
long double T
std::vector< double > VecDou