diff --git a/src/core/detector/Detector.hpp b/src/core/detector/Detector.hpp index 75e2090c300ba79b4f6cbab388c91efeb258775f..f98054133db841771ce1d727c44ef3f9e1f91425 100644 --- a/src/core/detector/Detector.hpp +++ b/src/core/detector/Detector.hpp @@ -224,6 +224,11 @@ namespace corryvreckan { */ virtual XYVector getSize() const = 0; + /** + * @brief Get the size of a single pixel, accounting for "big pixels" in + * PixelModuleDetector or other hybrid pixel size detectors + * @return double with area of pixel at this index + */ virtual double getPixelArea(int column, int row) const = 0; /** diff --git a/src/core/detector/PolarDetector.cpp b/src/core/detector/PolarDetector.cpp index 3837b0676c245c82a99cbc6ca07f602bbd6b9651..0013a31b0b07e672b729f942dd3bf03ba761efd2 100644 --- a/src/core/detector/PolarDetector.cpp +++ b/src/core/detector/PolarDetector.cpp @@ -428,6 +428,16 @@ XYVector PolarDetector::getPitch() const { return {pitch_x, pitch_y}; } +double PolarDetector::getPixelArea(int, int row) const { + // Get strip length and pitch for the given row + auto outer_r = row_radius.at(static_cast<size_t>(row)); + auto strip_phi = angular_pitch.at(static_cast<size_t>(row)); + auto inner_r = (row < 1) ? center_radius : row_radius.at(static_cast<size_t>(row) - 1); + + /* A = pi * (r_outer^2 - r_inner^2) * (strip_phi / (2 * pi)) */ + return (outer_r * outer_r - inner_r * inner_r) * strip_phi / 2; +} + XYVector PolarDetector::getSpatialResolution(double, double row) const { // Get integer row auto row_int = static_cast<unsigned int>(floor(row + 0.5)); diff --git a/src/core/detector/PolarDetector.hpp b/src/core/detector/PolarDetector.hpp index ac91e629212076e5e01ba521f0b141ec77b14774..a3c36e81dfa00263e993760f5606d5f613fa94cd 100644 --- a/src/core/detector/PolarDetector.hpp +++ b/src/core/detector/PolarDetector.hpp @@ -195,6 +195,15 @@ namespace corryvreckan { */ XYVector getSize() const override; + /** + * @brief Get the size of a single pixel, accounting for "big pixels" in + * PixelModuleDetector or other hybrid pixel size detectors + * @return double with area of pixel at this index + * + * @note: not implemented due to + */ + double getPixelArea(int column = 0, int row = 0) const override; + /** * @brief Get pitch of a single pixel * @return Pitch of a pixel in X and Y