src/core/geometry/RadialStripDetectorModel.hpp

Parameters of a radial strip detector model. More…

Namespaces

Name
allpix
Helper class to hold support layers for a detector model.

Classes

Name
class allpix::RadialStripDetectorModel
Model of a radial strip detector. This is a model where the silicon sensor is a trapezoid and the strips fan out radially from a focal point.

Detailed Description

Parameters of a radial strip detector model.

Copyright: Copyright (c) 2022-2024 CERN and the Allpix Squared authors. This software is distributed under the terms of the MIT License, copied verbatim in the file “LICENSE.md”. In applying this license, CERN does not waive the privileges and immunities granted to it by virtue of its status as an Intergovernmental Organization or submit itself to any jurisdiction. SPDX-License-Identifier: MIT

Source code


#ifndef ALLPIX_RADIAL_STRIP_DETECTOR_MODEL_H
#define ALLPIX_RADIAL_STRIP_DETECTOR_MODEL_H

#include <numeric>
#include <string>
#include <utility>

#include <Math/Cartesian2D.h>
#include <Math/DisplacementVector2D.h>
#include <Math/Point3D.h>
#include <Math/Polar2D.h>
#include <Math/Vector2D.h>
#include <Math/Vector3D.h>
#include <TMath.h>

#include "DetectorModel.hpp"

namespace allpix {

    class RadialStripDetectorModel : public DetectorModel {
    public:
        explicit RadialStripDetectorModel(std::string type,
                                          const std::shared_ptr<DetectorAssembly>& assembly,
                                          const ConfigReader& reader,
                                          const Configuration& config);

        unsigned int getNumberOfStrips(unsigned int row) const { return number_of_strips_.at(row); }

        double getStripLength(unsigned int row) const { return strip_length_.at(row); }

        double getAngularPitch(unsigned int row) const { return angular_pitch_.at(row); }

        double getAngularPitchMax() const { return *std::max_element(angular_pitch_.begin(), angular_pitch_.end()); }

        double getInnerPitch(unsigned int row) const { return inner_pitch_.at(row); }

        double getSensorBaseInner() const { return sensor_base_.at(0); }

        double getSensorBaseOuter() const { return sensor_base_.at(1); }

        double getRowAngleMax() const { return *std::max_element(row_angle_.begin(), row_angle_.end()); }

        double getRowRadius(unsigned int row) const { return row_radius_.at(row); }

        const std::vector<double>& getRowRadii() const { return row_radius_; }

        double getCenterRadius() const { return (row_radius_.at(0) + row_radius_.at(number_of_pixels_.y())) / 2; }

        double getStereoAngle() const { return stereo_angle_; }

        ROOT::Math::XYZPoint getMatrixCenter() const override { return {0, getCenterRadius(), 0}; }

        ROOT::Math::XYZVector getSize() const override { return {sensor_base_.at(1), sensor_length_, sensor_thickness_}; }

        ROOT::Math::XYVector getStripSize(unsigned int row) const {
            return {inner_pitch_.at(row) + 2 * strip_length_.at(row) * tan(angular_pitch_.at(row) / 2),
                    strip_length_.at(row)};
        }
        bool isWithinSensor(const ROOT::Math::XYZPoint& position) const override;

        bool isOnSensorBoundary(const ROOT::Math::XYZPoint& local_pos) const override;

        ROOT::Math::XYZPoint getSensorIntercept(const ROOT::Math::XYZPoint& inside,
                                                const ROOT::Math::XYZPoint& outside) const override;

        bool isWithinMatrix(const Pixel::Index& strip_index) const override;

        bool isWithinMatrix(const int x, const int y) const override {
            return !(y < 0 || y >= static_cast<int>(getNPixels().y()) || x < 0 ||
                     x >= static_cast<int>(number_of_strips_.at(static_cast<unsigned int>(y))));
        }

        ROOT::Math::Polar2DPoint getPositionPolar(const ROOT::Math::XYZPoint& local_pos) const;

        ROOT::Math::XYPoint getPositionCartesian(const ROOT::Math::Polar2DPoint& polar_pos) const;

        ROOT::Math::XYZPoint getPixelCenter(int x, int y) const override;

        std::pair<int, int> getPixelIndex(const ROOT::Math::XYZPoint& position) const override;

        std::set<Pixel::Index> getNeighbors(const Pixel::Index& idx, const size_t distance) const override;

        bool areNeighbors(const Pixel::Index& seed, const Pixel::Index& entrant, const size_t distance) const override;

    private:
        void setNumberOfStrips(std::vector<unsigned int> val) { number_of_strips_ = std::move(val); }

        void setStripLength(std::vector<double> val) { strip_length_ = std::move(val); }

        void setAngularPitch(std::vector<double> val) { angular_pitch_ = std::move(val); }

        void setInnerPitch(std::vector<double> val) { inner_pitch_ = std::move(val); }

        void setSensorLength(double val) { sensor_length_ = val; }

        void setSensorBaseInner(double val) { sensor_base_.at(0) = val; }

        void setSensorBaseOuter(double val) { sensor_base_.at(1) = val; }

        void setRowAngle(std::vector<double> val) { row_angle_ = std::move(val); }

        void setRowRadius(std::vector<double> val) { row_radius_ = std::move(val); }

        void setStereoAngle(double val) { stereo_angle_ = val; }

        std::vector<unsigned int> number_of_strips_{};
        std::vector<double> strip_length_{};
        std::vector<double> angular_pitch_{};
        std::vector<double> inner_pitch_{};
        double stereo_angle_{};

        std::array<double, 2> sensor_base_{};
        double sensor_length_{};
        std::vector<double> row_radius_{};
        std::vector<double> row_angle_{};

        ROOT::Math::XYZVector focus_translation_;
    };
} // namespace allpix

#endif /* ALLPIX_RADIAL_STRIP_DETECTOR_MODEL_H */

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