Belle II Software development
ARICHBiasVoltages.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 <framework/logging/Logger.h>
10
11#include <arich/dbobjects/ARICHBiasVoltages.h>
12
13using namespace std;
14using namespace Belle2;
15
17{
18}
19
20std::vector<int> ARICHBiasVoltages::getBiasVoltages(const std::string& hapdID) const
21{
22 if (hapdID != "") {
23 return m_hapd2voltages.find(hapdID)->second;
24 } else {
25 return std::vector<int>(5, 0);
26 }
27
28}
29
30void ARICHBiasVoltages::addVoltages(const std::string& hapdID, std::vector<int> biasVoltages)
31{
32 m_hapd2voltages.insert(std::pair<std::string, std::vector<int>>(hapdID, biasVoltages));
33}
34
36{
37
38 for (auto const& x : m_hapd2voltages) {
39 std::vector<int> voltages = x.second;
40 B2INFO("voltages: " << x.first << ": bias A = " << voltages[0] << ", bias B = " << voltages[1] << ", bias C = " << voltages[2] <<
41 ", bias D = " << voltages[3] << ", guard = " << voltages[4]);
42 }
43}
44
void addVoltages(const std::string &hapdID, std::vector< int > biasVoltages)
Add new entry to the mapping table.
std::map< std::string, std::vector< int > > m_hapd2voltages
map of voltages to power supply
ARICHBiasVoltages()
Default constructor.
std::vector< int > getBiasVoltages(const std::string &hapdID) const
Get inner cable ID and type, connected to bias channel.
void print() const
Print voltages for PS channels.
Abstract base class for different kinds of events.
STL namespace.