allpix::DetectorModel
Module: Detector models
Base of all detector models. More…
#include <DetectorModel.hpp>
Inherited by allpix::PixelDetectorModel, allpix::RadialStripDetectorModel
Public Classes
Name | |
---|---|
class | Implant Helper class to hold implant definitions for a detector model. |
Public Functions
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 bool | isWithinSensor(const ROOT::Math::XYZPoint & local_pos) const =0 Returns if a local position is within the sensitive device. |
virtual bool | isOnSensorBoundary(const ROOT::Math::XYZPoint & local_pos) const =0 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 =0 Calculate exit point of step outside sensor volume from one point inside the sensor (before step) and one point outside (after step). |
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). |
virtual bool | isWithinMatrix(const Pixel::Index & pixel_index) const =0 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 =0 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 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 =0 Returns a pixel center in local coordinates. |
virtual std::pair< int, int > | getPixelIndex(const ROOT::Math::XYZPoint & local_pos) const =0 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 =0 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 =0 Check if two pixel indices are neighbors to each other. |
Protected Functions
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
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_ |
Detailed Description
class allpix::DetectorModel;
Base of all detector models.
Implements the minimum required for a detector model. A model always has a pixel grid with a specific pixel size. The pixel grid defines the base size of the sensor, chip and support. Excess length can be specified. Every part of the detector model has a defined center and size which can be overloaded by specialized detector models. The basic detector model also defines the rotation center in the local coordinate system.
Public Functions Documentation
function factory
static std::shared_ptr< DetectorModel > factory(
const std::string & name,
const ConfigReader & reader
)
Factory to dynamically create detector model objects.
Parameters:
- name Name of the model
- reader Reader with the configuration for this model
Return: Detector model instantiated from the configuration
function is
template <class T >
inline 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
Return: Boolean indication whether this model is of the given type or not
function DetectorModel
explicit DetectorModel(
std::string type,
std::shared_ptr< DetectorAssembly > assembly,
const ConfigReader & reader,
const Configuration & config
)
Constructs the base 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 holding the empty section of the configuration file
function ~DetectorModel
virtual ~DetectorModel() =default
Essential virtual destructor.
function getConfigurations
std::vector< Configuration > getConfigurations() const
Get the configuration associated with this model.
Return: Configuration used to construct the model
function getType
inline const std::string & getType() const
Get the type of the model.
Return: Model type
function getAssembly
inline const std::shared_ptr< DetectorAssembly > getAssembly() const
function getMatrixCenter
inline virtual ROOT::Math::XYZPoint getMatrixCenter() const
Get local coordinate of the position and rotation center in global frame.
Note: It can be a bit counter intuitive that this is not usually the origin, neither the geometric center of the model, but the geometric center of the sensitive part. This way, the position of the sensing element is invariant under rotations
Reimplemented by: allpix::HexagonalPixelDetectorModel::getMatrixCenter, allpix::RadialStripDetectorModel::getMatrixCenter
The center coordinate corresponds to the position in the global frame.
function getModelCenter
virtual ROOT::Math::XYZPoint getModelCenter() const
Get local coordinate of the geometric center of the model.
Note: This returns the center of the geometry model, i.e. including all support layers, passive readout chips et cetera.
function getSize
virtual ROOT::Math::XYZVector getSize() const
Get size of the wrapper box around the model that contains all elements.
Return: Size of the detector model
Reimplemented by: allpix::RadialStripDetectorModel::getSize
All elements of the model are covered by a box centered around DetectorModel::getModelCenter. This means that the extend of the model should be calculated using the geometrical center as reference, not the position returned by DetectorModel::getMatrixCenter.
function getNPixels
inline ROOT::Math::DisplacementVector2D< ROOT::Math::Cartesian2D< unsigned int > > getNPixels() const
Get number of pixels (replicated blocks in generic sensors)
Return: Number of two dimensional pixels
function getPixelSize
inline const ROOT::Math::XYVector & getPixelSize() const
Get size of a single pixel.
Return: Size of a pixel
function getPixelType
inline Pixel::Type getPixelType() const
Get type of the pixels.
Return: TYpe of the pixels indicating their shape
function getImplants
inline const std::vector< Implant > & getImplants() const
Return all implants.
Return: List of all the implants
function getMatrixSize
inline virtual ROOT::Math::XYZVector getMatrixSize() const
Get total size of the pixel grid.
Return: Size of the pixel grid
Note: This is basically a 2D method, but provided in 3D because it is primarily used there
Warning: The grid has zero thickness
Reimplemented by: allpix::HexagonalPixelDetectorModel::getMatrixSize
function getSensorSize
inline virtual ROOT::Math::XYZVector getSensorSize() const
Get size of the sensor.
Return: Size of the sensor
Calculated from pixel grid size, sensor excess and sensor thickness
function getSensorCenter
inline virtual ROOT::Math::XYZPoint getSensorCenter() const
Get center of the sensor in local coordinates.
Return: Center of the sensor
Center of the sensor with excess taken into account
function getSensorMaterial
inline SensorMaterial getSensorMaterial() const
Get the material of the sensor.
Return: Material of the sensor
function getChipSize
inline virtual ROOT::Math::XYZVector getChipSize() const
Get size of the chip.
Return: Size of the chip
Calculated from pixel grid size, sensor excess and chip thickness
function getChipCenter
inline virtual ROOT::Math::XYZPoint getChipCenter() const
Get center of the chip in local coordinates.
Return: Center of the chip
Center of the chip calculated from chip excess and sensor offset
function getSupportLayers
virtual std::vector< SupportLayer > getSupportLayers() const
Return all layers of support.
Return: List of all the support layers
This method internally computes the correct center of all the supports by stacking them in linear order on both the chip and the sensor side.
function isWithinSensor
virtual bool isWithinSensor(
const ROOT::Math::XYZPoint & local_pos
) const =0
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
Note: This method is purely virtual and must be implemented by the respective concrete detector model classes
Reimplemented by: allpix::PixelDetectorModel::isWithinSensor, allpix::RadialStripDetectorModel::isWithinSensor
function isOnSensorBoundary
virtual bool isOnSensorBoundary(
const ROOT::Math::XYZPoint & local_pos
) const =0
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
Note: This method is purely virtual and must be implemented by the respective concrete detector model classes
Reimplemented by: allpix::PixelDetectorModel::isOnSensorBoundary, allpix::RadialStripDetectorModel::isOnSensorBoundary
function getSensorIntercept
virtual ROOT::Math::XYZPoint getSensorIntercept(
const ROOT::Math::XYZPoint & inside,
const ROOT::Math::XYZPoint & outside
) const =0
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 is purely virtual and must be implemented by the respective concrete detector model classes
Reimplemented by: allpix::PixelDetectorModel::getSensorIntercept, allpix::RadialStripDetectorModel::getSensorIntercept
function isWithinImplant
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.
Parameters:
- local_pos Position in local coordinates of the detector model
Return: Either the implant in which the position is located, or false
If the implant is defined as 3D volume in the detector model, this method returns true if the given position is found within the implant volume. If the impland is configured with two dimensions only, i.e. an area on the sensor surface, the additional depth parameter is used to create a volume within which carriers are considered inside the implant.
function getImplantIntercept
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).
Parameters:
- implant The implant the intercept should be calculated for
- outside Position before the step, outside the implant volume
- inside Position after the step, inside the implant volume
Exceptions:
- std::invalid_argument if no intersection of track segment with implant volume can be found
Return: Entry point in implant in local coordinates of the sensor
function isWithinMatrix
virtual bool isWithinMatrix(
const Pixel::Index & pixel_index
) const =0
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
Note: This method is purely virtual and must be implemented by the respective concrete detector model classes
Reimplemented by: allpix::HexagonalPixelDetectorModel::isWithinMatrix, allpix::PixelDetectorModel::isWithinMatrix, allpix::RadialStripDetectorModel::isWithinMatrix
function isWithinMatrix
virtual bool isWithinMatrix(
const int x,
const int y
) const =0
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
Note: This method is purely virtual and must be implemented by the respective concrete detector model classes
Reimplemented by: allpix::HexagonalPixelDetectorModel::isWithinMatrix, allpix::PixelDetectorModel::isWithinMatrix, allpix::RadialStripDetectorModel::isWithinMatrix
function isWithinMatrix
inline virtual bool isWithinMatrix(
const ROOT::Math::XYZPoint & position
) const
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
Note: This method is virtual and can be implemented by detector models for faster calculations
Reimplemented by: allpix::PixelDetectorModel::isWithinMatrix
function getPixelCenter
virtual ROOT::Math::XYZPoint getPixelCenter(
const int x,
const int y
) const =0
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
Note: This method is purely virtual and must be implemented by the respective concrete detector model classes
Reimplemented by: allpix::HexagonalPixelDetectorModel::getPixelCenter, allpix::PixelDetectorModel::getPixelCenter, allpix::RadialStripDetectorModel::getPixelCenter
function getPixelIndex
virtual std::pair< int, int > getPixelIndex(
const ROOT::Math::XYZPoint & local_pos
) const =0
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.
- This method is purely virtual and must be implemented by the respective concrete detector model classes
Reimplemented by: allpix::PixelDetectorModel::getPixelIndex, allpix::HexagonalPixelDetectorModel::getPixelIndex, allpix::RadialStripDetectorModel::getPixelIndex
function getNeighbors
virtual std::set< Pixel::Index > getNeighbors(
const Pixel::Index & idx,
const size_t distance
) const =0
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
- This method is purely virtual and must be implemented by the respective concrete detector model classes
Reimplemented by: allpix::HexagonalPixelDetectorModel::getNeighbors, allpix::PixelDetectorModel::getNeighbors, allpix::RadialStripDetectorModel::getNeighbors
function areNeighbors
virtual bool areNeighbors(
const Pixel::Index & seed,
const Pixel::Index & entrant,
const size_t distance
) const =0
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
Note: This method is purely virtual and must be implemented by the respective concrete detector model classes
Reimplemented by: allpix::HexagonalPixelDetectorModel::areNeighbors, allpix::PixelDetectorModel::areNeighbors, allpix::RadialStripDetectorModel::areNeighbors
Protected Functions Documentation
function setNPixels
inline void setNPixels(
ROOT::Math::DisplacementVector2D< ROOT::Math::Cartesian2D< unsigned int >> val
)
Set number of pixels (replicated blocks in generic sensors)
Parameters:
- val Number of two dimensional pixels
function setPixelSize
inline void setPixelSize(
ROOT::Math::XYVector val
)
Set the size of a pixel.
Parameters:
- val Size of a pixel
function setSensorThickness
inline void setSensorThickness(
double val
)
Set the thickness of the sensor.
Parameters:
- val Thickness of the sensor
function setSensorExcessTop
inline void setSensorExcessTop(
double val
)
Set the excess at the top of the sensor (positive y-coordinate)
Parameters:
- val Sensor top excess
function setSensorExcessRight
inline void setSensorExcessRight(
double val
)
Set the excess at the right of the sensor (positive x-coordinate)
Parameters:
- val Sensor right excess
function setSensorExcessBottom
inline void setSensorExcessBottom(
double val
)
Set the excess at the bottom of the sensor (negative y-coordinate)
Parameters:
- val Sensor bottom excess
function setSensorExcessLeft
inline void setSensorExcessLeft(
double val
)
Set the excess at the left of the sensor (negative x-coordinate)
Parameters:
- val Sensor right excess
Protected Attributes Documentation
variable type_
std::string type_;
variable number_of_pixels_
ROOT::Math::DisplacementVector2D< ROOT::Math::Cartesian2D< unsigned int > > number_of_pixels_;
variable pixel_size_
ROOT::Math::XYVector pixel_size_;
variable pixel_type_
Pixel::Type pixel_type_ {Pixel::Type::RECTANGLE};
variable sensor_thickness_
double sensor_thickness_ {};
variable sensor_excess_
std::array< double, 4 > sensor_excess_ {};
variable sensor_material_
SensorMaterial sensor_material_ {SensorMaterial::SILICON};
variable assembly_
std::shared_ptr< DetectorAssembly > assembly_;
variable implants_
std::vector< Implant > implants_;
variable support_layers_
std::vector< SupportLayer > support_layers_;
Updated on 2024-12-13 at 08:31:37 +0000