Belle II Software development
TOPCalChannelMask Class Reference

Channel status for all 512 channels of 16 modules. More...

#include <TOPCalChannelMask.h>

Inheritance diagram for TOPCalChannelMask:

Public Types

enum  EStatus {
  c_Active = 0 ,
  c_Dead = 1 ,
  c_Noisy = 2
}
 Status of the channel. More...
 

Public Member Functions

 TOPCalChannelMask ()
 Default constructor.
 
void setStatus (int moduleID, unsigned channel, EStatus status)
 Sets the status for a single channel.
 
void setActive (int moduleID, unsigned channel)
 Sets a specific channel as active.
 
void setDead (int moduleID, unsigned channel)
 Sets a specific channel as dead.
 
void setNoisy (int moduleID, unsigned channel)
 Sets a specific channel as noisy.
 
EStatus getStatus (int moduleID, unsigned channel) const
 Returns the status of a single channel.
 
bool isActive (int moduleID, unsigned channel) const
 Returns false if the channel is dead or noisy, and true is the channel is active.
 
int getNumOfChannels () const
 Returns number of all channels.
 
int getNumOfModuleChannels () const
 Returns number of channels in a module.
 
int getNumOfActiveChannels () const
 Returns number of active channels.
 
int getNumOfDeadChannels () const
 Returns number of dead channels.
 
int getNumOfNoisyChannels () const
 Returns number of noisy channels.
 
double getActiveFraction () const
 Returns fraction of active channels.
 
int getNumOfActiveChannels (int moduleID) const
 Returns number of module active channels.
 
int getNumOfDeadChannels (int moduleID) const
 Returns number of module dead channels.
 
int getNumOfNoisyChannels (int moduleID) const
 Returns number of module noisy channels.
 
double getActiveFraction (int moduleID) const
 Returns fraction of module active channels.
 

Private Types

enum  {
  c_numModules = 16 ,
  c_numChannels = 512
}
 Sizes. More...
 

Private Member Functions

bool check (const int module, const unsigned channel) const
 Check input module and channel arguments are sane.
 
int getNumOf (EStatus check) const
 Counts and returns the number of channels having a given status.
 
int getNumOf (EStatus check, int moduleID) const
 Counts and returns the number of channels od a module having a given status.
 
 ClassDef (TOPCalChannelMask, 1)
 ClassDef.
 

Private Attributes

EStatus m_status [c_numModules][c_numChannels] = {{ c_Active }}
 channel status
 

Detailed Description

Channel status for all 512 channels of 16 modules.

The Channel condition is stored as the enum EStatus with the convention: c_Active = 0 active channel c_Dead = 1 dead channel c_Noisy = 2 noisy channel. A simple method isActive has been implemented to return false if the channel has been masked for whatever reason and true if the channel is active.

Definition at line 29 of file TOPCalChannelMask.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

Sizes.

Enumerator
c_numModules 

number of modules

c_numChannels 

number of channels per module

Definition at line 172 of file TOPCalChannelMask.h.

172 {c_numModules = 16,
173 c_numChannels = 512
174 };
@ c_numChannels
number of channels per module
@ c_numModules
number of modules

◆ EStatus

enum EStatus

Status of the channel.

Definition at line 35 of file TOPCalChannelMask.h.

35 {c_Active = 0,
36 c_Dead = 1,
37 c_Noisy = 2
38 };

Constructor & Destructor Documentation

◆ TOPCalChannelMask()

TOPCalChannelMask ( )
inline

Default constructor.

Definition at line 43 of file TOPCalChannelMask.h.

43{}

Member Function Documentation

◆ getActiveFraction() [1/2]

double getActiveFraction ( ) const
inline

Returns fraction of active channels.

Definition at line 118 of file TOPCalChannelMask.h.

119 {
120 return static_cast<double>(getNumOfActiveChannels()) / static_cast<double>(c_numModules) / static_cast<double>(c_numChannels);
121 }
int getNumOfActiveChannels() const
Returns number of active channels.

◆ getActiveFraction() [2/2]

double getActiveFraction ( int  moduleID) const
inline

Returns fraction of module active channels.

Definition at line 141 of file TOPCalChannelMask.h.

142 {
143 return static_cast<double>(getNumOfActiveChannels(moduleID)) / static_cast<double>(c_numChannels);
144 }

◆ getNumOfActiveChannels() [1/2]

int getNumOfActiveChannels ( ) const
inline

Returns number of active channels.

Definition at line 103 of file TOPCalChannelMask.h.

103{return getNumOf(c_Active);}
int getNumOf(EStatus check) const
Counts and returns the number of channels having a given status.

◆ getNumOfActiveChannels() [2/2]

int getNumOfActiveChannels ( int  moduleID) const
inline

Returns number of module active channels.

Definition at line 126 of file TOPCalChannelMask.h.

126{return getNumOf(c_Active, moduleID);}

◆ getNumOfChannels()

int getNumOfChannels ( ) const
inline

Returns number of all channels.

Definition at line 93 of file TOPCalChannelMask.h.

◆ getNumOfDeadChannels() [1/2]

int getNumOfDeadChannels ( ) const
inline

Returns number of dead channels.

Definition at line 108 of file TOPCalChannelMask.h.

108{return getNumOf(c_Dead);}

◆ getNumOfDeadChannels() [2/2]

int getNumOfDeadChannels ( int  moduleID) const
inline

Returns number of module dead channels.

Definition at line 131 of file TOPCalChannelMask.h.

131{return getNumOf(c_Dead, moduleID);}

◆ getNumOfModuleChannels()

int getNumOfModuleChannels ( ) const
inline

Returns number of channels in a module.

Definition at line 98 of file TOPCalChannelMask.h.

98{return c_numChannels;}

◆ getNumOfNoisyChannels() [1/2]

int getNumOfNoisyChannels ( ) const
inline

Returns number of noisy channels.

Definition at line 113 of file TOPCalChannelMask.h.

113{return getNumOf(c_Noisy);}

◆ getNumOfNoisyChannels() [2/2]

int getNumOfNoisyChannels ( int  moduleID) const
inline

Returns number of module noisy channels.

Definition at line 136 of file TOPCalChannelMask.h.

136{return getNumOf(c_Noisy, moduleID);}

Member Data Documentation

◆ m_status

EStatus m_status[c_numModules][c_numChannels] = {{ c_Active }}
private

channel status

Definition at line 176 of file TOPCalChannelMask.h.


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