Belle II Software  release-08-01-10
FrontEndMapper Class Reference

Provides mapping between electronics module position within a TOP module and SCROD ID, COPPER and Finesse slot. More...

#include <FrontEndMapper.h>

Collaboration diagram for FrontEndMapper:

Public Member Functions

 FrontEndMapper ()
 constructor
 
 ~FrontEndMapper ()
 destructor
 
void initialize (const GearDir &frontEndMapping)
 Initialize from Gearbox (XML) More...
 
void initialize ()
 Initialize from database.
 
bool isValid () const
 check if the mapping is available More...
 
void importPayload (const IntervalOfValidity &iov) const
 import mappings to database More...
 
const TOPFrontEndMapgetMap (int moduleID, int bs) const
 Return map from TOP module side. More...
 
const TOPFrontEndMapgetMap (unsigned short scrodID) const
 Return map from SCROD side. More...
 
const TOPFrontEndMapgetMapFromCopper (unsigned copperID, int finesse) const
 Return map from COPPER/Finesse side. More...
 
int getMapSize () const
 Return size of the map. More...
 
const std::unordered_set< unsigned int > & getCopperIDs () const
 Return a set of copper ID's. More...
 
int getModuleCNumber (int moduleID) const
 Returns module construction number. More...
 
void print () const
 Print mappings to terminal screen.
 

Private Types

enum  {
  c_numModules = 16 ,
  c_numColumns = 4
}
 Number of TOP modules (number of physical ones can be less), number of electronic modules (SCROD's) per TOP module.
 

Private Member Functions

 FrontEndMapper (const FrontEndMapper &)
 copy constructor
 
FrontEndMapperoperator= (const FrontEndMapper &)
 assignment operator
 
void clear ()
 Clear.
 
void update ()
 re-do conversion maps when DBArray has changed
 

Private Attributes

std::vector< TOPFrontEndMapm_mapping
 mappings from gearbox
 
DBArray< TOPFrontEndMap > * m_mappingDB = 0
 mappings from database
 
bool m_valid = false
 true, if mapping available
 
bool m_fromDB = false
 true, if from database
 
std::unordered_set< unsigned int > m_copperIDs
 COPPER ID's.
 
const TOPFrontEndMapm_fromModule [c_numModules][c_numColumns] = {{0}}
 conversion
 
std::map< unsigned short, const TOPFrontEndMap * > m_fromScrod
 conversion
 
std::map< unsigned int, const TOPFrontEndMap * > m_fromCopper
 conversion
 

Detailed Description

Provides mapping between electronics module position within a TOP module and SCROD ID, COPPER and Finesse slot.

Definition at line 31 of file FrontEndMapper.h.

Member Function Documentation

◆ getCopperIDs()

const std::unordered_set<unsigned int>& getCopperIDs ( ) const
inline

Return a set of copper ID's.

Returns
copper ID's

Definition at line 126 of file FrontEndMapper.h.

127  {
128  return m_copperIDs;
129  }
std::unordered_set< unsigned int > m_copperIDs
COPPER ID's.

◆ getMap() [1/2]

const TOPFrontEndMap* getMap ( int  moduleID,
int  bs 
) const
inline

Return map from TOP module side.

Parameters
moduleIDTOP module ID
bsboardstack number
Returns
pointer to map element or NULL

Definition at line 74 of file FrontEndMapper.h.

◆ getMap() [2/2]

const TOPFrontEndMap* getMap ( unsigned short  scrodID) const
inline

Return map from SCROD side.

Parameters
scrodIDSCROD ID
Returns
pointer to map element or NULL

Definition at line 87 of file FrontEndMapper.h.

◆ getMapFromCopper()

const TOPFrontEndMap* getMapFromCopper ( unsigned  copperID,
int  finesse 
) const
inline

Return map from COPPER/Finesse side.

Parameters
copperIDCOPPER ID
finesseFinesse slot number
Returns
pointer to map element or NULL

Definition at line 101 of file FrontEndMapper.h.

◆ getMapSize()

int getMapSize ( ) const
inline

Return size of the map.

Returns
size

Definition at line 113 of file FrontEndMapper.h.

◆ getModuleCNumber()

int getModuleCNumber ( int  moduleID) const
inline

Returns module construction number.

Parameters
moduleIDmodule ID (slot number)
Returns
module construction number

Definition at line 136 of file FrontEndMapper.h.

◆ importPayload()

void importPayload ( const IntervalOfValidity iov) const

import mappings to database

Parameters
iovInterval of validity.

Definition at line 170 of file FrontEndMapper.cc.

171  {
172  DBImportArray<TOPFrontEndMap> array;
173  for (const auto& map : m_mapping) {
174  array.appendNew(map);
175  }
176  array.import(iov);
177  }
std::vector< TOPFrontEndMap > m_mapping
mappings from gearbox

◆ initialize()

void initialize ( const GearDir frontEndMapping)

Initialize from Gearbox (XML)

Parameters
frontEndMappingXML data directory

Definition at line 40 of file FrontEndMapper.cc.

◆ isValid()

bool isValid ( ) const
inline

check if the mapping is available

Returns
true if available

Definition at line 60 of file FrontEndMapper.h.


The documentation for this class was generated from the following files: