Belle II Software development
TOPCalChannelThresholdEff Class Reference

Class to store the threshold efficiency (i.e. More...

#include <TOPCalChannelThresholdEff.h>

Inheritance diagram for TOPCalChannelThresholdEff:

Public Types

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

Public Member Functions

 TOPCalChannelThresholdEff ()
 Default constructor.
 
void setThrEff (int moduleID, unsigned channel, float ThrEff, short offlineThreshold)
 Sets the threshold efficiency and correspolding threshold for a single channel and switches status to calibrated (efficiency definition : ratio of integral of fit function over a range [threshold, +inf] to integral over the full range [0, +inf])
 
void setUnusable (int moduleID, unsigned channel)
 Switches calibration status to unusable to flag badly calibrated constant.
 
float getThrEff (int moduleID, unsigned channel) const
 Returns the threshold efficiency of a single channel (1.0 if status is c_Default)
 
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.
 
short getOfflineThreshold (int moduleID, unsigned channel) const
 Returns the threshold value used for efficiency evaluation.
 

Private Types

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

Private Member Functions

 ClassDef (TOPCalChannelThresholdEff, 3)
 ClassDef.
 

Private Attributes

float m_ThrEff [c_numModules][c_numChannels] = {{0}}
 threshold efficiency value.
 
EStatus m_status [c_numModules][c_numChannels] = {{c_Default}}
 calibration status
 
short m_offlineThreshold [c_numModules][c_numChannels] = {{0}}
 threshold value used for efficiency evaluation
 

Detailed Description

Class to store the threshold efficiency (i.e.

the efficiency for the pulse identification, function of the threshold being used in the CFD or template fit algorithm ) for all 512 channels of 16 modules. From laser scans.

Definition at line 26 of file TOPCalChannelThresholdEff.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 175 of file TOPCalChannelThresholdEff.h.

175 {c_numModules = 16,
176 c_numChannels = 512
177 };
@ 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 32 of file TOPCalChannelThresholdEff.h.

32 {
33 c_Default = 0,
34 c_Calibrated = 1,
35 c_Unusable = 2
36 };

Constructor & Destructor Documentation

◆ TOPCalChannelThresholdEff()

Default constructor.

Threshold efficiencies are set to 0 by default.

Definition at line 42 of file TOPCalChannelThresholdEff.h.

42{}

Member Function Documentation

◆ getOfflineThreshold()

short getOfflineThreshold ( int  moduleID,
unsigned  channel 
) const
inline

Returns the threshold value used for efficiency evaluation.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
Returns
offlineThreshold (in a unit of ADC counts)

Definition at line 156 of file TOPCalChannelThresholdEff.h.

157 {
158 unsigned module = moduleID - 1;
159 if (module >= c_numModules) {
160 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
161 return 0;
162 }
163 if (channel >= c_numChannels) {
164 B2WARNING("Invalid channel number, returning 0 (" << ClassName() << ")");
165 return 0;
166 }
167 return m_offlineThreshold[module][channel];
168 }
short m_offlineThreshold[c_numModules][c_numChannels]
threshold value used for efficiency evaluation

◆ getThrEff()

float getThrEff ( int  moduleID,
unsigned  channel 
) const
inline

Returns the threshold efficiency of a single channel (1.0 if status is c_Default)

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

Definition at line 93 of file TOPCalChannelThresholdEff.h.

94 {
95 unsigned module = moduleID - 1;
96 if (module >= c_numModules) {
97 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
98 return 0;
99 }
100 if (channel >= c_numChannels) {
101 B2WARNING("Invalid channel number, returning 0 (" << ClassName() << ")");
102 return 0;
103 }
104 if (m_status[module][channel] == c_Default) return 1.0;
105 return m_ThrEff[module][channel];
106 }
float m_ThrEff[c_numModules][c_numChannels]
threshold efficiency value.
EStatus m_status[c_numModules][c_numChannels]
calibration status

◆ 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 114 of file TOPCalChannelThresholdEff.h.

115 {
116 unsigned module = moduleID - 1;
117 if (module >= c_numModules) return false;
118 if (channel >= c_numChannels) return false;
119 return m_status[module][channel] == c_Calibrated;
120 }

◆ 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 128 of file TOPCalChannelThresholdEff.h.

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

◆ 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 142 of file TOPCalChannelThresholdEff.h.

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

◆ setThrEff()

void setThrEff ( int  moduleID,
unsigned  channel,
float  ThrEff,
short  offlineThreshold 
)
inline

Sets the threshold efficiency and correspolding threshold for a single channel and switches status to calibrated (efficiency definition : ratio of integral of fit function over a range [threshold, +inf] to integral over the full range [0, +inf])

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
ThrEffchannel threshold efficiency
offlineThresholdthreshold ADC counts used in efficiency evaluation

Definition at line 52 of file TOPCalChannelThresholdEff.h.

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

◆ 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 73 of file TOPCalChannelThresholdEff.h.

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

Member Data Documentation

◆ m_offlineThreshold

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

threshold value used for efficiency evaluation

Definition at line 182 of file TOPCalChannelThresholdEff.h.

◆ m_status

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

calibration status

Definition at line 181 of file TOPCalChannelThresholdEff.h.

◆ m_ThrEff

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

threshold efficiency value.

0 by default.

Definition at line 180 of file TOPCalChannelThresholdEff.h.


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