Belle II Software development
Pixel Class Reference

Class to represent one pixel, used in clustering for fast access. More...

#include <Pixel.h>

Public Member Functions

 Pixel (unsigned int index=0)
 Construct using only an index, used for testing.
 
 Pixel (const PXDDigit *digit, unsigned int index)
 Construct from a given PXDDigit and its store index.
 
 Pixel (const PXDRawHit *rawhit, unsigned int index)
 Construct from a given PXDRawHit and its store index.
 
 Pixel (unsigned int index, unsigned short u, unsigned short v, float charge)
 Construct using an index, coordinates and charge.
 
bool operator< (const Pixel &b) const
 Comparison operator, sorting by row,column in ascending order.
 
bool operator<= (const Pixel &b) const
 Comparison operator, sorting by row,column in ascending order.
 
bool operator> (const Pixel &b) const
 Comparison operator, sorting by row,column in ascending order.
 
bool operator>= (const Pixel &b) const
 Comparison operator, sorting by row,column in ascending order.
 
bool operator== (const Pixel &b) const
 Equality operator.
 
unsigned short getU () const
 Return the CellID in u.
 
unsigned short getV () const
 Return the CellID in v.
 
float getCharge () const
 Return the Charge of the Pixel.
 
unsigned int getIndex () const
 Return the Index of the digit.
 
void setCharge (float newCharge)
 Adjust the charge of a pixel.
 

Private Attributes

unsigned int m_index
 Index of the corresponding PXDDigit in the StoreArray.
 
unsigned short m_u
 Cell ID in u.
 
unsigned short m_v
 Cell ID in v.
 
float m_charge
 Charge of the pixel.
 

Detailed Description

Class to represent one pixel, used in clustering for fast access.

This class is a wrapper around PXDDigit or PXDRawHit to provide ordered access. Ordering is row-wise: first all digits/rawhits belonging to the first row, ordered by column in ascending order.

The Pixel object contains a copy of the essential values of the PXDDigit or PXDRawHit to speed up lookup during sorting or clustering. PXDDigit or RawHit is not used directly as a) we need the index of the digit after clustering and the digit does not keep its own index and b) Inheriting from TObject makes the PXDDigit/PXDRawHit more than three times larger than this small class

Definition at line 36 of file Pixel.h.

Constructor & Destructor Documentation

◆ Pixel() [1/4]

Pixel ( unsigned int  index = 0)
inlineexplicit

Construct using only an index, used for testing.

Definition at line 39 of file Pixel.h.

39 : m_index(index), m_u(0), m_v(0),
40 m_charge(0) {}
unsigned int m_index
Index of the corresponding PXDDigit in the StoreArray.
Definition: Pixel.h:78
float m_charge
Charge of the pixel.
Definition: Pixel.h:84
unsigned short m_u
Cell ID in u.
Definition: Pixel.h:80
unsigned short m_v
Cell ID in v.
Definition: Pixel.h:82

◆ Pixel() [2/4]

Pixel ( const PXDDigit digit,
unsigned int  index 
)
inline

Construct from a given PXDDigit and its store index.

Definition at line 42 of file Pixel.h.

42 : m_index(index),
43 m_u(digit->getUCellID()), m_v(digit->getVCellID()),
44 m_charge(digit->getCharge()) {}

◆ Pixel() [3/4]

Pixel ( const PXDRawHit rawhit,
unsigned int  index 
)
inline

Construct from a given PXDRawHit and its store index.

Definition at line 46 of file Pixel.h.

46 : m_index(index),
47 m_u(rawhit->getColumn()), m_v(rawhit->getRow()),
48 m_charge(rawhit->getCharge()) {}

◆ Pixel() [4/4]

Pixel ( unsigned int  index,
unsigned short  u,
unsigned short  v,
float  charge 
)
inline

Construct using an index, coordinates and charge.

Definition at line 51 of file Pixel.h.

51 :
52 m_index(index), m_u(u), m_v(v), m_charge(charge) {}

Member Function Documentation

◆ getCharge()

float getCharge ( ) const
inline

Return the Charge of the Pixel.

Definition at line 70 of file Pixel.h.

70{ return m_charge; }

◆ getIndex()

unsigned int getIndex ( ) const
inline

Return the Index of the digit.

Definition at line 72 of file Pixel.h.

72{ return m_index; }

◆ getU()

unsigned short getU ( ) const
inline

Return the CellID in u.

Definition at line 66 of file Pixel.h.

66{ return m_u; }

◆ getV()

unsigned short getV ( ) const
inline

Return the CellID in v.

Definition at line 68 of file Pixel.h.

68{ return m_v; }

◆ operator<()

bool operator< ( const Pixel b) const
inline

Comparison operator, sorting by row,column in ascending order.

Definition at line 55 of file Pixel.h.

55{ return m_v < b.m_v || (m_v == b.m_v && m_u < b.m_u); }

◆ operator<=()

bool operator<= ( const Pixel b) const
inline

Comparison operator, sorting by row,column in ascending order.

Definition at line 57 of file Pixel.h.

57{ return m_v < b.m_v || (m_v == b.m_v && m_u <= b.m_u); }

◆ operator==()

bool operator== ( const Pixel b) const
inline

Equality operator.

Definition at line 63 of file Pixel.h.

63{ return m_v == b.m_v && m_u == b.m_u; }

◆ operator>()

bool operator> ( const Pixel b) const
inline

Comparison operator, sorting by row,column in ascending order.

Definition at line 59 of file Pixel.h.

59{ return b < *this; }

◆ operator>=()

bool operator>= ( const Pixel b) const
inline

Comparison operator, sorting by row,column in ascending order.

Definition at line 61 of file Pixel.h.

61{ return b <= *this; }

◆ setCharge()

void setCharge ( float  newCharge)
inline

Adjust the charge of a pixel.

Definition at line 74 of file Pixel.h.

74{ m_charge = newCharge; }

Member Data Documentation

◆ m_charge

float m_charge
private

Charge of the pixel.

Definition at line 84 of file Pixel.h.

◆ m_index

unsigned int m_index
private

Index of the corresponding PXDDigit in the StoreArray.

Definition at line 78 of file Pixel.h.

◆ m_u

unsigned short m_u
private

Cell ID in u.

Definition at line 80 of file Pixel.h.

◆ m_v

unsigned short m_v
private

Cell ID in v.

Definition at line 82 of file Pixel.h.


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