9 #include <framework/logging/Logger.h>
11 #include <arich/dbobjects/ARICHBiasCrateCableMapping.h>
17 ARICHBiasCrateCableMapping::ARICHBiasCrateCableMapping()
21 int ARICHBiasCrateCableMapping::getSector(
int connectionID)
const
23 if (connectionID < 1) { B2WARNING(
"ARICHBiasCrateCableMapping::getSector: connectionID " << connectionID <<
" not valid!");
return 0;}
24 std::vector<int> sectorCable = m_connection2cable.find(connectionID)->second;
25 return sectorCable[0];
28 int ARICHBiasCrateCableMapping::getCable(
int connectionID)
const
30 if (connectionID < 1) { B2WARNING(
"ARICHBiasCrateCableMapping::getCable: connectionID " << connectionID <<
" not valid!");
return 0;}
31 std::vector<int> sectorCable = m_connection2cable.find(connectionID)->second;
32 return sectorCable[1];
35 int ARICHBiasCrateCableMapping::getConnectionID(
const std::vector<int>& sectorCable)
const
37 int connectionID = -2;
38 for (
auto& i : m_connection2cable) {
39 if (i.second == sectorCable) connectionID = i.first;
45 void ARICHBiasCrateCableMapping::addMapping(
int connectionID, std::vector<int> sectorCable)
47 m_connection2cable.insert(std::pair<
int, std::vector<int>>(connectionID, sectorCable));
50 void ARICHBiasCrateCableMapping::print()
const
52 for (
auto const& x : m_connection2cable) {
53 int connectionID = x.first;
54 std::vector<int> cables = x.second;
55 B2INFO(
"Connection " << connectionID <<
": sector " << cables[0] <<
", cable " << cables[1]);
Abstract base class for different kinds of events.