Commit ee95449e authored by Simon Spannagel's avatar Simon Spannagel
Browse files

RadialStripDetector: fix typos and also interpolate on backside

parent 8d9ea00b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -255,14 +255,14 @@ ROOT::Math::XYZPoint RadialStripDetectorModel::getSensorIntercept(const ROOT::Ma

    auto check_position = outside;
    check_position.SetZ(inside.z());
    if(outside.z() > 0 && isWithinSensor(check_position)) {
        // Carrier left sensor on the side of the sensor, interpolate end point on surface
    if(std::fabs(outside.z()) > getSensorSize().z() / 2.0 && isWithinSensor(check_position)) {
        // Carrier left sensor on the top or bottom surface of the sensor, interpolate end point on surface
        auto z_cur_border = std::fabs(outside.z() - getSensorSize().z() / 2.0);
        auto z_last_border = std::fabs(getSensorSize().z() / 2.0 - inside.z());
        auto z_total = z_cur_border + z_last_border;
        return (z_last_border / z_total) * static_cast<ROOT::Math::XYZVector>(outside) + (z_cur_border / z_total) * inside;
    } else {
        // Carrier left sensor on any order border, use last position inside instead
        // Carrier left sensor on any other border, use last position inside instead
        return inside;
    }
}