11 #include <top/dbobjects/TOPASICGains.h>
12 #include <framework/logging/Logger.h>
22 bool TOPASICGains::setGains(
const std::vector<float>& gains,
float error)
25 if (gains.size() != c_WindowSize) {
26 B2ERROR(
"TOPASICGains::setGains: vector with wrong number of elements");
30 for (
int i = 0; i < c_WindowSize; i++) {
31 float gain = gains[i] * m_unit;
32 if (gain > 0 and (gain + 0.5) < 0x10000) {
33 m_gains[i] = int(gain + 0.5);
39 m_gainError = int(error + 0.5);