Belle II Software development
PXDPixelMasker Class Reference

Singleton class for managing pixel masking for the PXD. More...

#include <PXDPixelMasker.h>

Public Member Functions

void initialize ()
 Initialize the PXDPixelMasker.
 
void setPixelThresholds ()
 Set pixel threshold from DB.
 
void setPixelThresholds (PXDMaskedPixelPar maskedPixels)
 Set pixel threshold from masked pixels from DB.
 
void setMaskedPixels ()
 Set masked pixels from DB.
 
void setDeadPixels ()
 Set dead pixels from DB.
 
void setSinglePixelThreshold (VxdID id, unsigned int uid, unsigned int vid, unsigned short pixThr)
 Set threshold for single pixel.
 
void maskSinglePixel (VxdID id, unsigned int uid, unsigned int vid)
 Mask single pixel.
 
unsigned short getPixelThreshold (VxdID id, unsigned int uid, unsigned int vid) const
 Check whether a pixel on a given sensor is OK or not and get threshold.
 
bool pixelOK (VxdID id, unsigned int uid, unsigned int vid) const
 Check whether a pixel on a given sensor is OK or not.
 
bool pixelDead (VxdID id, unsigned int uid, unsigned int vid) const
 Check whether a pixel on a given sensor is dead or not.
 
const PXDPixelThresholdPargetPixelThresholdParameters () const
 Return masked pixel payload.
 
const PXDMaskedPixelPargetMaskedPixelParameters () const
 Return masked pixel payload.
 
const PXDDeadPixelPargetDeadPixelParameters () const
 Return dead pixel payload.
 

Static Public Member Functions

static PXDPixelMaskergetInstance ()
 Main (and only) way to access the PXDPixelMasker.
 

Private Member Functions

 PXDPixelMasker ()
 Singleton class, hidden constructor.
 
 PXDPixelMasker (const PXDPixelMasker &)=delete
 Singleton class, forbidden copy constructor.
 
PXDPixelMaskeroperator= (const PXDPixelMasker &)=delete
 Singleton class, forbidden assignment operator.
 

Private Attributes

DBObjPtr< PXDPixelThresholdParm_pixelThresholdsFromDB
 Pixel thresholds from DB.
 
DBObjPtr< PXDMaskedPixelParm_maskedPixelsFromDB
 Masked pixels retrieved from DB.
 
DBObjPtr< PXDDeadPixelParm_deadPixelsFromDB
 Dead pixels retrieved from DB.
 
PXDPixelThresholdPar m_pixelThresholds
 List of pixel threshold.
 
PXDMaskedPixelPar m_maskedPixels
 List of masked pixels.
 
PXDDeadPixelPar m_deadPixels
 List of masked pixels.
 

Detailed Description

Singleton class for managing pixel masking for the PXD.

Definition at line 28 of file PXDPixelMasker.h.

Constructor & Destructor Documentation

◆ PXDPixelMasker()

PXDPixelMasker ( )
inlineprivate

Singleton class, hidden constructor.

Definition at line 103 of file PXDPixelMasker.h.

103{};

Member Function Documentation

◆ getDeadPixelParameters()

const PXDDeadPixelPar & getDeadPixelParameters ( ) const
inline

Return dead pixel payload.

Definition at line 98 of file PXDPixelMasker.h.

98{return m_deadPixels;}

◆ getInstance()

Belle2::PXD::PXDPixelMasker & getInstance ( )
static

Main (and only) way to access the PXDPixelMasker.

Definition at line 41 of file PXDPixelMasker.cc.

42{
43 static std::unique_ptr<Belle2::PXD::PXDPixelMasker> instance(new Belle2::PXD::PXDPixelMasker());
44 return *instance;
45}

◆ getMaskedPixelParameters()

const PXDMaskedPixelPar & getMaskedPixelParameters ( ) const
inline

Return masked pixel payload.

Definition at line 95 of file PXDPixelMasker.h.

95{return m_maskedPixels;}

◆ getPixelThreshold()

unsigned short getPixelThreshold ( Belle2::VxdID id,
unsigned int uid,
unsigned int vid ) const

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

Parameters
idVxdID of the sensor
uiduCell of single pixel
vidvCell of single pixel
Returns
charge threshold of the single pixel.

Definition at line 60 of file PXDPixelMasker.cc.

61{
63 return m_pixelThresholds.getPixelThreshold(id.getID(), uid * vCells + vid);
64}
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a reference to the SensorInfo of a given SensorID.
Definition GeoCache.cc:67
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition GeoCache.cc:214
int getVCells() const
Return number of pixel/strips in v direction.
int getID(const std::vector< double > &breaks, double t)
get id of the time point t
Definition calibTools.h:60

◆ getPixelThresholdParameters()

const PXDPixelThresholdPar & getPixelThresholdParameters ( ) const
inline

Return masked pixel payload.

Definition at line 92 of file PXDPixelMasker.h.

92{return m_pixelThresholds;}

◆ initialize()

void initialize ( )

Initialize the PXDPixelMasker.

Definition at line 17 of file PXDPixelMasker.cc.

