DetectorModuleGeometry: Allow for negative position (we don't care, as everything is translated later)
This commit is contained in:
@@ -19,21 +19,6 @@ DetectorModuleGeometry::DetectorModuleGeometry(int64_t in_x0, int64_t in_y0,
|
||||
if ((dir_x(fast) && dir_x(slow)) || (!dir_x(fast) && !dir_x(slow)))
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"One of axes (fast/slow) has to be X and another one Y.");
|
||||
if (dir_x(fast) && (fast == Direction::Xneg) && (x0 - fast_pixels + 1 < 0))
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Edge of module in X is outside of the area.");
|
||||
|
||||
if (dir_x(slow) && (slow == Direction::Xneg) && (x0 - slow_pixels + 1 < 0))
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Edge of module in X is outside of the area.");
|
||||
|
||||
if (dir_x(fast) && (slow == Direction::Yneg) && (y0 - slow_pixels + 1 < 0))
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Edge of module in Y is outside of the area.");
|
||||
|
||||
if (dir_x(slow) && (fast == Direction::Yneg) && (y0 - fast_pixels + 1 < 0))
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Edge of module in Y is outside of the area.");
|
||||
}
|
||||
|
||||
int64_t DetectorModuleGeometry::GetMaxX() const {
|
||||
|
||||
@@ -119,31 +119,6 @@ TEST_CASE("DetectorModuleGeometry_SameAxis", "[DetectorGeometry]") {
|
||||
DetectorModuleGeometry::Direction::Xpos));
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("DetectorModuleGeometry_NoSpace", "[DetectorGeometry]") {
|
||||
std::unique_ptr<DetectorModuleGeometry> geometry;
|
||||
|
||||
REQUIRE_THROWS(geometry = std::make_unique<DetectorModuleGeometry>(1022,0,
|
||||
DetectorModuleGeometry::Direction::Xneg,
|
||||
DetectorModuleGeometry::Direction::Ypos));
|
||||
|
||||
REQUIRE_THROWS(geometry = std::make_unique<DetectorModuleGeometry>(1022,512,
|
||||
DetectorModuleGeometry::Direction::Xpos,
|
||||
DetectorModuleGeometry::Direction::Yneg));
|
||||
|
||||
REQUIRE_THROWS(geometry = std::make_unique<DetectorModuleGeometry>(1029,513,
|
||||
DetectorModuleGeometry::Direction::Yneg,
|
||||
DetectorModuleGeometry::Direction::Xneg));
|
||||
|
||||
REQUIRE_NOTHROW(geometry = std::make_unique<DetectorModuleGeometry>(1029,513,
|
||||
DetectorModuleGeometry::Direction::Xneg,
|
||||
DetectorModuleGeometry::Direction::Yneg));
|
||||
|
||||
REQUIRE_NOTHROW(geometry = std::make_unique<DetectorModuleGeometry>(513,1029,
|
||||
DetectorModuleGeometry::Direction::Yneg,
|
||||
DetectorModuleGeometry::Direction::Xneg));
|
||||
}
|
||||
|
||||
TEST_CASE("DetectorModuleGeometry_GetMaxX_GetMaxY", "[DetectorGeometry]") {
|
||||
std::unique_ptr<DetectorModuleGeometry> geometry;
|
||||
|
||||
@@ -209,7 +184,6 @@ TEST_CASE("DetectorGeometryModular_Custom", "[DetectorGeometry]") {
|
||||
|
||||
REQUIRE(geometry.GetModulesNum() == 3);
|
||||
|
||||
|
||||
CHECK(geometry.GetHeight(true) == 2999+1);
|
||||
CHECK(geometry.GetWidth(true) == 5513+1);
|
||||
CHECK(geometry.GetPixel0(0, true) == 2999 * geometry.GetWidth(true) + 2999);
|
||||
|
||||
Reference in New Issue
Block a user