9 #include <framework/logging/Logger.h>
11 #include <arich/dbobjects/ARICHHvCrateCableMapping.h>
17 ARICHHvCrateCableMapping::ARICHHvCrateCableMapping()
21 int ARICHHvCrateCableMapping::getSector(
int connectionID)
const
23 std::vector<int> sectorCable = m_connection2cable.find(connectionID)->second;
24 return sectorCable[0];
27 int ARICHHvCrateCableMapping::getCable(
int connectionID)
const
29 std::vector<int> sectorCable = m_connection2cable.find(connectionID)->second;
30 return sectorCable[1];
33 int ARICHHvCrateCableMapping::getConnectionID(
const std::vector<int>& sectorCable)
const
35 int connectionID = -1;
36 for (
auto& i : m_connection2cable) {
37 if (i.second == sectorCable) connectionID = i.first;
43 void ARICHHvCrateCableMapping::addMapping(
int connectionID, std::vector<int> sectorCable)
45 m_connection2cable.insert(std::pair<
int, std::vector<int>>(connectionID, sectorCable));
48 void ARICHHvCrateCableMapping::print()
const
50 for (
auto const& x : m_connection2cable) {
51 int connectionID = x.first;
52 std::vector<int> cables = x.second;
53 B2INFO(
"Connection " << connectionID <<
": sector " << cables[0] <<
", cable " << cables[1]);
Abstract base class for different kinds of events.