9#include <framework/logging/Logger.h>
11#include <arich/dbobjects/ARICHBiasCablesMapping.h>
23 if (sectorID > 6 || sectorID < 1) { B2WARNING(
"ARICHBiasCablesMapping::getcableID: Sector number " << sectorID <<
" not valid!");
return 0;}
24 if (cableID > 8 || cableID < 1) { B2WARNING(
"ARICHBiasCablesMapping::getcableID: Cable number " << cableID <<
" not valid!");
return 0;}
25 if (innerID > 9 || innerID < 1) { B2WARNING(
"ARICHBiasCablesMapping::getcableID: Inner cable number " << innerID <<
" not valid!");
return 0;}
28 std::vector<int> position{sectorID, cableID, innerID};
30 if (i.second == position) module = i.first;
37 if (moduleID > 420 || moduleID < 1) { B2WARNING(
"ARICHBiasCablesMapping::getcableID: Module number " << moduleID <<
" not valid!");
return 0;}
39 return (
int)sector[0];
44 if (moduleID > 420 || moduleID < 1) { B2WARNING(
"ARICHBiasCablesMapping::getcableID: Module number " << moduleID <<
" not valid!");
return 0;}
51 if (moduleID > 420 || moduleID < 1) { B2WARNING(
"ARICHBiasCablesMapping::getcableID: Module number " << moduleID <<
" not valid!");
return 0;}
59 if (moduleID > 420 || moduleID < 1) { B2WARNING(
"ARICHBiasCablesMapping::addMapping: Module number " << moduleID <<
" not valid!"); }
60 if (sectorID > 6 || sectorID < 1) { B2WARNING(
"ARICHBiasCablesMapping::addMapping: Sector number " << sectorID <<
" not valid!"); }
61 if (cableID > 8 || cableID < 1) { B2WARNING(
"ARICHBiasCablesMapping::addMapping: Cable number " << cableID <<
" not valid!"); }
62 if (innerID > 9 || innerID < 1) { B2WARNING(
"ARICHBiasCablesMapping::addMapping: Inner cable number " << innerID <<
" not valid!"); }
64 std::vector<int> cableMap{sectorID, cableID, innerID};
65 m_module2cable.insert(std::pair<
int, std::vector<int>>(moduleID, cableMap));
72 for (
int moduleID = 1; moduleID < N_MODULES + 1; moduleID++) {
74 moduleID) <<
", inner " <<
getInnerID(moduleID) << endl;
78 cout <<
"Moving to finding module number... " << endl;
81 for (
int i = 1; i < 7 ; i++) {
82 for (
int j = 1; j < 9 ; j++) {
83 for (
int k = 1; k < 10; k++) {
84 if ((j == 2 || j == 6) && k == 9)
continue;
85 std::cout <<
" Module: " <<
getModuleID(i, j, k) <<
": sector " << i <<
", cable " << j <<
", inner " << k << std::endl;
91 cout <<
"number of modules = " << l << endl;
int getCableID(int moduleID) const
Get ID of cable to which module is connected.
int getSectorID(int moduleID) const
Get ID of sector of a cable to which module is connected.
void addMapping(int moduleID, int sectorID, int cableID, int innerID)
Add mapping entry.
int getModuleID(int sectorID, int cableID, int innerID) const
Get ID of module connected to cable in sector.
int getInnerID(int moduleID) const
Get inner cable ID to which module is connected.
void print() const
Pring mapping.
std::map< int, std::vector< int > > m_module2cable
map of modules to cables
ARICHBiasCablesMapping()
Default constructor.
Abstract base class for different kinds of events.