Belle II Software development
KLMElectronicsMap Class Reference

BKLM electronics map. More...

#include <KLMElectronicsMap.h>

Inheritance diagram for KLMElectronicsMap:

Public Member Functions

 KLMElectronicsMap ()
 Constructor.
 
 ~KLMElectronicsMap ()
 Destructor.
 
const KLMChannelNumbergetDetectorChannel (KLMElectronicsChannel *electronicsChannel) const
 Get detector channel by electronics channel.
 
const KLMElectronicsChannelgetElectronicsChannel (KLMChannelNumber detectorChannel) const
 Get electronics channel by detector channel.
 
void addChannel (KLMChannelNumber detectorChannel, int copper, int slot, int lane, int axis, int channel)
 Add channel.
 

Private Member Functions

 ClassDef (Belle2::KLMElectronicsMap, 1)
 Class version.
 

Private Attributes

std::map< KLMChannelNumber, KLMElectronicsChannelm_MapDetectorElectronics
 Detector channel - electronics channel map.
 
std::map< KLMElectronicsChannel, KLMChannelNumberm_MapElectronicsDetector
 Electronics channel - detector channel map.
 

Detailed Description

BKLM electronics map.

Definition at line 27 of file KLMElectronicsMap.h.

Constructor & Destructor Documentation

◆ KLMElectronicsMap()

Constructor.

Definition at line 17 of file KLMElectronicsMap.cc.

18{
19}

◆ ~KLMElectronicsMap()

Destructor.

Definition at line 21 of file KLMElectronicsMap.cc.

22{
23}

Member Function Documentation

◆ addChannel()

void addChannel ( KLMChannelNumber  detectorChannel,
int  copper,
int  slot,
int  lane,
int  axis,
int  channel 
)

Add channel.

Parameters
[in]detectorChannelDetector channel.
[in]copperCopper.
[in]slotSlot.
[in]laneLane.
[in]axisAxis.
[in]channelChannel.

Definition at line 45 of file KLMElectronicsMap.cc.

48{
49 KLMElectronicsChannel electronicsChannel(copper, slot, lane, axis, channel);
50 if (m_MapDetectorElectronics.find(detectorChannel) != m_MapDetectorElectronics.end()) {
51 B2ERROR("Detector channel already exists in the electronics map."
52 << LogVar("Detector channel", detectorChannel));
53 return;
54 }
55 if (m_MapElectronicsDetector.find(electronicsChannel) != m_MapElectronicsDetector.end()) {
56 B2ERROR("Electronics channel already exists in the electronics map."
57 << LogVar("Copper", copper)
58 << LogVar("Slot", slot)
59 << LogVar("Lane", lane)
60 << LogVar("Axis", axis)
61 << LogVar("Channel", channel));
62 return;
63 }
64 m_MapDetectorElectronics.insert(std::pair<KLMChannelNumber, KLMElectronicsChannel>(
65 detectorChannel, electronicsChannel));
66 m_MapElectronicsDetector.insert(std::pair<KLMElectronicsChannel, KLMChannelNumber>(
67 electronicsChannel, detectorChannel));
68}
BKLM electronics channel.
std::map< KLMChannelNumber, KLMElectronicsChannel > m_MapDetectorElectronics
Detector channel - electronics channel map.
std::map< KLMElectronicsChannel, KLMChannelNumber > m_MapElectronicsDetector
Electronics channel - detector channel map.
Class to store variables with their name which were sent to the logging service.

◆ getDetectorChannel()

const KLMChannelNumber * getDetectorChannel ( KLMElectronicsChannel electronicsChannel) const

Get detector channel by electronics channel.

Parameters
[in]electronicsChannelElectronics channel.
Returns
Detector channel, nullptr if not found.

Definition at line 25 of file KLMElectronicsMap.cc.

27{
28 std::map<KLMElectronicsChannel, KLMChannelNumber>::const_iterator it;
29 it = m_MapElectronicsDetector.find(*electronicsChannel);
30 if (it == m_MapElectronicsDetector.end())
31 return nullptr;
32 return &(it->second);
33}

◆ getElectronicsChannel()

const KLMElectronicsChannel * getElectronicsChannel ( KLMChannelNumber  detectorChannel) const

Get electronics channel by detector channel.

Parameters
[in]detectorChannelDetector channel.
Returns
Electronics channel, nullptr if not found.

Definition at line 35 of file KLMElectronicsMap.cc.

37{
38 std::map<KLMChannelNumber, KLMElectronicsChannel>::const_iterator it;
39 it = m_MapDetectorElectronics.find(detectorChannel);
40 if (it == m_MapDetectorElectronics.end())
41 return nullptr;
42 return &(it->second);
43}

Member Data Documentation

◆ m_MapDetectorElectronics

std::map<KLMChannelNumber, KLMElectronicsChannel> m_MapDetectorElectronics
private

Detector channel - electronics channel map.

Definition at line 72 of file KLMElectronicsMap.h.

◆ m_MapElectronicsDetector

std::map<KLMElectronicsChannel, KLMChannelNumber> m_MapElectronicsDetector
private

Electronics channel - detector channel map.

Definition at line 75 of file KLMElectronicsMap.h.


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