18{
19
20 if ((m_pixelThresholdsFromDB).isValid()) {
21 setPixelThresholds();
22 (m_pixelThresholdsFromDB).addCallback(this, &Belle2::PXD::PXDPixelMasker::setPixelThresholds);
23 }
24
25 if ((m_maskedPixelsFromDB).isValid()) {
26 setMaskedPixels();
27 (m_maskedPixelsFromDB).addCallback(this, &Belle2::PXD::PXDPixelMasker::setMaskedPixels);
28 if (!(m_pixelThresholdsFromDB).isValid() or !(m_pixelThresholdsFromDB)->getPixelThresholdMap().size()) {
29 setPixelThresholds(m_maskedPixels);
30 (m_pixelThresholdsFromDB).addCallback(this, &Belle2::PXD::PXDPixelMasker::setPixelThresholds);
31 }
32 }
33
34 if ((m_deadPixelsFromDB).isValid()) {
35 setDeadPixels();
36 (m_deadPixelsFromDB).addCallback(this, &Belle2::PXD::PXDPixelMasker::setDeadPixels);
37 }
38}
void setMaskedPixels()
Set masked pixels from DB.
void setDeadPixels()
Set dead pixels from DB.
void setPixelThresholds()
Set pixel threshold from DB.
bool isValid(EForwardBackward eForwardBackward)
Check whether the given enum instance is one of the valid values.

◆ maskSinglePixel()

void maskSinglePixel ( Belle2::VxdID id,
unsigned int uid,
unsigned int vid )

Mask single pixel.

Parameters
idVxdID of the required sensor
uiduCell of single pixel to mask
vidvCell of single pixel to mask

Definition at line 54 of file PXDPixelMasker.cc.

55{
57 m_maskedPixels.maskSinglePixel(id.getID(), uid * vCells + vid);
58}

◆ pixelDead()

bool pixelDead ( Belle2::VxdID id,
unsigned int uid,
unsigned int vid ) const

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

Parameters
idVxdID of the sensor
uiduCell of single pixel
vidvCell of single pixel
Returns
true if pixel DEAD, otherwise false.

Definition at line 72 of file PXDPixelMasker.cc.

73{
74 auto sensorID = id.getID();
75 if (m_deadPixels.isDeadSensor(sensorID))
76 return true;
77
78 if (m_deadPixels.isDeadRow(sensorID, vid))
79 return true;
80
81 if (m_deadPixels.isDeadDrain(sensorID, uid * 4 + vid % 4))
82 return true;
83
85 if (m_deadPixels.isDeadSinglePixel(sensorID, uid * vCells + vid))
86 return true;
87
88 return false;
89}

◆ pixelOK()

bool pixelOK ( Belle2::VxdID id,
unsigned int uid,
unsigned int vid ) const

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

Parameters
idVxdID of the sensor
uiduCell of single pixel
vidvCell of single pixel
Returns
true if pixel is OK, otherwise false.

Definition at line 66 of file PXDPixelMasker.cc.

67{
69 return (m_pixelThresholds.getPixelThreshold(id.getID(), uid * vCells + vid) < 255);
70}

◆ setDeadPixels()

void setDeadPixels ( )

Set dead pixels from DB.

Definition at line 113 of file PXDPixelMasker.cc.

114{
115 m_deadPixels = *m_deadPixelsFromDB;
116}

◆ setMaskedPixels()

void setMaskedPixels ( )

Set masked pixels from DB.

Definition at line 108 of file PXDPixelMasker.cc.

109{
110 m_maskedPixels = *m_maskedPixelsFromDB;
111}

◆ setPixelThresholds() [1/2]

void setPixelThresholds ( )

Set pixel threshold from DB.

Definition at line 103 of file PXDPixelMasker.cc.

104{
105 m_pixelThresholds = *m_pixelThresholdsFromDB;
106}

◆ setPixelThresholds() [2/2]

void setPixelThresholds ( PXDMaskedPixelPar maskedPixels)

Set pixel threshold from masked pixels from DB.

Definition at line 91 of file PXDPixelMasker.cc.

92{
93 auto maskedPixelMap = maskedPixels.getMaskedPixelMap();
94 for (auto maskedSingles = maskedPixelMap.begin(); maskedSingles != maskedPixelMap.end(); maskedSingles++) {
95 const auto& sensorID = maskedSingles->first;
96 const auto& singles = maskedSingles->second;
97 for (const auto& single : singles) {
98 m_pixelThresholds.setSinglePixelThreshold(sensorID, single, 255);
99 }
100 }
101}

◆ setSinglePixelThreshold()

void setSinglePixelThreshold ( Belle2::VxdID id,
unsigned int uid,
unsigned int vid,
unsigned short pixThr )

Set threshold for single pixel.

Parameters
idVxdID of the required sensor
uiduCell of single pixel to mask
vidvCell of single pixel to mask
pixThrcharge threshold of the single pixel

Definition at line 47 of file PXDPixelMasker.cc.

49{
51 m_pixelThresholds.setSinglePixelThreshold(id.getID(), uid * vCells + vid, pixThr);
52}

Member Data Documentation

◆ m_deadPixels

PXDDeadPixelPar m_deadPixels
private

List of masked pixels.

Definition at line 125 of file PXDPixelMasker.h.

◆ m_deadPixelsFromDB

DBObjPtr<PXDDeadPixelPar> m_deadPixelsFromDB
private

Dead pixels retrieved from DB.

Definition at line 116 of file PXDPixelMasker.h.

◆ m_maskedPixels

PXDMaskedPixelPar m_maskedPixels
private

List of masked pixels.

Definition at line 122 of file PXDPixelMasker.h.

◆ m_maskedPixelsFromDB

DBObjPtr<PXDMaskedPixelPar> m_maskedPixelsFromDB
private

Masked pixels retrieved from DB.

Definition at line 113 of file PXDPixelMasker.h.

◆ m_pixelThresholds

PXDPixelThresholdPar m_pixelThresholds
private

List of pixel threshold.

Definition at line 119 of file PXDPixelMasker.h.

◆ m_pixelThresholdsFromDB

DBObjPtr<PXDPixelThresholdPar> m_pixelThresholdsFromDB
private

Pixel thresholds from DB.

Definition at line 110 of file PXDPixelMasker.h.


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