DetectorGeometry: Fix module slow direction if horizontal stacking > module number

This commit is contained in:
2023-07-04 11:25:19 +02:00
parent 8a203b7cf5
commit 9d35660cf4
2 changed files with 16 additions and 0 deletions

View File

@@ -20,6 +20,20 @@ TEST_CASE("DetectorGeometry_Regular", "[DetectorGeometry]") {
REQUIRE(pbuf.module_geometry(15).slow_direction_step() == pbuf.width_pxl());
}
TEST_CASE("DetectorGeometry_Regular_1Module", "[DetectorGeometry]") {
DetectorGeometry geometry(1, 3, 8, 36, false);
const JFJochProtoBuf::DetectorGeometry pbuf = geometry;
REQUIRE(pbuf.module_geometry_size() == 1);
REQUIRE(pbuf.width_pxl() == CONVERTED_MODULE_COLS);
REQUIRE(pbuf.height_pxl() == CONVERTED_MODULE_LINES);
REQUIRE(pbuf.module_geometry(0).pixel0() == 0);
REQUIRE(pbuf.module_geometry(0).fast_direction_step() == 1);
REQUIRE(pbuf.module_geometry(0).slow_direction_step() == CONVERTED_MODULE_COLS);
}
TEST_CASE("DetectorGeometry_RegularMirror", "[DetectorGeometry]") {
DetectorGeometry geometry(18, 3, 8, 36, true);