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

Abstract pixel-matrix digitizer: owns the injected signals and the matrix geometry; concrete classes define the pixel layout. More...

#include <QPDigitizerBase.hpp>

Inheritance diagram for QPDigitizerBase:
QPDigitizerSquare

Public Member Functions

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) $.
 
virtual QPPixelBase * GetPixel (const int index)
 Pixel by linear index.
 
virtual QPPixelBase * GetPixel (const int i, const int j)
 Pixel by grid index.
 
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
 

Protected Member Functions

 QPDigitizerBase (int npix)
 

Protected Attributes

double fSize [2]
 matrix extent {x, y}, µm
 
int fNpix [2]
 number of pixels {x, y}
 

Detailed Description

Abstract pixel-matrix digitizer: owns the injected signals and the matrix geometry; concrete classes define the pixel layout.

Lengths are in µm, amplitudes and thresholds in electrons.

Warning
The destructor does not delete the injected signals; call ClearSignal() before destroying the digitizer, or the signals leak.

Definition at line 15 of file QPDigitizerBase.hpp.

Constructor & Destructor Documentation

◆ ~QPDigitizerBase()

QPDigitizerBase::~QPDigitizerBase ( )
virtual

Does not delete the injected signals; see the class warning.

Definition at line 8 of file QPDigitizerBase.cpp.

◆ QPDigitizerBase()

QPDigitizerBase::QPDigitizerBase ( int  npix)
protected
Parameters
npixtotal number of pixels

Definition at line 6 of file QPDigitizerBase.cpp.

Member Function Documentation

◆ Delete()

void QPDigitizerBase::Delete ( )
virtual

Cleanup hook; currently a no-op.

Definition at line 10 of file QPDigitizerBase.cpp.

◆ InjectSignal()

void QPDigitizerBase::InjectSignal ( QPSignalBase *  signal)

Hands a signal to the digitizer, which takes ownership: the default ClearSignal() deletes it.

Parameters
signalheap-allocated signal

Definition at line 12 of file QPDigitizerBase.cpp.

Referenced by QPMonteCarlo::Shoot().

◆ GetSignal()

QPSignalBase * QPDigitizerBase::GetSignal ( int  i) const

Borrowed pointer to injected signal i; the digitizer keeps ownership.

Parameters
isignal index
Returns
the signal, or nullptr when i is outside [0, GetNSignal())

Definition at line 25 of file QPDigitizerBase.cpp.

References GetNSignal().

Referenced by GetAnalogSignal(), and QPPixelBase::GetDigitalSignal().

◆ GetNSignal()

int QPDigitizerBase::GetNSignal ( ) const
Returns
number of injected signals

Definition at line 30 of file QPDigitizerBase.cpp.

Referenced by GetAnalogSignal(), QPPixelBase::GetDigitalSignal(), and GetSignal().

◆ ClearSignal()

void QPDigitizerBase::ClearSignal ( bool  removeall = true)

Empties the signal store.

Parameters
removeallwhen true (default), every injected signal is deleted; when false, only the pointers are dropped and ownership returns to the caller

Definition at line 34 of file QPDigitizerBase.cpp.

Referenced by QPMonteCarlo::Shoot().

◆ GetAnalogSignal()

double QPDigitizerBase::GetAnalogSignal ( const double &  x,
const double &  y 
)
virtual

Summed signal density of all injected signals at (x, y), $ \sum_k A_k\, p_k(x, y) $.

Parameters
xevaluation point x, µm
yevaluation point y, µm
Returns
charge surface density, electrons/µm²

Definition at line 59 of file QPDigitizerBase.cpp.

References GetNSignal(), QPSignalBase::GetSignal(), and GetSignal().

Referenced by QPGraphFactory::AnalogSignal().

◆ GetPixel() [1/2]

QPPixelBase * QPDigitizerBase::GetPixel ( const int  index)
virtual

Pixel by linear index.

The base implementation prints a warning and returns nullptr (stand-in for a pure virtual); concrete digitizers return a newly allocated pixel owned by the caller.

Parameters
indexlinear pixel index
Returns
caller-owned pixel, or nullptr

Reimplemented in QPDigitizerSquare.

Definition at line 16 of file QPDigitizerBase.cpp.

Referenced by QPGraphFactory::DigitalSignal(), QPGraphFactory::DigitizedSignal(), QPGraphFactory::DrawDigitalSignalText(), and GetFiredPixel().

◆ GetPixel() [2/2]

QPPixelBase * QPDigitizerBase::GetPixel ( const int  i,
const int  j 
)
virtual

Pixel by grid index.

Same contract as GetPixel(int): the base prints a warning and returns nullptr; implementations return a caller-owned pixel.

Parameters
ipixel index along x
jpixel index along y
Returns
caller-owned pixel, or nullptr

Reimplemented in QPDigitizerSquare.

Definition at line 20 of file QPDigitizerBase.cpp.

◆ GetFiredPixel()

std::deque< QPPixelBase * > QPDigitizerBase::GetFiredPixel ( double  threshold)

Builds every pixel and keeps those whose digital signal exceeds threshold; the rest are deleted internally.

Parameters
thresholdfiring threshold, electrons
Returns
deque of fired pixels, each owned by the caller (delete them); its size is the cluster size

Definition at line 43 of file QPDigitizerBase.cpp.

References QPPixelBase::GetDigitalSignal(), GetNPixel(), and GetPixel().

Referenced by QPMonteCarlo::Shoot().

◆ GetNPixel()

int QPDigitizerBase::GetNPixel ( ) const
inline
Returns
total number of pixels

Definition at line 68 of file QPDigitizerBase.hpp.

Referenced by GetFiredPixel().

◆ GetSizeX()

double QPDigitizerBase::GetSizeX ( ) const
inline
Returns
matrix extent along x, µm

Definition at line 71 of file QPDigitizerBase.hpp.

References fSize.

Referenced by QPGraphFactory::DrawDigitalSignalText().

◆ GetSizeY()

double QPDigitizerBase::GetSizeY ( ) const
inline

◆ GetNPixelX()

int QPDigitizerBase::GetNPixelX ( ) const
inline
Returns
number of pixels along x

Definition at line 75 of file QPDigitizerBase.hpp.

References fNpix.

Referenced by QPGraphFactory::DigitalSignal(), QPGraphFactory::DigitizedSignal(), and QPGraphFactory::DrawDigitalSignalText().

◆ GetNPixelY()

int QPDigitizerBase::GetNPixelY ( ) const
inline
Returns
number of pixels along y

Definition at line 77 of file QPDigitizerBase.hpp.

References fNpix.

Referenced by QPGraphFactory::DigitalSignal(), and QPGraphFactory::DigitizedSignal().

Member Data Documentation

◆ fSize

double QPDigitizerBase::fSize[2]
protected

matrix extent {x, y}, µm

Definition at line 82 of file QPDigitizerBase.hpp.

Referenced by QPDigitizerSquare::GetPixel(), GetSizeX(), GetSizeY(), and QPDigitizerSquare::QPDigitizerSquare().

◆ fNpix

int QPDigitizerBase::fNpix[2]
protected

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