Belle II Software development
TOPCalChannelThreshold Class Reference

Value of the threshold (in ADC counts) used for the pulse identification, for all 512 channels of 16 modules. More...

#include <TOPCalChannelThreshold.h>

Inheritance diagram for TOPCalChannelThreshold:

Public Types

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

Public Member Functions

 TOPCalChannelThreshold ()
 Default constructor.
 
void setThr (int moduleID, unsigned channel, short Thr)
 Sets the threshold (in ADC counts) 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.
 
short getThr (int moduleID, unsigned channel) const
 Returns the threshold (in ADC counts) of a single channel.
 
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 (TOPCalChannelThreshold, 2)
 ClassDef.
 

Private Attributes

short m_Thr [c_numModules][c_numChannels] = {{0}}
 threshold value in ADC counts.
 
EStatus m_status [c_numModules][c_numChannels] = {{c_Default}}
 calibration status
 

Detailed Description

Value of the threshold (in ADC counts) used for the pulse identification, for all 512 channels of 16 modules.

From laser scans.

Definition at line 25 of file TOPCalChannelThreshold.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 149 of file TOPCalChannelThreshold.h.

149 {c_numModules = 16,
150 c_numChannels = 512
151 };
@ c_numChannels
number of channels per module

◆ 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 31 of file TOPCalChannelThreshold.h.

31 {
32 c_Default = 0,
33 c_Calibrated = 1,
34 c_Unusable = 2
35 };
@ c_Default
uncalibrated default value

Constructor & Destructor Documentation

◆ TOPCalChannelThreshold()

Default constructor.

Definition at line 40 of file TOPCalChannelThreshold.h.

40{}

Member Function Documentation

◆ getThr()

short getThr ( int  moduleID,
unsigned  channel 
) const
inline

Returns the threshold (in ADC counts) of a single channel.

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

Definition at line 88 of file TOPCalChannelThreshold.h.

89 {
90 unsigned module = moduleID - 1;
91 if (module >= c_numModules) {
92 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
93 return 0;
94 }
95 if (channel >= c_numChannels) {
96 B2WARNING("Invalid channel number, returning 0 (" << ClassName() << ")");
97 return 0;
98 }
99 return m_Thr[module][channel];
100 }
short m_Thr[c_numModules][c_numChannels]
threshold value in 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 108 of file TOPCalChannelThreshold.h.

109 {
110 unsigned module = moduleID - 1;
111 if (module >= c_numModules) return false;
112 if (channel >= c_numChannels) return false;
113 return m_status[module][channel] == c_Calibrated;
114 }
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 122 of file TOPCalChannelThreshold.h.

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

◆ 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 136 of file TOPCalChannelThreshold.h.

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

◆ setThr()

void setThr ( int  moduleID,
unsigned  channel,
short  Thr 
)
inline

Sets the threshold (in ADC counts) for a single channel and switches status to calibrated.

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

Definition at line 48 of file TOPCalChannelThreshold.h.

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

◆ 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 68 of file TOPCalChannelThreshold.h.

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

Member Data Documentation

◆ m_status

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

calibration status

Definition at line 154 of file TOPCalChannelThreshold.h.

◆ m_Thr

short m_Thr[c_numModules][c_numChannels] = {{0}}
private

threshold value in ADC counts.

0 by default

Definition at line 153 of file TOPCalChannelThreshold.h.


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