9#include <arich/dbobjects/ARICHCopperMapping.h>
10#include <framework/logging/Logger.h>
12#include <arich/dbobjects/ARICHMergerMapping.h>
42 if (finesse > 3) B2ERROR(
"ARICHCopperMapping::addMapping: invalid finesse number (0-3)!");
47 std::vector<uint16_t> mergerList = {0, 0, 0, 0};
48 mergerList[finesse] = mergerID;
49 m_copper2merger.insert(std::pair<uint16_t, std::vector<uint16_t>>((uint16_t)copperID, mergerList));
52 mergerList[finesse] = mergerID;
60 if (finesse > 3) B2ERROR(
"ARICHCopperMapping::getMergerID: invalid finesse number (0-3)!");
63 return (
unsigned)it->second[finesse];
69 cout <<
"Mapping of merger to copper boards" << endl;
72 cout <<
" Merger boards connected to copper board " << copper << endl;
73 for (
int i = 0; i < 4; i++) {
75 else cout <<
" Finesse " << i <<
": not connected" << endl;
unsigned getCopperID(unsigned mergerID) const
Get copper board to which merger is connected.
void addMapping(unsigned mergerID, unsigned copperID, unsigned finesse)
Add new entry to the mapping table.
unsigned getMergerID(unsigned copperID, unsigned finesse) const
Get ID of merger connected to the given finesse of copper board.
std::map< uint16_t, std::vector< uint16_t > > m_copper2merger
map coppers to mergers
std::vector< uint16_t > m_copperIDs
vector of IDs of used copper boards
ARICHCopperMapping()
Default constructor.
void print() const
Print mapping parameters.
std::vector< std::pair< uint16_t, uint16_t > > m_merger2copper
map of mergers to copper boards
unsigned getFinesse(unsigned mergerID) const
Get finesse of copper board to which merger is connected.
Abstract base class for different kinds of events.