DetectorModuleGeometry: More flexibility for modular geometry, allowing for non-zero top left corner

This commit is contained in:
2025-11-18 13:52:42 +01:00
parent a041b94a91
commit accbb6bd21
2 changed files with 31 additions and 2 deletions

View File

@@ -218,6 +218,22 @@ TEST_CASE("DetectorGeometryModular_Custom", "[DetectorGeometry]") {
CHECK(geometry.GetSlowDirectionStep(2) == 1);
}
TEST_CASE("DetectorGeometryModular_Limit", "[DetectorGeometry]") {
std::vector<DetectorModuleGeometry> module_geom;
REQUIRE_NOTHROW(module_geom.emplace_back(-100, 2999, DetectorModuleGeometry::Direction::Xneg,
DetectorModuleGeometry::Direction::Yneg));
REQUIRE_NOTHROW(module_geom.emplace_back(5000, 500, DetectorModuleGeometry::Direction::Ypos,
DetectorModuleGeometry::Direction::Xpos));
DetectorGeometryModular geometry(module_geom);
REQUIRE(geometry.GetModulesNum() == 2);
CHECK(geometry.GetWidth(true) == 5000 + 513 - (-100 - 1029));
CHECK(geometry.GetHeight(true) == 2999 + 513 - 500);
}
TEST_CASE("DetectorGeometryModular_Custom_Mirror", "[DetectorGeometry]") {
std::vector<DetectorModuleGeometry> module_geom;