9 #include <top/dbobjects/TOPCalAsicShift.h>
10 #include <framework/logging/Logger.h>
20 void TOPCalAsicShift::setT0(
int moduleID,
unsigned asic,
double T0)
22 unsigned module = moduleID - 1;
23 if (module >= c_numModules) {
24 B2ERROR(
"Invalid module number, constant not set (" << ClassName() <<
")");
27 if (asic >= c_numAsics) {
28 B2ERROR(
"Invalid asic number, constant not set (" << ClassName() <<
")");
31 m_T0[module][asic] = T0;
32 m_status[module][asic] = c_Calibrated;
36 void TOPCalAsicShift::setUnusable(
int moduleID,
unsigned asic)
38 unsigned module = moduleID - 1;
39 if (module >= c_numModules) {
40 B2ERROR(
"Invalid module number, status not set (" << ClassName() <<
")");
43 if (asic >= c_numAsics) {
44 B2ERROR(
"Invalid asic number, status not set (" << ClassName() <<
")");
47 m_status[module][asic] = c_Unusable;
51 double TOPCalAsicShift::getT0(
int moduleID,
unsigned asic)
const
53 unsigned module = moduleID - 1;
54 if (module >= c_numModules) {
55 B2WARNING(
"Invalid module number, returning 0 (" << ClassName() <<
")");
58 if (asic >= c_numAsics) {
59 B2WARNING(
"Invalid asic number, returning 0 (" << ClassName() <<
")");
62 return m_T0[module][asic];
66 bool TOPCalAsicShift::isCalibrated(
int moduleID,
unsigned asic)
const
68 unsigned module = moduleID - 1;
69 if (module >= c_numModules)
return false;
70 if (asic >= c_numAsics)
return false;
71 return m_status[module][asic] == c_Calibrated;
75 bool TOPCalAsicShift::isDefault(
int moduleID,
unsigned asic)
const
77 unsigned module = moduleID - 1;
78 if (module >= c_numModules)
return false;
79 if (asic >= c_numAsics)
return false;
80 return m_status[module][asic] == c_Default;
84 bool TOPCalAsicShift::isUnusable(
int moduleID,
unsigned asic)
const
86 unsigned module = moduleID - 1;
87 if (module >= c_numModules)
return false;
88 if (asic >= c_numAsics)
return false;
89 return m_status[module][asic] == c_Unusable;
Abstract base class for different kinds of events.