Belle II Software  release-06-02-00
KLMTimeResolution.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 /* Own header. */
10 #include <klm/dbobjects/KLMTimeResolution.h>
11 
12 /* C++ headers. */
13 #include <limits>
14 
15 using namespace Belle2;
16 
17 float KLMTimeResolution::getTimeResolution(uint16_t channel) const
18 {
19  std::map<uint16_t, float>::const_iterator it;
20  it = m_TimeResolution.find(channel);
21  if (it == m_TimeResolution.end())
22  return std::numeric_limits<float>::quiet_NaN();
23  return it->second;
24 }
25 
26 void KLMTimeResolution::setTimeResolution(uint16_t channel, float delay)
27 {
28  std::map<uint16_t, float>::iterator it;
29  it = m_TimeResolution.find(channel);
30  if (it == m_TimeResolution.end())
31  m_TimeResolution.insert(std::pair<uint16_t, float>(channel, delay));
32  else
33  it->second = delay;
34 }
std::map< uint16_t, float > m_TimeResolution
Time resolution.
void setTimeResolution(uint16_t channel, float resolution)
Set time resolution.
float getTimeResolution(uint16_t channel) const
Get time resolution.
Abstract base class for different kinds of events.