9 #include <top/dbobjects/TOPCalTimebase.h>
11 #include <framework/logging/Logger.h>
23 typedef map<unsigned, const TOPSampleTimes*>::const_iterator
Iterator;
26 void TOPCalTimebase::append(
unsigned scrodID,
unsigned channel,
27 const vector<double>& sampleTimes,
30 unsigned key = (scrodID << 16) + (channel % 128);
32 if (it == m_map.end()) {
33 m_sampleTimes.push_back(
TOPSampleTimes(scrodID, channel, m_syncTimeBase));
34 m_sampleTimes.back().setTimeAxis(sampleTimes, m_syncTimeBase);
35 m_map[key] = &m_sampleTimes.back();
38 const_cast<TOPSampleTimes*
>(it->second)->setTimeAxis(sampleTimes, m_syncTimeBase);
39 B2WARNING(
"TOPCalTimebase: constants replaced."
40 <<
LogVar(
"scrodID", scrodID)
41 <<
LogVar(
"channel", channel));
43 B2WARNING(
"TOPCalTimebase: old constants kept."
44 <<
LogVar(
"scrodID", scrodID)
45 <<
LogVar(
"channel", channel));
53 unsigned channel)
const
57 unsigned key = (scrodID << 16) + (channel % 128);
59 if (it == m_map.end()) {
60 if (!m_sampleTime) m_sampleTime =
new TOPSampleTimes(0, 0, m_syncTimeBase);
67 bool TOPCalTimebase::isAvailable(
unsigned scrodID,
unsigned channel)
const
71 unsigned key = (scrodID << 16) + (channel % 128);
73 return (it != m_map.end());
80 for (
const auto& sampleTime : m_sampleTimes) {
81 unsigned key = (sampleTime.getScrodID() << 16) + sampleTime.getChannel();
82 m_map[key] = &sampleTime;
85 B2DEBUG(29,
"TOPCalTimebase: map created, size = " << m_map.size());
Calibration constants of a singe ASIC channel: time axis (sample times)
Class to store variables with their name which were sent to the logging service.
map< unsigned, const TOPSampleTimes * >::const_iterator Iterator
Iteratior for m_map.
i2dMap createMap(int nEntries, Functor funct)
create a multimap with
Abstract base class for different kinds of events.