Belle II Software development
ECLWaveformData Class Reference

ECLWaveformData - container for inverse covariant matrix and shape parameters for time and amplitude fit of ecl crystal waveform. More...

#include <ECLWaveformData.h>

Inheritance diagram for ECLWaveformData:

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.
 
float getMatrixElement (size_t i, size_t j) const
 Getter method for independent matrix element.
 
void getArray (float WF[136]) const
 Getter method for all matrix as one dimensional array.
 
void getMatrix (float M[16][16]) const
 Getter method for all matrix as two dimensional array (floats)
 
void getMatrix (double M[16][16]) const
 Getter method for all matrix as two dimensional array (doubles)
 
void storeMatrix (const std::array< std::array< float, 16 >, 16 > &M)
 Setter for matrix from std::array of floats.
 
void storeMatrix (const std::array< std::array< double, 16 >, 16 > &M)
 Setter for matrix from std::array of doubles.
 
void setWaveformPar (size_t i, float value)
 Setter method for waveform shape parameter.
 
float getWaveformPar (size_t i) const
 Getter method for waveform shape parameter.
 
void getWaveformParArray (float P[10]) const
 Getter method for waveform shape parameters as one dimensional array of floats.
 
void getWaveformParArray (double P[10]) const
 Getter method for waveform shape parameters as one dimensional array of doubles.
 
void print () const
 print-out function for debugging purpose
 

Static Public Attributes

static const size_t c_nElements = 136
 number of independent matrix elements
 
static const size_t c_nParams = 10
 number of parameters defining the waveform shape
 

Private Member Functions

 ClassDef (ECLWaveformData, 1)
 ClassDef.
 

Private Attributes

Float_t m_matrixElement [c_nElements]
 the matrix elements
 
Float_t m_waveformPar [c_nParams]
 the waveform parameters
 

Detailed Description

ECLWaveformData - container for inverse covariant matrix and shape parameters for time and amplitude fit of ecl crystal waveform.

Objects of this class keep the independent matrix elements of the inverse covariant matrix to perform waveform fit and the parameters defining the waveform shape.

Definition at line 35 of file ECLWaveformData.h.

Member Function Documentation

◆ getArray()

void getArray ( float  WF[136]) const
inline

Getter method for all matrix as one dimensional array.

Definition at line 59 of file ECLWaveformData.h.

59{for (int i = 0; i < 136; i++) { WF[i] = (float) m_matrixElement[i];} }
Float_t m_matrixElement[c_nElements]
the matrix elements

◆ getMatrix() [1/2]

void getMatrix ( double  M[16][16]) const
inline

Getter method for all matrix as two dimensional array (doubles)

Definition at line 72 of file ECLWaveformData.h.

73 {
74 const float* A = m_matrixElement;
75 for (int i = 0; i < 16; i++) {
76 for (int j = 0; j < i; j++) M[i][j] = M[j][i] = *A++;
77 M[i][i] = *A++;
78 }
79 }

◆ getMatrix() [2/2]

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

Getter method for all matrix as two dimensional array (floats)

Definition at line 62 of file ECLWaveformData.h.

63 {
64 const float* A = m_matrixElement;
65 for (int i = 0; i < 16; i++) {
66 for (int j = 0; j < i; j++) M[i][j] = M[j][i] = *A++;
67 M[i][i] = *A++;
68 }
69 }

◆ getMatrixElement() [1/2]

float getMatrixElement ( size_t  i) const
inline

Getter method for independent matrix element.

Definition at line 45 of file ECLWaveformData.h.

46 {
47 assert(i < c_nElements);
48 return m_matrixElement[i];
49 }
static const size_t c_nElements
number of independent matrix elements

◆ getMatrixElement() [2/2]

float getMatrixElement ( size_t  i,
size_t  j 
) const
inline

Getter method for independent matrix element.

Definition at line 52 of file ECLWaveformData.h.

53 {
54 if (i < j) std::swap(i, j);
55 return m_matrixElement[ i * (i + 1) / 2 + j];
56 }

◆ getWaveformPar()

float getWaveformPar ( size_t  i) const
inline

Getter method for waveform shape parameter.

Definition at line 110 of file ECLWaveformData.h.

111 {
112 assert(i < c_nParams);
113 return m_waveformPar[i];
114 }
static const size_t c_nParams
number of parameters defining the waveform shape
Float_t m_waveformPar[c_nParams]
the waveform parameters

◆ getWaveformParArray() [1/2]

void getWaveformParArray ( double  P[10]) const
inline

Getter method for waveform shape parameters as one dimensional array of doubles.

Definition at line 126 of file ECLWaveformData.h.

127 {
128 for (int i = 0; i < 10; i++)
129 P[i] = m_waveformPar[i];
130 }

◆ getWaveformParArray() [2/2]

void getWaveformParArray ( float  P[10]) const
inline

Getter method for waveform shape parameters as one dimensional array of floats.

Definition at line 118 of file ECLWaveformData.h.

119 {
120 for (int i = 0; i < 10; i++)
121 P[i] = (float) m_waveformPar[i];
122 }

◆ print()

void print ( ) const

print-out function for debugging purpose

Definition at line 21 of file ECLWaveformData.cc.

22{
23 string line;
24 for (size_t i = 0; i < c_nElements; ++ i) {
25 line += to_string(m_matrixElement[i]);
26 line += ' ';
27 }
28 B2INFO(line);
29}

◆ setMatrixElement()

void setMatrixElement ( size_t  i,
float  value 
)
inline

Setter method for independent matrix element.

Definition at line 39 of file ECLWaveformData.h.

40 {
41 assert(i < c_nElements);
42 m_matrixElement[i] = value;
43 }

◆ setWaveformPar()

void setWaveformPar ( size_t  i,
float  value 
)
inline

Setter method for waveform shape parameter.

Definition at line 102 of file ECLWaveformData.h.

103 {
104 assert(i < c_nParams);
105 m_waveformPar[i] = value;
106 }

◆ storeMatrix() [1/2]

void storeMatrix ( const std::array< std::array< double, 16 >, 16 > &  M)
inline

Setter for matrix from std::array of doubles.

Definition at line 92 of file ECLWaveformData.h.

93 {
94 float* A = m_matrixElement;
95 for (int i = 0; i < 16; i++) {
96 for (int j = 0; j < i; j++) *A++ = static_cast<float>(M[i][j]);
97 *A++ = M[i][i];
98 }
99 }

◆ storeMatrix() [2/2]

void storeMatrix ( const std::array< std::array< float, 16 >, 16 > &  M)
inline

Setter for matrix from std::array of floats.

Definition at line 82 of file ECLWaveformData.h.

83 {
84 float* A = m_matrixElement;
85 for (int i = 0; i < 16; i++) {
86 for (int j = 0; j < i; j++) *A++ = M[i][j];
87 *A++ = M[i][i];
88 }
89 }

Member Data Documentation

◆ c_nElements

const size_t c_nElements = 136
static

number of independent matrix elements

Definition at line 135 of file ECLWaveformData.h.

◆ c_nParams

const size_t c_nParams = 10
static

number of parameters defining the waveform shape

Definition at line 136 of file ECLWaveformData.h.

◆ m_matrixElement

Float_t m_matrixElement[c_nElements]
private

the matrix elements

Definition at line 138 of file ECLWaveformData.h.

◆ m_waveformPar

Float_t m_waveformPar[c_nParams]
private

the waveform parameters

Definition at line 139 of file ECLWaveformData.h.


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