Commit 2500e2ce authored by Simon Spannagel's avatar Simon Spannagel
Browse files

PixelDetector: fix typo in range check

parent 9d009d3c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -83,10 +83,10 @@ bool PixelDetectorModel::isWithinMatrix(const int x, const int y) const {
 * This is quite easy for rectangular pixels and matrices.
 */
bool PixelDetectorModel::isWithinMatrix(const ROOT::Math::XYZPoint& position) const {
    if(position.x() < 0.5 * pixel_size_.x() || position.x() > (number_of_pixels_.x() - 0.5) * pixel_size_.x()) {
    if(position.x() < -0.5 * pixel_size_.x() || position.x() > (number_of_pixels_.x() - 0.5) * pixel_size_.x()) {
        return false;
    }
    if(position.y() < 0.5 * pixel_size_.y() || position.y() > (number_of_pixels_.y() - 0.5) * pixel_size_.y()) {
    if(position.y() < -0.5 * pixel_size_.y() || position.y() > (number_of_pixels_.y() - 0.5) * pixel_size_.y()) {
        return false;
    }
    return true;