Belle II Software development
TOPCalChannelNoise Class Reference

r.m.s. More...

#include <TOPCalChannelNoise.h>

Inheritance diagram for TOPCalChannelNoise:

Public Types

enum  EStatus {
  c_Default = 0 ,
  c_Calibrated = 1 ,
  c_Unusable = 2
}
 Calibration status of a constant. More...
 

Public Member Functions

 TOPCalChannelNoise ()
 Default constructor.
 
void setNoise (int moduleID, unsigned channel, double rmsNoise)
 Sets the noise r.m.s for a single channel and switches status to calibrated.
 
void setUnusable (int moduleID, unsigned channel)
 Switches calibration status to unusable to flag badly calibrated constant.
 
double getNoise (int moduleID, unsigned channel) const
 Returns the noise r.m.s of a single channel (0 or negative: data not available)
 
bool isCalibrated (int moduleID, unsigned channel) const
 Returns calibration status.
 
bool isDefault (int moduleID, unsigned channel) const
 Returns calibration status.
 
bool isUnusable (int moduleID, unsigned channel) const
 Returns calibration status.
 

Private Types

enum  {
  c_numModules = 16 ,
  c_numChannels = 512
}
 Sizes. More...
 

Private Member Functions

 ClassDef (TOPCalChannelNoise, 2)
 ClassDef.
 

Private Attributes

float m_rmsNoise [c_numModules][c_numChannels] = {{0}}
 noise [ADC counts]
 
EStatus m_status [c_numModules][c_numChannels] = {{c_Default}}
 calibration status
 

Detailed Description

r.m.s.

of noise for all 512 channels of 16 modules.

The noise for masked channels is undefined. It is the caller's responsibility to check for masked channels

Definition at line 26 of file TOPCalChannelNoise.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

Sizes.

Enumerator
c_numModules 

number of modules

c_numChannels 

number of channels per module

Definition at line 152 of file TOPCalChannelNoise.h.

152 {
153 c_numModules = 16,
154 c_numChannels = 512
155 };
@ c_numChannels
number of channels per module
@ c_numModules
number of modules

◆ EStatus

enum EStatus

Calibration status of a constant.

Enumerator
c_Default 

uncalibrated default value

c_Calibrated 

good calibrated value

c_Unusable 

bad calibrated value

Definition at line 32 of file TOPCalChannelNoise.h.

32 {
33 c_Default = 0,
34 c_Calibrated = 1,
35 c_Unusable = 2
36 };
@ c_Calibrated
good calibrated value
@ c_Unusable
bad calibrated value
@ c_Default
uncalibrated default value

Constructor & Destructor Documentation

◆ TOPCalChannelNoise()

TOPCalChannelNoise ( )
inline

Default constructor.

Noises are set to 0 by default.

Definition at line 42 of file TOPCalChannelNoise.h.

42{}

Member Function Documentation

◆ getNoise()

double getNoise ( int  moduleID,
unsigned  channel 
) const
inline

Returns the noise r.m.s of a single channel (0 or negative: data not available)

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
Returns
r.m.s. of noise [ADC counts]

Definition at line 91 of file TOPCalChannelNoise.h.

92 {
93 unsigned module = moduleID - 1;
94 if (module >= c_numModules) {
95 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
96 return 0;
97 }
98 if (channel >= c_numChannels) {
99 B2WARNING("Invalid channel number, returning 0 (" << ClassName() << ")");
100 return 0;
101 }
102 return m_rmsNoise[module][channel];
103 }
float m_rmsNoise[c_numModules][c_numChannels]
noise [ADC counts]

◆ isCalibrated()

bool isCalibrated ( int  moduleID,
unsigned  channel 
) const
inline

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
Returns
true, if good calibrated

Definition at line 111 of file TOPCalChannelNoise.h.

112 {
113 unsigned module = moduleID - 1;
114 if (module >= c_numModules) return false;
115 if (channel >= c_numChannels) return false;
116 return m_status[module][channel] == c_Calibrated;
117 }
EStatus m_status[c_numModules][c_numChannels]
calibration status

◆ isDefault()

bool isDefault ( int  moduleID,
unsigned  channel 
) const
inline

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
Returns
true, if default (not calibrated)

Definition at line 125 of file TOPCalChannelNoise.h.

126 {
127 unsigned module = moduleID - 1;
128 if (module >= c_numModules) return false;
129 if (channel >= c_numChannels) return false;
130 return m_status[module][channel] == c_Default;
131 }

◆ isUnusable()

bool isUnusable ( int  moduleID,
unsigned  channel 
) const
inline

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
Returns
true, if bad calibrated

Definition at line 139 of file TOPCalChannelNoise.h.

140 {
141 unsigned module = moduleID - 1;
142 if (module >= c_numModules) return false;
143 if (channel >= c_numChannels) return false;
144 return m_status[module][channel] == c_Unusable;
145 }

◆ setNoise()

void setNoise ( int  moduleID,
unsigned  channel,
double  rmsNoise 
)
inline

Sets the noise r.m.s for a single channel and switches status to calibrated.

If data for a given channel not available set noise to 0 (or just skip the call)

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
rmsNoiser.m.s. of noise [ADC counts]

Definition at line 51 of file TOPCalChannelNoise.h.

52 {
53 unsigned module = moduleID - 1;
54 if (module >= c_numModules) {
55 B2ERROR("Invalid module number, constant not set (" << ClassName() << ")");
56 return;
57 }
58 if (channel >= c_numChannels) {
59 B2ERROR("Invalid channel number, constant not set (" << ClassName() << ")");
60 return;
61 }
62 m_rmsNoise[module][channel] = rmsNoise;
63 m_status[module][channel] = c_Calibrated;
64 }

◆ setUnusable()

void setUnusable ( int  moduleID,
unsigned  channel 
)
inline

Switches calibration status to unusable to flag badly calibrated constant.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)

Definition at line 71 of file TOPCalChannelNoise.h.

72 {
73 unsigned module = moduleID - 1;
74 if (module >= c_numModules) {
75 B2ERROR("Invalid module number, status not set (" << ClassName() << ")");
76 return;
77 }
78 if (channel >= c_numChannels) {
79 B2ERROR("Invalid channel number, status not set (" << ClassName() << ")");
80 return;
81 }
82 m_status[module][channel] = c_Unusable;
83 }

Member Data Documentation

◆ m_rmsNoise

float m_rmsNoise[c_numModules][c_numChannels] = {{0}}
private

noise [ADC counts]

Definition at line 157 of file TOPCalChannelNoise.h.

◆ m_status

EStatus m_status[c_numModules][c_numChannels] = {{c_Default}}
private

calibration status

Definition at line 158 of file TOPCalChannelNoise.h.


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