Belle II Software development
TOPCalPrecision.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#include <top/dbobjects/TOPCalPrecision.h>
10#include <framework/logging/Logger.h>
11
12using namespace std;
13
14namespace Belle2 {
19
20 void TOPCalPrecision::set(const TProfile* pf)
21 {
22 if (pf->GetNbinsX() != 16) B2ERROR("TOPCalPrecision::set(TProfile*): profile histogram must have 16 bins, but found " <<
23 pf->GetNbinsX());
24
25 for (int i = 1; i <= pf->GetNbinsX(); i++) {
26 m_precisions.push_back(pf->GetBinError(i));
27 }
28 }
29
30 double TOPCalPrecision::get(int moduleID) const
31 {
32 unsigned i = moduleID - 1;
33 if (i < m_precisions.size()) return m_precisions[i];
34 return 0;
35 }
36
38} // end Belle2 namespace
std::vector< float > m_precisions
time calibration precisions (index = slot - 1)
double get(int moduleID) const
Getter.
void set(const TProfile *pf)
Setter.
Abstract base class for different kinds of events.
STL namespace.