Belle II Software development
ECLNoiseData Class Reference

Container for constant matrix used to generate electronic noise. More...

#include <ECLWaveformData.h>

Inheritance diagram for ECLNoiseData:

Public Member Functions

void setMatrixElement (size_t i, float value)
 Setter method for independent matrix element.
 
float getMatrixElement (size_t i) const
 Getter method for independent matrix element.
 
void getArray (float NoiseData[496]) const
 Getter method for matrix as one dimensional array.
 
void getMatrix (float M[31][31]) const
 Getter method for matrix as two dimensional array.
 
void generateCorrelatedNoise (const float z[31], float x[31]) const
 sampling a random vector x from the 31-dimensional multivariate normal distribution with covariance matrix C
 

Public Attributes

Float_t m_matrixElement [c_nElements]
 electronic noise matrix
 

Static Public Attributes

static const size_t c_nElements = 496
 number of independent elements
 

Detailed Description

Container for constant matrix used to generate electronic noise.

Definition at line 174 of file ECLWaveformData.h.

Member Function Documentation

◆ generateCorrelatedNoise()

void generateCorrelatedNoise ( const float  z[31],
float  x[31] 
) const
inline

sampling a random vector x from the 31-dimensional multivariate normal distribution with covariance matrix C

Definition at line 208 of file ECLWaveformData.h.

209 {
210 // z = (z0, ..., z30) is a inpute vector whose components are 31 independent standard normal variates
211 // the output vector x is x0 + A*z, where x0 is 0 at the moment
212 // A*A^T = C where C is a positive definite covariance matrix, A is a lower triangular matrix
213 const float* A = m_matrixElement;
214 for (int i = 0; i < 31; i++) {
215 float sum = 0;
216 for (int j = 0; j <= i; j++) sum += z[j] * (*A++);
217 x[i] = sum;
218 }
219 }
Float_t m_matrixElement[c_nElements]
electronic noise matrix

◆ getArray()

void getArray ( float  NoiseData[496]) const
inline

Getter method for matrix as one dimensional array.

Definition at line 190 of file ECLWaveformData.h.

190{for (int i = 0; i < 496; i++) { NoiseData[i] = (float) m_matrixElement[i];} }

◆ getMatrix()

void getMatrix ( float  M[31][31]) const
inline

Getter method for matrix as two dimensional array.

Definition at line 193 of file ECLWaveformData.h.

194 {
195 const float* A = m_matrixElement;
196 for (int i = 0; i < 31; i++) {
197 for (int j = 0; j < 31; j++) {
198 if (j > i) { // fill only the lower triangle
199 M[i][j] = 0.f;
200 } else {
201 M[i][j] = *A++;
202 }
203 }
204 }
205 }

◆ getMatrixElement()

float getMatrixElement ( size_t  i) const
inline

Getter method for independent matrix element.

Definition at line 183 of file ECLWaveformData.h.

184 {
185 assert(i < c_nElements);
186 return m_matrixElement[i];
187 }
static const size_t c_nElements
number of independent elements

◆ setMatrixElement()

void setMatrixElement ( size_t  i,
float  value 
)
inline

Setter method for independent matrix element.

Definition at line 177 of file ECLWaveformData.h.

178 {
179 assert(i < c_nElements);
180 m_matrixElement[i] = value;
181 }

Member Data Documentation

◆ c_nElements

const size_t c_nElements = 496
static

number of independent elements

Definition at line 221 of file ECLWaveformData.h.

◆ m_matrixElement

Float_t m_matrixElement[c_nElements]

electronic noise matrix

Definition at line 223 of file ECLWaveformData.h.


The documentation for this class was generated from the following file: