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
+2
View File
@@ -29,6 +29,8 @@ DetectorGeometry::DetectorGeometry(int32_t nmodules, int32_t horizontal_stacking
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Gap x has to be non-negative");
if (gap_y < 0)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Gap y has to be non-negative");
if (nmodules < horizontal_stacking)
horizontal_stacking = nmodules;
width = horizontal_stacking * CONVERTED_MODULE_COLS + (horizontal_stacking - 1) * gap_x;
int64_t conv_lines = nmodules / horizontal_stacking + (nmodules % horizontal_stacking > 0 ? 1 : 0);