allpix::Detector

Instantiation of a detector model in the world. More…

#include <Detector.hpp>

Public Functions

Name
Detector(std::string name, std::shared_ptr< DetectorModel > model, ROOT::Math::XYZPoint position, const ROOT::Math::Rotation3D & orientation)
Constructs a detector in the geometry.
const std::string & getName() const
Get name of the detector.
const std::string & getType() const
Get type of the detector.
const ROOT::Math::XYZPoint & getPosition() const
Get position in the world.
const ROOT::Math::Rotation3D & getOrientation() const
Get orientation in the world.
ROOT::Math::XYZPoint getLocalPosition(const ROOT::Math::XYZPoint & global_pos) const
Convert a global position to a position in the detector frame.
ROOT::Math::XYZPoint getGlobalPosition(const ROOT::Math::XYZPoint & local_pos) const
Convert a position in the detector frame to a global position.
Pixel getPixel(int x, int y) const
Return a pixel object from the x- and y-index values.
Pixel getPixel(const Pixel::Index & index) const
Return a pixel object from the pixel index.
bool hasElectricField() const
Returns if the detector has an electric field in the sensor.
FieldType getElectricFieldType() const
Return the type of electric field that is simulated.
ROOT::Math::XYZVector getElectricField(const ROOT::Math::XYZPoint & local_pos) const
Get the electric field in the sensor at a local position.
void setElectricFieldGrid(const std::shared_ptr< std::vector< double » & field, std::array< size_t, 3 > bins, std::array< double, 3 > size, FieldMapping mapping, std::array< double, 2 > scales, std::array< double, 2 > offset, std::pair< double, double > thickness_domain)
Set the electric field in a single pixel in the detector using a grid.
void setElectricFieldFunction(FieldFunction< ROOT::Math::XYZVector > function, std::pair< double, double > thickness_domain, FieldType type =FieldType::CUSTOM)
Set the electric field in a single pixel using a function.
bool hasDopingProfile() const
Returns if the detector has a doping profile in the sensor.
FieldType getDopingProfileType() const
Return the type of doping profile that is simulated.
double getDopingConcentration(const ROOT::Math::XYZPoint & local_pos) const
Get the doping profile in the sensor at a local position.
void setDopingProfileGrid(std::shared_ptr< std::vector< double » field, std::array< size_t, 3 > bins, std::array< double, 3 > size, FieldMapping mapping, std::array< double, 2 > scales, std::array< double, 2 > offset, std::pair< double, double > thickness_domain)
Set the doping profile in a single pixel in the detector using a grid.
void setDopingProfileFunction(FieldFunction< double > function, FieldType type =FieldType::CUSTOM)
Set the doping profile in a single pixel using a function.
bool hasWeightingPotential() const
Returns if the detector has a weighting potential in the sensor.
FieldType getWeightingPotentialType() const
Return the type of weighting potential that is simulated.
double getWeightingPotential(const ROOT::Math::XYZPoint & local_pos, const Pixel::Index & reference) const
Get the weighting potential in the sensor at a local position.
void setWeightingPotentialGrid(const std::shared_ptr< std::vector< double » & potential, std::array< size_t, 3 > bins, std::array< double, 3 > size, FieldMapping mapping, std::array< double, 2 > scales, std::array< double, 2 > offset, std::pair< double, double > thickness_domain)
Set the weighting potential in a single pixel in the detector using a grid.
void setWeightingPotentialFunction(FieldFunction< double > function, std::pair< double, double > thickness_domain, FieldType type =FieldType::CUSTOM)
Set the weighting potential in a single pixel using a function.
void setMagneticField(ROOT::Math::XYZVector b_field)
Set the magnetic field in the detector.
bool hasMagneticField() const
Returns if the detector has a magnetic field in the sensor.
ROOT::Math::XYZVector getMagneticField(const ROOT::Math::XYZPoint & local_pos) const
Get the magnetic field in the sensor at a local position.
const std::shared_ptr< DetectorModel > getModel() const
Get the model of this detector.

Friends

Name
class GeometryManager

Detailed Description

class allpix::Detector;

Instantiation of a detector model in the world.

Contains the detector in the world with several unique properties (like the electric field). All model specific properties are stored in its DetectorModel instead.

Public Functions Documentation

function Detector

Detector(
    std::string name,
    std::shared_ptr< DetectorModel > model,
    ROOT::Math::XYZPoint position,
    const ROOT::Math::Rotation3D & orientation
)

Constructs a detector in the geometry.

Parameters:

  • name Unique name of the detector
  • model Model of the detector
  • position Position in the world frame
  • orientation Rotation matrix representing the orientation

