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 setMaskedPixels ()
 Set masked pixels from DB.
 
void setDeadPixels ()
 Set dead pixels from DB.
 
void maskSinglePixel (VxdID id, unsigned int uid, unsigned int vid)
 Mask single pixel.
 
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 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

std::unique_ptr< DBObjPtr< PXDMaskedPixelPar > > m_maskedPixelsFromDB
 Masked pixels retrieved from DB.
 
std::unique_ptr< DBObjPtr< PXDDeadPixelPar > > m_deadPixelsFromDB
 Dead pixels retrieved from DB.
 
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 27 of file PXDPixelMasker.h.

Constructor & Destructor Documentation

◆ PXDPixelMasker()

PXDPixelMasker ( )
inlineprivate

Singleton class, hidden constructor.

Definition at line 77 of file PXDPixelMasker.h.

77{};

Member Function Documentation

◆ getDeadPixelParameters()

const PXDDeadPixelPar & getDeadPixelParameters ( ) const
inline

Return dead pixel payload.

Definition at line 72 of file PXDPixelMasker.h.

72{return m_deadPixels;}
PXDDeadPixelPar m_deadPixels
List of masked pixels.

◆ getInstance()

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

Main (and only) way to access the PXDPixelMasker.

Definition at line 35 of file PXDPixelMasker.cc.

36{
37 static std::unique_ptr<Belle2::PXD::PXDPixelMasker> instance(new Belle2::PXD::PXDPixelMasker());
38 return *instance;
39}
Singleton class for managing pixel masking for the PXD.

◆ getMaskedPixelParameters()

const PXDMaskedPixelPar & getMaskedPixelParameters ( ) const
inline

Return masked pixel payload.

Definition at line 69 of file PXDPixelMasker.h.

69{return m_maskedPixels;}
PXDMaskedPixelPar m_maskedPixels
List of masked pixels.

◆ initialize()

void initialize ( )

Initialize the PXDPixelMasker.

Definition at line 17 of file PXDPixelMasker.cc.

18{
19 m_maskedPixelsFromDB = unique_ptr<Belle2::DBObjPtr<Belle2::PXDMaskedPixelPar>>(new Belle2::DBObjPtr<Belle2::PXDMaskedPixelPar>());
20
21 if ((*m_maskedPixelsFromDB).isValid()) {
23 (*m_maskedPixelsFromDB).addCallback(this, &Belle2::PXD::PXDPixelMasker::setMaskedPixels);
24 }
25
26 m_deadPixelsFromDB = unique_ptr<Belle2::DBObjPtr<Belle2::PXDDeadPixelPar>>(new Belle2::DBObjPtr<Belle2::PXDDeadPixelPar>());
27
28 if ((*m_deadPixelsFromDB).isValid()) {
30 (*m_deadPixelsFromDB).addCallback(this, &Belle2::PXD::PXDPixelMasker::setDeadPixels);
31 }
32}
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
std::unique_ptr< DBObjPtr< PXDDeadPixelPar > > m_deadPixelsFromDB
Dead pixels retrieved from DB.
void setMaskedPixels()
Set masked pixels from DB.
void setDeadPixels()
Set dead pixels from DB.
std::unique_ptr< DBObjPtr< PXDMaskedPixelPar > > m_maskedPixelsFromDB
Masked pixels retrieved from DB.

◆ 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 42 of file PXDPixelMasker.cc.

43{
45 m_maskedPixels.maskSinglePixel(id.getID(), uid * vCells + vid);
46}
void maskSinglePixel(unsigned short sensorID, unsigned int pixID)
Mask single pixel.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne 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

◆ 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 56 of file PXDPixelMasker.cc.

57{
58 auto sensorID = id.getID();
59 if (m_deadPixels.isDeadSensor(sensorID))
60 return true;
61
62 if (m_deadPixels.isDeadRow(sensorID, vid))
63 return true;
64
65 if (m_deadPixels.isDeadDrain(sensorID, uid * 4 + vid % 4))
66 return true;
67
69 if (m_deadPixels.isDeadSinglePixel(sensorID, uid * vCells + vid))
70 return true;
71
72 return false;
73}
bool isDeadSensor(unsigned short sensorID) const
Check whether a sensor is dead.
bool isDeadSinglePixel(unsigned short sensorID, unsigned int pixID) const
Check whether a single pixel is dead.
bool isDeadDrain(unsigned short sensorID, unsigned int drainID) const
Check whether a drain is dead.
bool isDeadRow(unsigned short sensorID, unsigned int vCellID) const
Check whether a row is dead.

◆ 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 50 of file PXDPixelMasker.cc.

51{
53 return m_maskedPixels.pixelOK(id.getID(), uid * vCells + vid);
54}
bool pixelOK(unsigned short sensorID, unsigned int pixID) const
Check whether a pixel on a given sensor is OK or not.

◆ setDeadPixels()

void setDeadPixels ( )

Set dead pixels from DB.

Definition at line 81 of file PXDPixelMasker.cc.

◆ setMaskedPixels()

void setMaskedPixels ( )

Set masked pixels from DB.

Definition at line 76 of file PXDPixelMasker.cc.

Member Data Documentation

◆ m_deadPixels

PXDDeadPixelPar m_deadPixels
private

List of masked pixels.

Definition at line 93 of file PXDPixelMasker.h.

◆ m_deadPixelsFromDB

std::unique_ptr<DBObjPtr<PXDDeadPixelPar> > m_deadPixelsFromDB
private

Dead pixels retrieved from DB.

Definition at line 87 of file PXDPixelMasker.h.

◆ m_maskedPixels

PXDMaskedPixelPar m_maskedPixels
private

List of masked pixels.

Definition at line 90 of file PXDPixelMasker.h.

◆ m_maskedPixelsFromDB

std::unique_ptr<DBObjPtr<PXDMaskedPixelPar> > m_maskedPixelsFromDB
private

Masked pixels retrieved from DB.

Definition at line 84 of file PXDPixelMasker.h.


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