38 lines
1.8 KiB
C++
38 lines
1.8 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#ifndef JFJOCH_DETECTORGEOMETRYMODULAR_H
|
|
#define JFJOCH_DETECTORGEOMETRYMODULAR_H
|
|
|
|
#include "DetectorGeometry.h"
|
|
|
|
class DetectorGeometryModular : public DetectorGeometry {
|
|
int64_t width;
|
|
int64_t height;
|
|
std::vector<DetectorModuleGeometry> modules;
|
|
[[nodiscard]] int64_t GetDirectionStep(DetectorModuleGeometry::Direction direction) const;
|
|
[[nodiscard]] static Coord GetDirection(DetectorModuleGeometry::Direction direction) ;
|
|
public:
|
|
explicit DetectorGeometryModular(const std::vector<DetectorModuleGeometry> &pixel_0, bool vertical_flip = false);
|
|
explicit DetectorGeometryModular(int32_t nmodules,
|
|
int32_t horizontal_stacking = 1,
|
|
int32_t gap_x = 0,
|
|
int32_t gap_y = 0,
|
|
bool mirror_y = true); // regular geometry
|
|
int64_t GetModulesNum() const override;
|
|
int64_t GetWidth(bool geom_transformed) const override;
|
|
int64_t GetHeight(bool geom_transformed) const override;
|
|
int64_t GetPixel0(int64_t module_number, bool geom_transformed) const override;
|
|
int64_t GetX0(int64_t module_number) const override;
|
|
int64_t GetY0(int64_t module_number) const override;
|
|
int64_t GetFastDirectionStep(int64_t module_number) const override;
|
|
int64_t GetSlowDirectionStep(int64_t module_number) const override;
|
|
Coord GetFastDirection(int64_t module_number) const override;
|
|
Coord GetSlowDirection(int64_t module_number) const override;
|
|
void VerticalFlip() override;
|
|
bool IsModularDetector() const override;
|
|
};
|
|
|
|
|
|
#endif //JFJOCH_DETECTORGEOMETRYMODULAR_H
|