Belle II Software  release-08-01-10
PXDMaskedPixelPar Class Reference

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

#include <PXDMaskedPixelPar.h>

Inheritance diagram for PXDMaskedPixelPar:
Collaboration 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. More...
 
bool pixelOK (unsigned short sensorID, unsigned int pixID) const
 Check whether a pixel on a given sensor is OK or not. More...
 
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 Function Documentation

◆ 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_map< unsigned short, MaskedSinglePixelsSet > m_MapSingles
Structure holding sets of masked single pixels for all sensors by sensor id (unsigned short).
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.


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