Exceptions:

Creates a detector without any electric field in the sensor.

function getName

inline const std::string & getName() const

Get name of the detector.

Return: Detector name

function getType

inline const std::string & getType() const

Get type of the detector.

Return: Type of the detector model

function getPosition

inline const ROOT::Math::XYZPoint & getPosition() const

Get position in the world.

Return: Global position in Cartesian coordinates

function getOrientation

inline const ROOT::Math::Rotation3D & getOrientation() const

Get orientation in the world.

Return: Rotation matrix representing the orientation

function getLocalPosition

ROOT::Math::XYZPoint getLocalPosition(
    const ROOT::Math::XYZPoint & global_pos
) const

Convert a global position to a position in the detector frame.

Parameters:

  • global_pos Position in the global frame

Return: Position in the local frame

Warning: The local coordinate position does normally not have its origin at the center of rotation

The origin of the local frame is at the center of the first pixel in the middle of the sensor.

function getGlobalPosition

ROOT::Math::XYZPoint getGlobalPosition(
    const ROOT::Math::XYZPoint & local_pos
) const

Convert a position in the detector frame to a global position.

Parameters:

  • local_pos Position in the local frame

Return: Position in the global frame

function getPixel

Pixel getPixel(
    int x,
    int y
) const

Return a pixel object from the x- and y-index values.

Return: Pixel object

The pixel has internal information about the size and location specific for this detector

function getPixel

Pixel getPixel(
    const Pixel::Index & index
) const

Return a pixel object from the pixel index.

Return: Pixel object

The pixel has internal information about the size and location specific for this detector

function hasElectricField

inline bool hasElectricField() const

Returns if the detector has an electric field in the sensor.

Return: True if the detector has an electric field, false otherwise

function getElectricFieldType

inline FieldType getElectricFieldType() const

Return the type of electric field that is simulated.

Return: The type of the electric field

Note: The type of the electric field is set depending on the function used to apply it

function getElectricField

ROOT::Math::XYZVector getElectricField(
    const ROOT::Math::XYZPoint & local_pos
) const

Get the electric field in the sensor at a local position.

Parameters:

  • local_pos Position in the local frame

Return: Vector of the field at the queried point

The electric field is replicated for all pixels and uses flipping at each boundary (side effects are not modeled in this stage). Outside of the sensor the electric field is strictly zero by definition.

function setElectricFieldGrid

void setElectricFieldGrid(
    const std::shared_ptr< std::vector< double >> & field,
    std::array< size_t, 3 > bins,
    std::array< double, 3 > size,
    FieldMapping mapping,
    std::array< double, 2 > scales,
    std::array< double, 2 > offset,
    std::pair< double, double > thickness_domain
)

Set the electric field in a single pixel in the detector using a grid.

Parameters:

  • field Flat array of the field vectors (see detailed description)
  • bins The dimensions of the flat electric field array
  • size Size of the electric field along the three dimensions of the field map
  • mapping Specification of the mapping of the field onto the pixel plane
  • scales Scaling factors for the field size, given in fractions of the field size in x and y
  • offset Offset of the field, given in fractions of the field size in x and y
  • thickness_domain Domain in local coordinates in the thickness direction where the field holds

Exceptions:

  • std::invalid_argument If the electric field dimensions are incorrect or the thickness domain is outside the sensor

function setElectricFieldFunction

void setElectricFieldFunction(
    FieldFunction< ROOT::Math::XYZVector > function,
    std::pair< double, double > thickness_domain,
    FieldType type =FieldType::CUSTOM
)

Set the electric field in a single pixel using a function.

Parameters:

  • function Function used to retrieve the electric field
  • type Type of the electric field function used
  • thickness_domain Domain in local coordinates in the thickness direction where the field holds

function hasDopingProfile

inline bool hasDopingProfile() const

Returns if the detector has a doping profile in the sensor.

Return: True if the detector has a doping profile, false otherwise

function getDopingProfileType

inline FieldType getDopingProfileType() const

Return the type of doping profile that is simulated.

Return: The type of the doping profile

Note: The type of the doping profile is set depending on the function used to apply it

function getDopingConcentration

double getDopingConcentration(
    const ROOT::Math::XYZPoint & local_pos
) const

Get the doping profile in the sensor at a local position.

Parameters:

  • pos Position in the local frame

Return: Value of the field at the queried point

The doping profile is replicated for all pixels and uses flipping at each boundary (side effects are not modeled in this stage). Outside of the sensor the doping profile is strictly zero by definition.

function setDopingProfileGrid

