DetectorModuleGeometry: Add GetMinX() and GetMinY() functions

This commit is contained in:
2025-11-18 13:44:30 +01:00
parent dc9bc18512
commit 7548c0f7f3
3 changed files with 48 additions and 16 deletions

View File

@@ -150,37 +150,47 @@ TEST_CASE("DetectorModuleGeometry_GetMaxX_GetMaxY", "[DetectorGeometry]") {
REQUIRE_NOTHROW(geometry = std::make_unique<DetectorModuleGeometry>(0,0,
DetectorModuleGeometry::Direction::Xpos,
DetectorModuleGeometry::Direction::Ypos));
CHECK(geometry->GetMinX() == 0);
CHECK(geometry->GetMaxX() == 1029);
REQUIRE(geometry->GetMaxX() == 1029);
REQUIRE(geometry->GetMaxY() == 513);
CHECK(geometry->GetMinY() == 0);
CHECK(geometry->GetMaxY() == 513);
REQUIRE_NOTHROW(geometry = std::make_unique<DetectorModuleGeometry>(2029,1513,
DetectorModuleGeometry::Direction::Xneg,
DetectorModuleGeometry::Direction::Yneg));
CHECK(geometry->GetMinX() == 2029 - 1029);
CHECK(geometry->GetMaxX() == 2029);
REQUIRE(geometry->GetMaxX() == 2029);
REQUIRE(geometry->GetMaxY() == 1513);
CHECK(geometry->GetMinY() == 1513 - 513);
CHECK(geometry->GetMaxY() == 1513);
REQUIRE_NOTHROW(geometry = std::make_unique<DetectorModuleGeometry>(2029,1513,
DetectorModuleGeometry::Direction::Yneg,
DetectorModuleGeometry::Direction::Xneg));
CHECK(geometry->GetMinX() == 2029 - 513);
CHECK(geometry->GetMaxX() == 2029);
REQUIRE(geometry->GetMaxX() == 2029);
REQUIRE(geometry->GetMaxY() == 1513);
CHECK(geometry->GetMinY() == 1513 - 1029);
CHECK(geometry->GetMaxY() == 1513);
REQUIRE_NOTHROW(geometry = std::make_unique<DetectorModuleGeometry>(2029,1513,
DetectorModuleGeometry::Direction::Yneg,
DetectorModuleGeometry::Direction::Xpos));
CHECK(geometry->GetMinX() == 2029);
CHECK(geometry->GetMaxX() == 2029 + 513);
REQUIRE(geometry->GetMaxX() == 2029 + 513);
REQUIRE(geometry->GetMaxY() == 1513);
CHECK(geometry->GetMinY() == 1513 - 1029);
CHECK(geometry->GetMaxY() == 1513);
REQUIRE_NOTHROW(geometry = std::make_unique<DetectorModuleGeometry>(2029,1513,
DetectorModuleGeometry::Direction::Ypos,
DetectorModuleGeometry::Direction::Xneg));
CHECK(geometry->GetMinX() == 2029 - 513);
CHECK(geometry->GetMaxX() == 2029);
REQUIRE(geometry->GetMaxX() == 2029);
REQUIRE(geometry->GetMaxY() == 1513 + 1029);
CHECK(geometry->GetMinY() == 1513);
CHECK(geometry->GetMaxY() == 1513 + 1029);
}
TEST_CASE("DetectorGeometryModular_Custom", "[DetectorGeometry]") {