11#include <top/dbobjects/TOPFrontEndMap.h>
12#include <framework/gearbox/GearDir.h>
13#include <framework/database/DBArray.h>
14#include <framework/database/IntervalOfValidity.h>
17#include <unordered_set>
77 if (moduleID >= 0 and moduleID < c_numModules and bs >= 0 and bs < c_numColumns)
89 std::map<unsigned short, const TOPFrontEndMap*>::const_iterator it =
103 std::map<unsigned int, const TOPFrontEndMap*>::const_iterator it =
138 for (
int bs = 0; bs < c_numColumns; bs++) {
139 const auto* map =
getMap(moduleID, bs);
140 if (map)
return map->getModuleCNumber();
156 enum {c_numModules = 16, c_numColumns = 4};
Class for accessing arrays of objects in the database.
GearDir is the basic class used for accessing the parameter store.
A class that describes the interval of experiments/runs for which an object in the database is valid.
Mapping of a boardstack number within a module to SCROD and COPPER/Finesse.
Provides mapping between electronics module position within a TOP module and SCROD ID,...
void initialize()
Initialize from database.
bool m_fromDB
true, if from database
const TOPFrontEndMap * m_fromModule[c_numModules][c_numColumns]
conversion
const TOPFrontEndMap * getMap(int moduleID, int bs) const
Return map from TOP module side.
FrontEndMapper()
constructor
bool isValid() const
check if the mapping is available
DBArray< TOPFrontEndMap > * m_mappingDB
mappings from database
FrontEndMapper(const FrontEndMapper &)
copy constructor
bool m_valid
true, if mapping available
~FrontEndMapper()
destructor
int getMapSize() const
Return size of the map.
std::unordered_set< unsigned int > m_copperIDs
COPPER ID's.
const TOPFrontEndMap * getMapFromCopper(unsigned copperID, int finesse) const
Return map from COPPER/Finesse side.
FrontEndMapper & operator=(const FrontEndMapper &)
assignment operator
std::map< unsigned int, const TOPFrontEndMap * > m_fromCopper
conversion
const std::unordered_set< unsigned int > & getCopperIDs() const
Return a set of copper ID's.
const TOPFrontEndMap * getMap(unsigned short scrodID) const
Return map from SCROD side.
std::map< unsigned short, const TOPFrontEndMap * > m_fromScrod
conversion
int getModuleCNumber(int moduleID) const
Returns module construction number.
void update()
re-do conversion maps when DBArray has changed
void importPayload(const IntervalOfValidity &iov) const
import mappings to database
void print() const
Print mappings to terminal screen.
std::vector< TOPFrontEndMap > m_mapping
mappings from gearbox
Abstract base class for different kinds of events.