void setDopingProfileGrid(
    std::shared_ptr< std::vector< double >> field,
    std::array< size_t, 3 > bins,
    std::array< double, 3 > size,
    FieldMapping mapping,
    std::array< double, 2 > scales,
    std::array< double, 2 > offset,
    std::pair< double, double > thickness_domain
)

Set the doping profile in a single pixel in the detector using a grid.

Parameters:

  • field Flat array of the field (see detailed description)
  • bins The dimensions of the flat doping profile array
  • size Size of the doping profile along the three dimensions of the field map
  • mapping Specification of the mapping of the field onto the pixel plane
  • scales Scaling factors for the field size, given in fractions of a pixel unit cell in x and y
  • offset Offset of the field, given in fractions of the field size in x and y
  • thickness_domain Domain in local coordinates in the thickness direction where the profile holds

Exceptions:

  • std::invalid_argument If the doping profile dimensions are incorrect

The doping profile is stored as a large flat array. If the sizes are denoted as respectively X_SIZE, Y_ SIZE and Z_SIZE, each position (x, y, z) has one index, calculated as xY_SIZEZ_SIZE+y*Z_SIZE+z

function setDopingProfileFunction

void setDopingProfileFunction(
    FieldFunction< double > function,
    FieldType type =FieldType::CUSTOM
)

Set the doping profile in a single pixel using a function.

Parameters:

  • function Function used to retrieve the doping profile
  • type Type of the doping profile function used

function hasWeightingPotential

inline bool hasWeightingPotential() const

Returns if the detector has a weighting potential in the sensor.

Return: True if the detector has a weighting potential, false otherwise

function getWeightingPotentialType

inline FieldType getWeightingPotentialType() const

Return the type of weighting potential that is simulated.

Return: The type of the weighting potential

Note: The type of the weighting potential is set depending on the function used to apply it

function getWeightingPotential

double getWeightingPotential(
    const ROOT::Math::XYZPoint & local_pos,
    const Pixel::Index & reference
) const

Get the weighting potential in the sensor at a local position.

Parameters:

  • local_pos Position in the local frame
  • reference Index of the pixel for which we want the weighting potential

Return: Value of the potential at the queried point

The weighting potential is retrieved relative to a reference pixel. Outside of the sensor the weighting potential is strictly zero by definition.

function setWeightingPotentialGrid

void setWeightingPotentialGrid(
    const std::shared_ptr< std::vector< double >> & potential,
    std::array< size_t, 3 > bins,
    std::array< double, 3 > size,
    FieldMapping mapping,
    std::array< double, 2 > scales,
    std::array< double, 2 > offset,
    std::pair< double, double > thickness_domain
)

Set the weighting potential in a single pixel in the detector using a grid.

Parameters:

  • potential Flat array of the potential vectors (see detailed description)
  • bins The dimensions of the flat weighting potential array
  • size Size of the weighting potential along the three dimensions of the field map
  • mapping Specification of the mapping of the field onto the pixel plane
  • scales Scaling factors for the field size, given in fractions of a pixel unit cell in x and y
  • offset Offset of the field, given in fractions of the field size in x and y
  • thickness_domain Domain in local coordinates in the thickness direction where the potential holds

Exceptions:

  • std::invalid_argument If the weighting potential dimensions are incorrect or the thickness domain is outside the sensor

function setWeightingPotentialFunction

void setWeightingPotentialFunction(
    FieldFunction< double > function,
    std::pair< double, double > thickness_domain,
    FieldType type =FieldType::CUSTOM
)

Set the weighting potential in a single pixel using a function.

Parameters:

  • function Function used to retrieve the weighting potential
  • type Type of the weighting potential function used
  • thickness_domain Domain in local coordinates in the thickness direction where the potential holds

function setMagneticField

void setMagneticField(
    ROOT::Math::XYZVector b_field
)

Set the magnetic field in the detector.

Parameters:

  • b_field Vector indicating strength and direction of the magnetic field

function hasMagneticField

inline bool hasMagneticField() const

Returns if the detector has a magnetic field in the sensor.

Return: True if the detector has an magnetic field, false otherwise

function getMagneticField

ROOT::Math::XYZVector getMagneticField(
    const ROOT::Math::XYZPoint & local_pos
) const

Get the magnetic field in the sensor at a local position.

Parameters:

  • local_pos Position in the local frame

Return: Vector of the field at the queried point

The magnetic field is evaluated for any sensor position.

function getModel

inline const std::shared_ptr< DetectorModel > getModel() const

Get the model of this detector.

Return: Pointer to the constant detector model

Friends

friend GeometryManager

friend class GeometryManager(
    GeometryManager 
);

Updated on 2024-12-13 at 08:31:36 +0000