9 #include <top/dbobjects/TOPCalModuleT0.h>
10 #include <framework/logging/Logger.h>
20 void TOPCalModuleT0::setT0(
int moduleID,
double T0,
double errT0)
22 unsigned module = moduleID - 1;
23 if (module >= c_numModules) {
24 B2ERROR(
"Invalid module number, constant not set (" << ClassName() <<
")");
28 m_errT0[module] = errT0;
29 m_status[module] = c_Calibrated;
33 void TOPCalModuleT0::setUnusable(
int moduleID)
35 unsigned module = moduleID - 1;
36 if (module >= c_numModules) {
37 B2ERROR(
"Invalid module number, status not set (" << ClassName() <<
")");
40 m_status[module] = c_Unusable;
44 void TOPCalModuleT0::suppressAverage()
48 for (
int i = 0; i < c_numModules; i++) {
49 if (m_status[i] == c_Calibrated) {
56 for (
int i = 0; i < c_numModules; i++) {
57 if (m_status[i] != c_Default) m_T0[i] -= s;
59 B2INFO(
"Average of " << s <<
" ns subtracted.");
63 double TOPCalModuleT0::getT0(
int moduleID)
const
65 unsigned module = moduleID - 1;
66 if (module >= c_numModules) {
67 B2WARNING(
"Invalid module number, returning 0 (" << ClassName() <<
")");
74 double TOPCalModuleT0::getT0Error(
int moduleID)
const
76 unsigned module = moduleID - 1;
77 if (module >= c_numModules) {
78 B2WARNING(
"Invalid module number, returning 0 (" << ClassName() <<
")");
81 return m_errT0[module];
85 bool TOPCalModuleT0::isCalibrated(
int moduleID)
const
87 unsigned module = moduleID - 1;
88 if (module >= c_numModules)
return false;
89 return m_status[module] == c_Calibrated;
93 bool TOPCalModuleT0::isDefault(
int moduleID)
const
95 unsigned module = moduleID - 1;
96 if (module >= c_numModules)
return false;
97 return m_status[module] == c_Default;
101 bool TOPCalModuleT0::isUnusable(
int moduleID)
const
103 unsigned module = moduleID - 1;
104 if (module >= c_numModules)
return false;
105 return m_status[module] == c_Unusable;
Abstract base class for different kinds of events.