Commit 8d8cdcc3 authored by Håkan Wennlöf's avatar Håkan Wennlöf
Browse files

Merge branch 'p-overlap-frontside' into 'master'

PixelDetectorModel: backside implants are allowed to overlap

See merge request allpix-squared/allpix-squared!1170
parents a7d5b6af 9a9e585a
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -43,7 +43,15 @@ void PixelDetectorModel::validate() {
                implant.getConfiguration(), "size", "implant depth cannot be larger than sensor thickness");
        }

        // Offset of the collection diode implant from the pixel center, defaults to zero.
        if(implant.getType() == Implant::Type::BACKSIDE) {
            // For backside implants, only check that the center of the implant lies within the pixel cell:
            if(std::fabs(implant.getOffset().x()) > pixel_size_.x() / 2 ||
               std::fabs(implant.getOffset().y()) > pixel_size_.y() / 2) {
                throw InvalidValueError(
                    implant.getConfiguration(), "offset", "implant offset outside cell. Reduce implant offset");
            }
        } else {
            // For frontside implants, check that the implant lies within the pixel cell with its entire size
            if(std::fabs(implant.getOffset().x()) + implant.getSize().x() / 2 > pixel_size_.x() / 2 ||
               std::fabs(implant.getOffset().y()) + implant.getSize().y() / 2 > pixel_size_.y() / 2) {
                throw InvalidValueError(
@@ -51,6 +59,7 @@ void PixelDetectorModel::validate() {
            }
        }
    }
}

/**
 * The definition of inside the sensor is determined by the detector model