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#include <iostream>
13
14using namespace std;
15using namespace Belle2;
16
18{
19}
20
21std::vector<int> ARICHBiasVoltages::getBiasVoltages(const std::string& hapdID) const
22{
23 if (hapdID != "") {
24 return m_hapd2voltages.find(hapdID)->second;
25 } else {
26 return std::vector<int>(5, 0);
27 }
28
29}
30
31void ARICHBiasVoltages::addVoltages(const std::string& hapdID, std::vector<int> biasVoltages)
32{
33 m_hapd2voltages.insert(std::pair<std::string, std::vector<int>>(hapdID, biasVoltages));
34}
35
37{
38
39 for (auto const& x : m_hapd2voltages) {
40 std::vector<int> voltages = x.second;
41 B2INFO("voltages: " << x.first << ": bias A = " << voltages[0] << ", bias B = " << voltages[1] << ", bias C = " << voltages[2] <<
42 ", bias D = " << voltages[3] << ", guard = " << voltages[4]);
43 }
44}
45
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.