qupid 0.2
Quasi-Signal Generation Model for Pixelized Detector
Loading...
Searching...
No Matches
QPDigitizerSquare Class Reference

Uniform rectangular pixel grid centered on the origin: pixel (i, j) covers $ [i\,p_x - S_x/2,\ (i+1)\,p_x - S_x/2] \times
[j\,p_y - S_y/2,\ (j+1)\,p_y - S_y/2] $ with pitch $ p_x = S_x/n_x $, $ p_y = S_y/n_y $. More...

#include <QPDigitizerSquare.hpp>

Inheritance diagram for QPDigitizerSquare:
QPDigitizerBase

Public Member Functions

 QPDigitizerSquare (double sizex=1, double sizey=1, int npixx=1, int npixy=1)
 
virtual QPPixel * GetPixel (const int index)
 Pixel by linear index, decomposed as (index / npixx, index % npixx) and forwarded to GetPixel(int,int).
 
virtual QPPixel * GetPixel (const int i, const int j)
 Allocates and returns the pixel cell (i, j); every call produces a new QPPixel owned by the caller.
 
- Public Member Functions inherited from QPDigitizerBase
virtual ~QPDigitizerBase ()
 Does not delete the injected signals; see the class warning.
 
virtual void Delete ()
 Cleanup hook; currently a no-op.
 
void InjectSignal (QPSignalBase *signal)
 Hands a signal to the digitizer, which takes ownership: the default ClearSignal() deletes it.
 
QPSignalBase * GetSignal (int i) const
 Borrowed pointer to injected signal i; the digitizer keeps ownership.
 
int GetNSignal () const
 
void ClearSignal (bool removeall=true)
 Empties the signal store.
 
virtual double GetAnalogSignal (const double &x, const double &y)
 Summed signal density of all injected signals at (x, y), $ \sum_k A_k\, p_k(x, y) $.
 
std::deque< QPPixelBase * > GetFiredPixel (double threshold)
 Builds every pixel and keeps those whose digital signal exceeds threshold; the rest are deleted internally.
 
int GetNPixel () const
 
double GetSizeX () const
 
double GetSizeY () const
 
int GetNPixelX () const
 
int GetNPixelY () const
 

Friends

class QPGraphFactory
 Grants the visualization module access to the digitizer internals.
 

Additional Inherited Members

- Protected Member Functions inherited from QPDigitizerBase
 QPDigitizerBase (int npix)
 
- Protected Attributes inherited from QPDigitizerBase
double fSize [2]
 matrix extent {x, y}, µm
 
int fNpix [2]
 number of pixels {x, y}
 

Detailed Description

Uniform rectangular pixel grid centered on the origin: pixel (i, j) covers $ [i\,p_x - S_x/2,\ (i+1)\,p_x - S_x/2] \times
[j\,p_y - S_y/2,\ (j+1)\,p_y - S_y/2] $ with pitch $ p_x = S_x/n_x $, $ p_y = S_y/n_y $.

Lengths in µm.

Definition at line 13 of file QPDigitizerSquare.hpp.

Constructor & Destructor Documentation

◆ QPDigitizerSquare()

QPDigitizerSquare::QPDigitizerSquare ( double  sizex = 1,
double  sizey = 1,
int  npixx = 1,
int  npixy = 1 
)
Parameters
sizexmatrix extent along x, µm
sizeymatrix extent along y, µm
npixxnumber of pixels along x
npixynumber of pixels along y

Definition at line 4 of file QPDigitizerSquare.cpp.

References QPDigitizerBase::fNpix, and QPDigitizerBase::fSize.

Member Function Documentation

◆ GetPixel() [1/2]

QPPixel * QPDigitizerSquare::GetPixel ( const int  index)
virtual

Pixel by linear index, decomposed as (index / npixx, index % npixx) and forwarded to GetPixel(int,int).

Warning
The bounds check accepts index == npixx·npixy (it uses > instead of >=), and the quotient is validated against npixx although it ranges over the y count: the mapping is a clean bijection only for square grids (npixx == npixy).
Parameters
indexlinear pixel index
Returns
caller-owned new pixel, or nullptr when rejected

Reimplemented from QPDigitizerBase.

Definition at line 14 of file QPDigitizerSquare.cpp.

References QPDigitizerBase::fNpix, and GetPixel().

Referenced by GetPixel().

◆ GetPixel() [2/2]

QPPixel * QPDigitizerSquare::GetPixel ( const int  i,
const int  j 
)
virtual

Allocates and returns the pixel cell (i, j); every call produces a new QPPixel owned by the caller.

Warning
The upper-bound checks use fNpix < i rather than <=, so i == npixx and j == npixy are accepted and yield a one-past-the-end pixel outside the matrix.
Parameters
ipixel index along x
jpixel index along y
Returns
caller-owned new pixel, or nullptr when out of bounds

Reimplemented from QPDigitizerBase.

Definition at line 20 of file QPDigitizerSquare.cpp.

References QPDigitizerBase::fNpix, and QPDigitizerBase::fSize.

Friends And Related Symbol Documentation

◆ QPGraphFactory

friend class QPGraphFactory
friend

Grants the visualization module access to the digitizer internals.

Definition at line 47 of file QPDigitizerSquare.hpp.


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