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

The Class for ARICH mapping of merger to copper boards. More...

#include <ARICHCopperMapping.h>

Inheritance diagram for ARICHCopperMapping:
Collaboration diagram for ARICHCopperMapping:

Public Member Functions

 ARICHCopperMapping ()
 Default constructor.
 
unsigned getCopperID (unsigned mergerID) const
 Get copper board to which merger is connected. More...
 
unsigned getFinesse (unsigned mergerID) const
 Get finesse of copper board to which merger is connected. More...
 
void addMapping (unsigned mergerID, unsigned copperID, unsigned finesse)
 Add new entry to the mapping table. More...
 
unsigned getMergerID (unsigned copperID, unsigned finesse) const
 Get ID of merger connected to the given finesse of copper board. More...
 
const std::vector< uint16_t > & getCopperIDs () const
 Get vector of IDs of copper boards. More...
 
void print () const
 Print mapping parameters.
 

Private Member Functions

 ClassDef (ARICHCopperMapping, 1)
 ClassDef, must be the last term before the closing {}.
 

Private Attributes

std::vector< std::pair< uint16_t, uint16_t > > m_merger2copper
 map of mergers to copper boards
 
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
 

Detailed Description

The Class for ARICH mapping of merger to copper boards.

This class provides ARICH mapping of merger to copper boards Cooper ID can be arbitrary number, finesse number goes from 0-3 Merger ID goes from 1 to 72

Definition at line 28 of file ARICHCopperMapping.h.

Member Function Documentation

◆ addMapping()

void addMapping ( unsigned  mergerID,
unsigned  copperID,
unsigned  finesse 
)

Add new entry to the mapping table.

Parameters
mergerIDID of merger board
copperIDcopper board ID number
finessefinesse number

Definition at line 38 of file ARICHCopperMapping.cc.

39 {
40 
41 // if (mergerID > N_MERGERS + 1 || mergerID == 0) B2ERROR("ARICHCopperMapping::addMapping: invalid merger ID number!");
42  if (finesse > 3) B2ERROR("ARICHCopperMapping::addMapping: invalid finesse number (0-3)!");
43 
44  m_merger2copper[mergerID - 1] = std::make_pair(copperID, finesse);
45 
46  if (m_copper2merger.find(copperID) == m_copper2merger.end()) {
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));
50  } else {
51  std::vector<uint16_t>& mergerList = m_copper2merger[copperID];
52  mergerList[finesse] = mergerID;
53  }
54 
55  if (std::find(m_copperIDs.begin(), m_copperIDs.end(), uint16_t(copperID)) == m_copperIDs.end()) m_copperIDs.push_back(copperID);
56 }
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
std::vector< std::pair< uint16_t, uint16_t > > m_merger2copper
map of mergers to copper boards

◆ getCopperID()

unsigned getCopperID ( unsigned  mergerID) const

Get copper board to which merger is connected.

Parameters
mergerIDID of merger board
Returns
copper board ID

Definition at line 26 of file ARICHCopperMapping.cc.

◆ getCopperIDs()

const std::vector<uint16_t>& getCopperIDs ( ) const
inline

Get vector of IDs of copper boards.

Returns
vector of copper IDs

Definition at line 70 of file ARICHCopperMapping.h.

70 { return m_copperIDs;}

◆ getFinesse()

unsigned getFinesse ( unsigned  mergerID) const

Get finesse of copper board to which merger is connected.

Parameters
mergerIDID of merger board
Returns
finesse number

Definition at line 32 of file ARICHCopperMapping.cc.

◆ getMergerID()

unsigned getMergerID ( unsigned  copperID,
unsigned  finesse 
) const

Get ID of merger connected to the given finesse of copper board.

Parameters
copperIDcopper board ID number
finessefinesse number
Returns
merger board ID

Definition at line 58 of file ARICHCopperMapping.cc.


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