Belle II Software development
PXDMaskedPixelPar Class Reference

The payload telling which PXD pixel to mask (ignore) More...

#include <PXDMaskedPixelPar.h>

Inheritance diagram for PXDMaskedPixelPar:

Public Types

typedef std::unordered_set< unsigned int > MaskedSinglePixelsSet
 Structure to hold set of masked single pixels indexed by their unique id (unsigned int), stored in hash table.
 

Public Member Functions

 PXDMaskedPixelPar ()
 Default constructor.
 
 ~PXDMaskedPixelPar ()
 Destructor.
 
void maskSinglePixel (unsigned short sensorID, unsigned int pixID)
 Mask single pixel.
 
bool pixelOK (unsigned short sensorID, unsigned int pixID) const
 Check whether a pixel on a given sensor is OK or not.
 
const std::unordered_map< unsigned short, MaskedSinglePixelsSet > & getMaskedPixelMap () const
 Return unordered_map with all masked single pixels in PXD.
 

Private Member Functions

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

Private Attributes

std::unordered_map< unsigned short, MaskedSinglePixelsSetm_MapSingles
 Structure holding sets of masked single pixels for all sensors by sensor id (unsigned short).
 

Detailed Description

The payload telling which PXD pixel to mask (ignore)

Definition at line 24 of file PXDMaskedPixelPar.h.

Member Typedef Documentation

◆ MaskedSinglePixelsSet

typedef std::unordered_set< unsigned int> MaskedSinglePixelsSet

Structure to hold set of masked single pixels indexed by their unique id (unsigned int), stored in hash table.

Definition at line 27 of file PXDMaskedPixelPar.h.

Constructor & Destructor Documentation

◆ PXDMaskedPixelPar()

PXDMaskedPixelPar ( )
inline

Default constructor.

Definition at line 30 of file PXDMaskedPixelPar.h.

30: m_MapSingles() {}
std::unordered_map< unsigned short, MaskedSinglePixelsSet > m_MapSingles
Structure holding sets of masked single pixels for all sensors by sensor id (unsigned short).

◆ ~PXDMaskedPixelPar()

~PXDMaskedPixelPar ( )
inline

Destructor.

Definition at line 32 of file PXDMaskedPixelPar.h.

32{}

Member Function Documentation

◆ getMaskedPixelMap()

const std::unordered_map< unsigned short, MaskedSinglePixelsSet > & getMaskedPixelMap ( ) const
inline

Return unordered_map with all masked single pixels in PXD.

Definition at line 77 of file PXDMaskedPixelPar.h.

77{return m_MapSingles;}

◆ maskSinglePixel()

void maskSinglePixel ( unsigned short  sensorID,
unsigned int  pixID 
)
inline

Mask single pixel.

Parameters
sensorIDunique ID of the sensor
pixIDunique ID of single pixel to mask

Definition at line 39 of file PXDMaskedPixelPar.h.

40 {
41 auto mapIterSingles = m_MapSingles.find(sensorID);
42 if (mapIterSingles != m_MapSingles.end()) {
43 // Already some masked single pixels on sensor
44 auto& singles = mapIterSingles->second;
45 // Only add pixel, if it is not already in
46 if (singles.find(pixID) == singles.end())
47 singles.insert(pixID);
48 } else {
49 // Create an empty set of masked single pixels
51 // pixID will be used to generate hash in unordered_set for quick access
52 singles.insert(pixID);
53 m_MapSingles[sensorID] = singles;
54 }
55 }
std::unordered_set< unsigned int > MaskedSinglePixelsSet
Structure to hold set of masked single pixels indexed by their unique id (unsigned int),...

◆ pixelOK()

bool pixelOK ( unsigned short  sensorID,
unsigned int  pixID 
) const
inline

Check whether a pixel on a given sensor is OK or not.

Parameters
sensorIDunique ID of the sensor
pixIDunique ID of single pixel to mask
Returns
true if pixel is not masked, otherwise false.

Definition at line 62 of file PXDMaskedPixelPar.h.

63 {
64 auto mapIterSingles = m_MapSingles.find(sensorID);
65 if (mapIterSingles != m_MapSingles.end()) {
66 // Found some masked single pixels on sensor
67 auto& singles = mapIterSingles->second;
68 // Look if this is a single masked pixel
69 if (singles.find(pixID) != singles.end())
70 return false;
71 }
72 // Pixel not found in the mask => pixel OK
73 return true;
74 }

Member Data Documentation

◆ m_MapSingles

std::unordered_map<unsigned short, MaskedSinglePixelsSet> m_MapSingles
private

Structure holding sets of masked single pixels for all sensors by sensor id (unsigned short).

Definition at line 82 of file PXDMaskedPixelPar.h.


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