allpix::PixelDetectorModel
Module: Detector models
Model of a generic pixel detector. This model is further extended by specialized pixel detector models.
#include <PixelDetectorModel.hpp>
Inherits from allpix::DetectorModel
Inherited by allpix::HexagonalPixelDetectorModel
Public Functions
Name | |
---|---|
PixelDetectorModel(std::string type, const std::shared_ptr< DetectorAssembly > & assembly, const ConfigReader & reader, const Configuration & config) Constructs the pixel detector model. |
|
virtual bool | isWithinSensor(const ROOT::Math::XYZPoint & local_pos) const override Returns if a local position is within the sensitive device. |
virtual bool | isOnSensorBoundary(const ROOT::Math::XYZPoint & local_pos) const override Returns if a local position is on the sensor boundary. |
virtual ROOT::Math::XYZPoint | getSensorIntercept(const ROOT::Math::XYZPoint & inside, const ROOT::Math::XYZPoint & outside) const override Calculate exit point of step outside sensor volume from one point inside the sensor (before step) and one point outside (after step). |
virtual bool | isWithinMatrix(const Pixel::Index & pixel_index) const override Returns if a pixel index is within the grid of pixels defined for the device. |
virtual bool | isWithinMatrix(const int x, const int y) const override Returns if a set of pixel coordinates is within the grid of pixels defined for the device. |
virtual bool | isWithinMatrix(const ROOT::Math::XYZPoint & position) const override Returns if a position is within the grid of pixels defined for the device. |
virtual ROOT::Math::XYZPoint | getPixelCenter(const int x, const int y) const override Returns a pixel center in local coordinates. |
virtual std::pair< int, int > | getPixelIndex(const ROOT::Math::XYZPoint & local_pos) const override Return X,Y indices of a pixel corresponding to a local position in a sensor. |
virtual std::set< Pixel::Index > | getNeighbors(const Pixel::Index & idx, const size_t distance) const override Return a set containing all pixels neighboring the given one with a configurable maximum distance. |
virtual bool | areNeighbors(const Pixel::Index & seed, const Pixel::Index & entrant, const size_t distance) const override Check if two pixel indices are neighbors to each other. |
Protected Functions
Name | |
---|---|
virtual void | validate() override |
Additional inherited members
Public Classes inherited from allpix::DetectorModel
Name | |
---|---|
class | Implant Helper class to hold implant definitions for a detector model. |
Public Functions inherited from allpix::DetectorModel
Name | |
---|---|
std::shared_ptr< DetectorModel > | factory(const std::string & name, const ConfigReader & reader) Factory to dynamically create detector model objects. |
template <class T > bool |
is() Helper method to determine if this detector model is of a given type The template parameter needs to be specified specifically, i.e. if(model->is |
DetectorModel(std::string type, std::shared_ptr< DetectorAssembly > assembly, const ConfigReader & reader, const Configuration & config) Constructs the base detector model. |
|
virtual | ~DetectorModel() =default Essential virtual destructor. |
std::vector< Configuration > | getConfigurations() const Get the configuration associated with this model. |
const std::string & | getType() const Get the type of the model. |
const std::shared_ptr< DetectorAssembly > | getAssembly() const |
virtual ROOT::Math::XYZPoint | getMatrixCenter() const Get local coordinate of the position and rotation center in global frame. |
virtual ROOT::Math::XYZPoint | getModelCenter() const Get local coordinate of the geometric center of the model. |
virtual ROOT::Math::XYZVector | getSize() const Get size of the wrapper box around the model that contains all elements. |
ROOT::Math::DisplacementVector2D< ROOT::Math::Cartesian2D< unsigned int > > | getNPixels() const Get number of pixels (replicated blocks in generic sensors) |
const ROOT::Math::XYVector & | getPixelSize() const Get size of a single pixel. |
Pixel::Type | getPixelType() const Get type of the pixels. |
const std::vector< Implant > & | getImplants() const Return all implants. |
virtual ROOT::Math::XYZVector | getMatrixSize() const Get total size of the pixel grid. |
virtual ROOT::Math::XYZVector | getSensorSize() const Get size of the sensor. |
virtual ROOT::Math::XYZPoint | getSensorCenter() const Get center of the sensor in local coordinates. |
SensorMaterial | getSensorMaterial() const Get the material of the sensor. |
virtual ROOT::Math::XYZVector | getChipSize() const Get size of the chip. |
virtual ROOT::Math::XYZPoint | getChipCenter() const Get center of the chip in local coordinates. |
virtual std::vector< SupportLayer > | getSupportLayers() const Return all layers of support. |
virtual std::optional< Implant > | isWithinImplant(const ROOT::Math::XYZPoint & local_pos) const Returns if a local position is within the pixel implant region of the sensitive device. |
ROOT::Math::XYZPoint | getImplantIntercept(const Implant & implant, const ROOT::Math::XYZPoint & outside, const ROOT::Math::XYZPoint & inside) const Calculate entry point of step into impant volume from one point outside the implant (before step) and one point inside (after step). |
Protected Functions inherited from allpix::DetectorModel
Name | |
---|---|
void | setNPixels(ROOT::Math::DisplacementVector2D< ROOT::Math::Cartesian2D< unsigned int » val) Set number of pixels (replicated blocks in generic sensors) |
void | setPixelSize(ROOT::Math::XYVector val) Set the size of a pixel. |
void | setSensorThickness(double val) Set the thickness of the sensor. |
void | setSensorExcessTop(double val) Set the excess at the top of the sensor (positive y-coordinate) |
void | setSensorExcessRight(double val) Set the excess at the right of the sensor (positive x-coordinate) |
void | setSensorExcessBottom(double val) Set the excess at the bottom of the sensor (negative y-coordinate) |
void | setSensorExcessLeft(double val) Set the excess at the left of the sensor (negative x-coordinate) |
Protected Attributes inherited from allpix::DetectorModel
Name | |
---|---|
std::string | type_ |
ROOT::Math::DisplacementVector2D< ROOT::Math::Cartesian2D< unsigned int > > | number_of_pixels_ |
ROOT::Math::XYVector | pixel_size_ |
Pixel::Type | pixel_type_ |
double | sensor_thickness_ |
std::array< double, 4 > | sensor_excess_ |
SensorMaterial | sensor_material_ |
std::shared_ptr< DetectorAssembly > | assembly_ |
std::vector< Implant > | implants_ |
std::vector< SupportLayer > | support_layers_ |
Public Functions Documentation
function PixelDetectorModel
explicit PixelDetectorModel(
std::string type,
const std::shared_ptr< DetectorAssembly > & assembly,
const ConfigReader & reader,
const Configuration & config
)
Constructs the pixel detector model.
Parameters:
- type Name of the model type
- assembly Detector assembly object with information about ASIC and packaging
- reader Configuration reader with description of the model
- config Configuration reference holding the unnamed section of detector configuration
function isWithinSensor
virtual bool isWithinSensor(
const ROOT::Math::XYZPoint & local_pos
) const override
Returns if a local position is within the sensitive device.
Parameters:
- local_pos Position in local coordinates of the detector model
Return: True if a local position is within the sensor, false otherwise
Reimplements: allpix::DetectorModel::isWithinSensor
The definition of inside the sensor is determined by the detector model
function isOnSensorBoundary
virtual bool isOnSensorBoundary(
const ROOT::Math::XYZPoint & local_pos
) const override
Returns if a local position is on the sensor boundary.
Parameters:
- local_pos Position in local coordinates of the detector model
Return: True if a local position is on the sensor boundary, false otherwise
Reimplements: allpix::DetectorModel::isOnSensorBoundary
The definition of the sensor boundary is determined by the detector model
function getSensorIntercept
virtual ROOT::Math::XYZPoint getSensorIntercept(
const ROOT::Math::XYZPoint & inside,
const ROOT::Math::XYZPoint & outside
) const override
Calculate exit point of step outside sensor volume from one point inside the sensor (before step) and one point outside (after step).
Parameters:
- inside Position before the step, inside the sensor volume
- outside Position after the step, outside the sensor volume
Exceptions:
- std::invalid_argument if no intersection of track segment with sensor volume can be found
Return: Exit point of the sensor in local coordinates
Note: This method uses the Liang-Barsky clipping of a line segment with a box
Reimplements: allpix::DetectorModel::getSensorIntercept
function isWithinMatrix
virtual bool isWithinMatrix(
const Pixel::Index & pixel_index
) const override
Returns if a pixel index is within the grid of pixels defined for the device.
Parameters:
- pixel_index Pixel index to be checked
Return: True if pixel_index is within the pixel grid, false otherwise
Reimplements: allpix::DetectorModel::isWithinMatrix
The definition of the pixel grid size is determined by the detector model
function isWithinMatrix
virtual bool isWithinMatrix(
const int x,
const int y
) const override
Returns if a set of pixel coordinates is within the grid of pixels defined for the device.
Parameters:
- x X- (or column-) coordinate to be checked
- y Y- (or row-) coordinate to be checked
Return: True if pixel coordinates are within the pixel grid, false otherwise
Reimplements: allpix::DetectorModel::isWithinMatrix
The definition of the pixel grid size is determined by the detector model
function isWithinMatrix
virtual bool isWithinMatrix(
const ROOT::Math::XYZPoint & position
) const override
Returns if a position is within the grid of pixels defined for the device.
Parameters:
- position Position in local coordinates of the detector model
Return: True if position within the pixel grid, false otherwise
Reimplements: allpix::DetectorModel::isWithinMatrix
Faster implementation of matrix lookup for local coordinate positions than going through the pixel index This is quite easy for rectangular pixels and matrices.
function getPixelCenter
virtual ROOT::Math::XYZPoint getPixelCenter(
const int x,
const int y
) const override
Returns a pixel center in local coordinates.
Parameters:
- x X- (or column-) coordinate of the pixel
- y Y- (or row-) coordinate of the pixel
Return: Coordinates of the pixel center
Reimplements: allpix::DetectorModel::getPixelCenter
function getPixelIndex
virtual std::pair< int, int > getPixelIndex(
const ROOT::Math::XYZPoint & local_pos
) const override
Return X,Y indices of a pixel corresponding to a local position in a sensor.
Parameters:
- local_pos Position in local coordinates of the detector model
Return: X,Y pixel indices
Note: No checks are performed on whether these indices represent an existing pixel or are within the pixel matrix.
Reimplements: allpix::DetectorModel::getPixelIndex
function getNeighbors
virtual std::set< Pixel::Index > getNeighbors(
const Pixel::Index & idx,
const size_t distance
) const override
Return a set containing all pixels neighboring the given one with a configurable maximum distance.
Parameters:
- idx Index of the pixel in question
- distance Distance for pixels to be considered neighbors
Return: Set of neighboring pixel indices, including the initial pixel
Note: The returned set should always also include the initial pixel indices the neighbors are calculated for
Reimplements: allpix::DetectorModel::getNeighbors
function areNeighbors
virtual bool areNeighbors(
const Pixel::Index & seed,
const Pixel::Index & entrant,
const size_t distance
) const override
Check if two pixel indices are neighbors to each other.
Parameters:
- seed Initial pixel index
- entrant Entrant pixel index to be tested
- distance Distance for pixels to be considered neighbors
Return: Boolean whether pixels are neighbors or not
Reimplements: allpix::DetectorModel::areNeighbors
Protected Functions Documentation
function validate
virtual void validate() override
Reimplements: allpix::DetectorModel::validate
Updated on 2024-12-13 at 08:31:37 +0000