DetectorModuleGeometry: Add GetMinX() and GetMinY() functions
This commit is contained in:
@@ -39,19 +39,33 @@ DetectorModuleGeometry::DetectorModuleGeometry(int64_t in_x0, int64_t in_y0,
|
||||
int64_t DetectorModuleGeometry::GetMaxX() const {
|
||||
if (fast == Direction::Xpos)
|
||||
return x0 + fast_pixels - 1;
|
||||
else if (slow == Direction::Xpos)
|
||||
if (slow == Direction::Xpos)
|
||||
return x0 + slow_pixels - 1;
|
||||
else
|
||||
return x0;
|
||||
return x0;
|
||||
}
|
||||
|
||||
int64_t DetectorModuleGeometry::GetMaxY() const {
|
||||
if (fast == Direction::Ypos)
|
||||
return y0 + fast_pixels - 1;
|
||||
else if (slow == Direction::Ypos)
|
||||
if (slow == Direction::Ypos)
|
||||
return y0 + slow_pixels - 1;
|
||||
else
|
||||
return y0;
|
||||
return y0;
|
||||
}
|
||||
|
||||
int64_t DetectorModuleGeometry::GetMinX() const {
|
||||
if (fast == Direction::Xneg)
|
||||
return x0 - fast_pixels + 1;
|
||||
if (slow == Direction::Xneg)
|
||||
return x0 - slow_pixels + 1;
|
||||
return x0;
|
||||
}
|
||||
|
||||
int64_t DetectorModuleGeometry::GetMinY() const {
|
||||
if (fast == Direction::Yneg)
|
||||
return y0 - fast_pixels + 1;
|
||||
if (slow == Direction::Yneg)
|
||||
return y0 - slow_pixels + 1;
|
||||
return y0;
|
||||
}
|
||||
|
||||
int64_t DetectorModuleGeometry::GetPixel0_X() const {
|
||||
@@ -86,3 +100,8 @@ void DetectorModuleGeometry::VerticalFlip(std::size_t detector_height) {
|
||||
|
||||
y0 = detector_height - y0 - 1;
|
||||
}
|
||||
|
||||
void DetectorModuleGeometry::Translate(int64_t in_x, int64_t in_y) {
|
||||
x0 += in_x;
|
||||
y0 += in_y;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user