Belle II Software development
KLMChannelMapValue< T > Class Template Reference

KLM channel map. More...

#include <KLMChannelMapValue.h>

Inheritance diagram for KLMChannelMapValue< T >:

Public Member Functions

 KLMChannelMapValue ()
 Constructor.
 
 ~KLMChannelMapValue ()
 Destructor.
 
const T getChannelData (KLMChannelNumber channel) const
 Get channel data.
 
void setChannelData (KLMChannelNumber channel, const T data)
 Set channel data.
 
void setDataAllChannels (const T data)
 Set data for all channels.
 

Private Member Functions

 ClassDef (Belle2::KLMChannelMapValue< T >, 1)
 Class version.
 

Private Attributes

std::map< KLMChannelNumber, T > m_ChannelData
 Channel data.
 

Detailed Description

template<class T>
class Belle2::KLMChannelMapValue< T >

KLM channel map.

Definition at line 33 of file KLMChannelMapValue.h.

Constructor & Destructor Documentation

◆ KLMChannelMapValue()

KLMChannelMapValue ( )
inline

Constructor.

Definition at line 40 of file KLMChannelMapValue.h.

41 {
42 }

◆ ~KLMChannelMapValue()

~KLMChannelMapValue ( )
inline

Destructor.

Definition at line 47 of file KLMChannelMapValue.h.

48 {
49 }

Member Function Documentation

◆ getChannelData()

const T getChannelData ( KLMChannelNumber  channel) const
inline

Get channel data.

Parameters
[in]channelChannel number.

Definition at line 55 of file KLMChannelMapValue.h.

56 {
57 typename std::map<KLMChannelNumber, T>::const_iterator it;
58 it = m_ChannelData.find(channel);
59 if (it == m_ChannelData.end()) {
60 B2ERROR("No data for KLM channel in map." <<
61 LogVar("Channel number", channel));
62 }
63 return it->second;
64 }
std::map< KLMChannelNumber, T > m_ChannelData
Channel data.
Class to store variables with their name which were sent to the logging service.

◆ setChannelData()

void setChannelData ( KLMChannelNumber  channel,
const T  data 
)
inline

Set channel data.

Parameters
[in]channelChannel number.
[in]dataData.

Definition at line 71 of file KLMChannelMapValue.h.

72 {
73 typename std::map<KLMChannelNumber, T>::iterator it;
74 it = m_ChannelData.find(channel);
75 if (it == m_ChannelData.end()) {
76 m_ChannelData.insert(std::pair<KLMChannelNumber, T>(channel, data));
77 } else {
78 it->second = data;
79 }
80 }

◆ setDataAllChannels()

void setDataAllChannels ( const T  data)
inline

Set data for all channels.

Parameters
[in]dataData.

Definition at line 86 of file KLMChannelMapValue.h.

87 {
88 KLMChannelIndex klmChannels;
89 for (KLMChannelIndex& klmChannel : klmChannels)
90 setChannelData(klmChannel.getKLMChannelNumber(), data);
91 }
void setChannelData(KLMChannelNumber channel, const T data)
Set channel data.

Member Data Documentation

◆ m_ChannelData

std::map<KLMChannelNumber, T> m_ChannelData
private

Channel data.

Definition at line 96 of file KLMChannelMapValue.h.


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