Belle II Software development
PixelMasks Class Reference

Pixel masks of a single module. More...

#include <PixelMasks.h>

Public Member Functions

 PixelMasks (int moduleID)
 Constructor: all pixels are turned on (active)
 
void set (int pixelID, bool value)
 Sets mask value for a given pixel.
 
void setPixelOff (int pixelID)
 Turns given pixel off.
 
int getModuleID () const
 Returns slot ID.
 
unsigned getNumPixels () const
 Returns number of pixels.
 
bool isActive (int pixelID) const
 Checks if pixel is active.
 
const std::vector< bool > & getMasks () const
 Returns pixel masks of entire module.
 

Private Attributes

int m_moduleID = 0
 slot ID
 
std::vector< bool > m_masks
 pixel masks (true for active), index = pixelID -1
 

Detailed Description

Pixel masks of a single module.

Definition at line 22 of file PixelMasks.h.

Constructor & Destructor Documentation

◆ PixelMasks()

PixelMasks ( int  moduleID)
explicit

Constructor: all pixels are turned on (active)

Parameters
moduleIDslot ID

Definition at line 20 of file PixelMasks.cc.

20 : m_moduleID(moduleID)
21 {
22 const auto* geo = TOPGeometryPar::Instance()->getGeometry();
23 if (not geo->isModuleIDValid(moduleID)) {
24 B2FATAL("TOP::PixelMasks: invalid slot number, moduleID = " << moduleID);
25 return;
26 }
27 int numPixels = geo->getModule(m_moduleID).getPMTArray().getNumPixels();
28 m_masks.resize(numPixels, true);
29 }
std::vector< bool > m_masks
pixel masks (true for active), index = pixelID -1
Definition: PixelMasks.h:73
const TOPGeometry * getGeometry() const
Returns pointer to geometry object using basf2 units.
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.

Member Function Documentation

◆ getMasks()

const std::vector< bool > & getMasks ( ) const
inline

Returns pixel masks of entire module.

Returns
vector of pixel masks

Definition at line 68 of file PixelMasks.h.

68{return m_masks;}

◆ getModuleID()

int getModuleID ( ) const
inline

Returns slot ID.

Returns
slot ID

Definition at line 49 of file PixelMasks.h.

49{return m_moduleID;}

◆ getNumPixels()

unsigned getNumPixels ( ) const
inline

Returns number of pixels.

Returns
number of pixels

Definition at line 55 of file PixelMasks.h.

55{return m_masks.size();}

◆ isActive()

bool isActive ( int  pixelID) const
inline

Checks if pixel is active.

Parameters
pixelIDpixel ID (1-based)
Returns
true if active

Definition at line 85 of file PixelMasks.h.

86 {
87 unsigned k = pixelID - 1;
88 if (k < m_masks.size()) return m_masks[k];
89 return false;
90 }

◆ set()

void set ( int  pixelID,
bool  value 
)
inline

Sets mask value for a given pixel.

Parameters
pixelIDpixel ID (1-based)
valuetrue to set it active, false to turn it off

Definition at line 79 of file PixelMasks.h.

80 {
81 unsigned k = pixelID - 1;
82 if (k < m_masks.size()) m_masks[k] = value;
83 }

◆ setPixelOff()

void setPixelOff ( int  pixelID)
inline

Turns given pixel off.

Parameters
pixelIDpixel ID (1-based)

Definition at line 43 of file PixelMasks.h.

43{set(pixelID, false);}
void set(int pixelID, bool value)
Sets mask value for a given pixel.
Definition: PixelMasks.h:79

Member Data Documentation

◆ m_masks

std::vector<bool> m_masks
private

pixel masks (true for active), index = pixelID -1

Definition at line 73 of file PixelMasks.h.

◆ m_moduleID

int m_moduleID = 0
private

slot ID

Definition at line 72 of file PixelMasks.h.


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