diff --git a/include/aare/Remap.hpp b/include/aare/Remap.hpp index 18ec99e..c9685de 100644 --- a/include/aare/Remap.hpp +++ b/include/aare/Remap.hpp @@ -9,49 +9,17 @@ namespace aare::remap::model { -enum class SensorTech : int { iLGAD, TEW }; - -// This is dummy for now because it is not yet decided how best to depict the -// differences in batches R&D, production and year in a scalable way with -// unified naming conventions -enum class SensorRevision : int { RevA, RevB, RevC }; - -enum class SensorLayout : int { - Halfmodule, // not implemented yet! - Quad, - DoubleChip, // not implemented yet (new batch)! - SingleMP37, // not implemented yet (TEW 2024) - SingleMP25, - SingleMP18, - SingleMP15 -}; - -// Orientation of the sensor with respect to the ASICs / the HDI -// Normal means lower part of sensor (as in GDS) aligns with lower part of HDI -enum class Rotation : int { Normal = 0, Inverse = 1 }; - -struct SensorKey { - SensorTech tech; - SensorRevision rev = SensorRevision::RevA; - SensorLayout layout; -}; - -struct BondShift { - int x = 0; - int y = 0; -}; - struct StrixelSensorConfig { // --- Sensor identity (determines multiplicator, layout, groups) - SensorKey key; + defs::SensorKey key; // std::string label; // --- Pixel geometry - config::ChipGeometry chip_geometry; - BondShift bond_shift; + defs::ChipGeometry chip_geometry; + defs::BondShift bond_shift; // --- Strixel geometry - config::StrixelGeometry strixel_geometry; + defs::StrixelGeometry strixel_geometry; // --- Geometry of this strixel group *in local pixel coordinates* // e.g. G1 = [10..246, 9..63] @@ -59,27 +27,27 @@ struct StrixelSensorConfig { // --- Sensor placement in *module-global* coordinates // Example: chip 1 = [256..511, 0..255], chip 6 = [512..757, 256..511] - // This should be externally supplied and Rotation and chip_id should be computed - // automatically from this! - // i.e., possibly this should not be part of StrixelSensorConfig! + // This should be externally supplied and Rotation and chip_id should be + // computed automatically from this! i.e., possibly this should not be + // part of StrixelSensorConfig! InclusiveROI roi_module; // --- Orientation // --- Rotation of the chip (Normal / Inverse) // Used to mirror group ROIs and determine mod ordering. - Rotation rotation; + defs::Rotation rotation; std::optional chip_id; // only relevant for multiple sensors on module private: friend StrixelSensorConfig - makeSensorConfig(SensorKey, std::optional user_rot, - std::optional chip_id, BondShift); + makeSensorConfig(defs::SensorKey, std::optional user_rot, + std::optional chip_id, defs::BondShift); // dumb, private constructor! (To decouple responsibilities) - StrixelSensorConfig(SensorKey key_, config::ChipGeometry chip_geometry_, - BondShift bond_shift_, - config::StrixelGeometry strixel_geometry_, - InclusiveROI roi_module_, Rotation rotation_, + StrixelSensorConfig(defs::SensorKey key_, defs::ChipGeometry chip_geometry_, + defs::BondShift bond_shift_, + defs::StrixelGeometry strixel_geometry_, + InclusiveROI roi_module_, defs::Rotation rotation_, std::optional chip_id_) : key(key_), chip_geometry(chip_geometry_), bond_shift(bond_shift_), strixel_geometry(strixel_geometry_), roi_module(roi_module_), @@ -110,21 +78,19 @@ aare::InclusiveROI alignROIs(InclusiveROI const &roi_user, /** * Auto-rotate based on chip_id */ -aare::remap::model::Rotation autoRotate(int chip_id); +defs::Rotation autoRotate(int chip_id); } // namespace aare::remap::geom namespace aare::remap::resolve { -using namespace aare::remap::model; -aare::remap::config::StrixelGeometry const &strixelGeometry(SensorKey); -aare::remap::config::ChipGeometry chipGeometry(SensorKey); -aare::InclusiveROI moduleROI(SensorKey, std::optional chip_id); +defs::StrixelGeometry const &strixelGeometry(defs::SensorKey); +defs::ChipGeometry chipGeometry(defs::SensorKey); +aare::InclusiveROI moduleROI(defs::SensorKey, std::optional chip_id); } // namespace aare::remap::resolve namespace aare::remap::algo { -using namespace aare::remap::model; /** * Core remapping function for a single contiguous unit @@ -139,16 +105,18 @@ using namespace aare::remap::model; * Inverse. * \param shifty optional shift in y (in strixel map space!) */ -MappingResult generateUnitMap(aare::InclusiveROI const &roi_user, - aare::InclusiveROI const &roi_group, - int multiplicator, Rotation rot, int shifty = 0); +model::MappingResult generateUnitMap(aare::InclusiveROI const &roi_user, + aare::InclusiveROI const &roi_group, + int multiplicator, defs::Rotation rot, + int shifty = 0); /** * Utility to join to separately mapped core units of a Strixel Quad (bottom and * top half with gap-pixels in-between) */ -MappingResult joinQuadMaps(MappingResult const &bottom, - MappingResult const &top, int gap_rows); +model::MappingResult joinQuadMaps(model::MappingResult const &bottom, + model::MappingResult const &top, + int gap_rows); /** * Public API: @@ -166,10 +134,9 @@ MappingResult joinQuadMaps(MappingResult const &bottom, * shifted in y, auto-rotates depending on chip_id or user supplied rotation, * x-shift is possible for completeness */ -MappingResult -generateMPStrixelMapping(aare::InclusiveROI const &roi_user_module, - SensorKey key, int chip_id, - std::optional user_rot, BondShift); +model::MappingResult generateMPStrixelMapping( + aare::InclusiveROI const &roi_user_module, defs::SensorKey key, int chip_id, + std::optional user_rot, defs::BondShift); /** * Public API: @@ -182,10 +149,9 @@ generateMPStrixelMapping(aare::InclusiveROI const &roi_user_module, * \param bond_shift Included for completeness, should always be 0 for Quad * (give default constructed) */ -MappingResult -generateQuadStrixelMapping(aare::InclusiveROI const &roi_user_module, - SensorKey key, std::optional user_rot, - BondShift); +model::MappingResult generateQuadStrixelMapping( + aare::InclusiveROI const &roi_user_module, defs::SensorKey key, + std::optional user_rot, defs::BondShift); /** * Public API: @@ -217,17 +183,17 @@ void ApplyRemap(aare::NDView const &input, } // namespace aare::remap::algo namespace aare::remap::format { -using namespace aare::remap::model; /** * Helpers for printing */ -static inline std::string toString(SensorKey); -static inline std::string toString(SensorLayout); -static inline std::string toString(SensorTech); -static inline std::string toString(SensorRevision); -static inline std::string toString(Rotation); -static inline std::string toString(StrixelSensorConfig const &c); -inline std::ostream &operator<<(std::ostream &os, StrixelSensorConfig const &c); +static inline std::string toString(defs::SensorKey); +static inline std::string toString(defs::SensorLayout); +static inline std::string toString(defs::SensorTech); +static inline std::string toString(defs::SensorRevision); +static inline std::string toString(defs::Rotation); +static inline std::string toString(model::StrixelSensorConfig const &c); +inline std::ostream &operator<<(std::ostream &os, + model::StrixelSensorConfig const &c); } // namespace aare::remap::format \ No newline at end of file diff --git a/include/aare/RemapConfig.hpp b/include/aare/RemapConfig.hpp index 7b6f244..2453924 100644 --- a/include/aare/RemapConfig.hpp +++ b/include/aare/RemapConfig.hpp @@ -1,6 +1,38 @@ #include "aare/InclusiveROI.hpp" // IMPORTANT: Uses InclusiveROI!!! -namespace aare::remap::config { +namespace aare::remap::defs { + +enum class SensorTech : int { iLGAD, TEW }; + +// This is dummy for now because it is not yet decided how best to depict the +// differences in batches R&D, production and year in a scalable way with +// unified naming conventions +enum class SensorRevision : int { RevA, RevB, RevC }; + +enum class SensorLayout : int { + Halfmodule, // not implemented yet! + Quad, + DoubleChip, // not implemented yet (new batch)! + SingleMP37, // not implemented yet (TEW 2024) + SingleMP25, + SingleMP18, + SingleMP15 +}; + +// Orientation of the sensor with respect to the ASICs / the HDI +// Normal means lower part of sensor (as in GDS) aligns with lower part of HDI +enum class Rotation : int { Normal = 0, Inverse = 1 }; + +struct SensorKey { + SensorTech tech; + SensorRevision rev = SensorRevision::RevA; + SensorLayout layout; +}; + +struct BondShift { + int x = 0; + int y = 0; +}; /** * Helper structs for strong-typing @@ -38,8 +70,7 @@ struct SingleChipMP_iLGAD { .multiplicator = 3, .x_shift = 1, .strixel_roi = - InclusiveROI{chip.guardring + 1, - chip.cols - chip.guardring - 1, + InclusiveROI{chip.guardring + 1, chip.cols - chip.guardring - 1, chip.guardring, (chip.rows / 4) - 1}, .nrows_remap = ((chip.rows / 4) - chip.guardring) * 3, .ncols_remap = (chip.cols - (2 * chip.guardring) - 1) / 3, @@ -50,8 +81,7 @@ struct SingleChipMP_iLGAD { .multiplicator = 5, .x_shift = 3, .strixel_roi = - InclusiveROI{chip.guardring + 3, - chip.cols - chip.guardring - 1, + InclusiveROI{chip.guardring + 3, chip.cols - chip.guardring - 1, chip.rows / 4, (chip.rows / 4) * 2 - 1}, .nrows_remap = (chip.rows / 4) * 5, .ncols_remap = (chip.cols - (2 * chip.guardring) - 3) / 5, @@ -62,10 +92,9 @@ struct SingleChipMP_iLGAD { static inline const StrixelGeometry P18 = { .multiplicator = 4, .x_shift = 2, - .strixel_roi = InclusiveROI{chip.guardring + 2, - chip.cols - chip.guardring - 1, - (chip.rows / 4) * 2, - chip.rows - chip.guardring - 1}, + .strixel_roi = + InclusiveROI{chip.guardring + 2, chip.cols - chip.guardring - 1, + (chip.rows / 4) * 2, chip.rows - chip.guardring - 1}, .nrows_remap = ((chip.rows / 4) * 2 - chip.guardring) * 4, .ncols_remap = (chip.cols - (2 * chip.guardring) - 2) / 4, .pitch_um = 18.75}; @@ -86,8 +115,7 @@ struct SingleChipMP_TEW { static inline const StrixelGeometry P25 = { .multiplicator = 3, .x_shift = 1, - .strixel_roi = - InclusiveROI{1, chip.cols - 1, 0, (chip.rows / 4) - 1}, + .strixel_roi = InclusiveROI{1, chip.cols - 1, 0, (chip.rows / 4) - 1}, .nrows_remap = (chip.rows / 4) * 3, .ncols_remap = chip.cols / 3, // 85 .pitch_um = 25.0}; @@ -107,8 +135,8 @@ struct SingleChipMP_TEW { static inline const StrixelGeometry P18 = { .multiplicator = 4, .x_shift = 0, - .strixel_roi = InclusiveROI{0, chip.cols - 1, - (chip.rows / 4) * 2, chip.rows - 1}, + .strixel_roi = + InclusiveROI{0, chip.cols - 1, (chip.rows / 4) * 2, chip.rows - 1}, .nrows_remap = ((chip.rows / 4) * 2) * 4, .ncols_remap = chip.cols / 4, .pitch_um = 18.75}; @@ -130,12 +158,12 @@ struct Quad_iLGAD { static inline const StrixelGeometry Half = { .multiplicator = 3, .x_shift = 2, - .strixel_roi = InclusiveROI{chip.guardring + 1, - chip.cols - chip.guardring - 1, - chip.guardring, chip.rows - 2}, + .strixel_roi = + InclusiveROI{chip.guardring + 1, chip.cols - chip.guardring - 1, + chip.guardring, chip.rows - 2}, .nrows_remap = (chip.rows - 1 - chip.guardring) * 3, .ncols_remap = (chip.cols - 2 - 2 * chip.guardring) / 3, .pitch_um = 25.0}; }; -} // namespace aare::remap::config \ No newline at end of file +} // namespace aare::remap::defs \ No newline at end of file diff --git a/src/Remap.cpp b/src/Remap.cpp index a68be1d..2fcfdd2 100644 --- a/src/Remap.cpp +++ b/src/Remap.cpp @@ -13,16 +13,16 @@ namespace aare::remap::model { // Factory function (public API) -StrixelSensorConfig makeSensorConfig(SensorKey key, - std::optional user_rot, +StrixelSensorConfig makeSensorConfig(defs::SensorKey key, + std::optional user_rot, std::optional chip_id, - BondShift bond_shift) { + defs::BondShift bond_shift) { auto const &sensor = resolve::strixelGeometry(key); auto const chip = resolve::chipGeometry(key); aare::InclusiveROI roi_module = resolve::moduleROI(key, chip_id); - Rotation rot = Rotation::Normal; + defs::Rotation rot = defs::Rotation::Normal; if (user_rot.has_value()) { rot = user_rot.value(); } else if (chip_id.has_value()) { @@ -38,7 +38,7 @@ StrixelSensorConfig makeSensorConfig(SensorKey key, cfg.strixel_geometry.strixel_roi, cfg.bond_shift.x, cfg.bond_shift.y); - if (cfg.rotation == Rotation::Inverse) + if (cfg.rotation == defs::Rotation::Inverse) cfg.strixel_geometry.strixel_roi = aare::inclusiveroi::geom::mirrorXY( cfg.strixel_geometry.strixel_roi, cfg.chip_geometry.cols, cfg.chip_geometry.rows); @@ -57,61 +57,61 @@ StrixelSensorConfig makeSensorConfig(SensorKey key, ******************************/ namespace aare::remap::format { -static inline std::string toString(SensorTech tech) { +static inline std::string toString(defs::SensorTech tech) { switch (tech) { - case SensorTech::iLGAD: + case defs::SensorTech::iLGAD: return "Technology: iLGAD"; - case SensorTech::TEW: + case defs::SensorTech::TEW: return "Technology: TEW"; default: return "SensorTech::Unknown"; } } -static inline std::string toString(SensorRevision rev) { +static inline std::string toString(defs::SensorRevision rev) { switch (rev) { - case SensorRevision::RevA: + case defs::SensorRevision::RevA: return "Revision: RevA"; - case SensorRevision::RevB: + case defs::SensorRevision::RevB: return "Revision: RevB"; - case SensorRevision::RevC: + case defs::SensorRevision::RevC: return "Revision: RevC"; default: return "SensorRevision::Unknown"; } } -static inline std::string toString(SensorLayout l) { +static inline std::string toString(defs::SensorLayout l) { switch (l) { - case SensorLayout::SingleMP25: + case defs::SensorLayout::SingleMP25: return "Layout: SingleMP25 (G1, 25 um pitch)"; - case SensorLayout::SingleMP15: + case defs::SensorLayout::SingleMP15: return "Layout: SingleMP15 (G2, 15 um pitch)"; - case SensorLayout::SingleMP18: + case defs::SensorLayout::SingleMP18: return "Layout: SingleMP18 (G3, 18.75 um pitch)"; - case SensorLayout::SingleMP37: + case defs::SensorLayout::SingleMP37: return "Layout: SingleMP37 (G4, 37.5 um pitch)"; - case SensorLayout::Quad: + case defs::SensorLayout::Quad: return "Layout: Quad (25 um pitch)"; - case SensorLayout::Halfmodule: + case defs::SensorLayout::Halfmodule: return "Layout: Halfmodule"; - case SensorLayout::DoubleChip: + case defs::SensorLayout::DoubleChip: return "Layout: DoubleChip"; default: return "SensorLayout::Unknown"; } } -static inline std::string toString(SensorKey key) { +static inline std::string toString(defs::SensorKey key) { return toString(key.tech) + " | " + toString(key.layout) + " | " + toString(key.rev); } -static inline std::string toString(Rotation r) { - return (r == Rotation::Normal ? "Normal" : "Inverse"); +static inline std::string toString(defs::Rotation r) { + return (r == defs::Rotation::Normal ? "Normal" : "Inverse"); } -static inline std::string toString(StrixelSensorConfig const &c) { +static inline std::string toString(model::StrixelSensorConfig const &c) { std::ostringstream os; os << "StrixelSensorConfig\n" @@ -142,7 +142,7 @@ static inline std::string toString(StrixelSensorConfig const &c) { } inline std::ostream &operator<<(std::ostream &os, - StrixelSensorConfig const &c) { + model::StrixelSensorConfig const &c) { return os << toString(c); } @@ -157,8 +157,6 @@ inline std::ostream &operator<<(std::ostream &os, ******************************/ namespace aare::remap::geom { -using namespace aare::remap::model; - aare::InclusiveROI alignROIs(aare::InclusiveROI const &roi_user, aare::InclusiveROI const &roi_base) { const int dx = roi_base.xmin; @@ -169,9 +167,9 @@ aare::InclusiveROI alignROIs(aare::InclusiveROI const &roi_user, // return roi::geom::translate(roi_user, roi_base.xmin, roi_base.ymin); } -Rotation autoRotate(int chip_id) { - return (chip_id == 1 ? Rotation::Normal - : chip_id == 6 ? Rotation::Inverse +defs::Rotation autoRotate(int chip_id) { + return (chip_id == 1 ? defs::Rotation::Normal + : chip_id == 6 ? defs::Rotation::Inverse : throw std::runtime_error("Unknown chip_id")); } @@ -186,12 +184,10 @@ Rotation autoRotate(int chip_id) { ******************************/ namespace aare::remap::algo { -using namespace aare::remap::model; -using namespace aare::remap::format; - -MappingResult generateUnitMap(aare::InclusiveROI const &roi_user, - aare::InclusiveROI const &roi_group, - int multiplicator, Rotation rot, int shifty) { +model::MappingResult generateUnitMap(aare::InclusiveROI const &roi_user, + aare::InclusiveROI const &roi_group, + int multiplicator, defs::Rotation rot, + int shifty) { // Helper to make sure that we work with a correct number of strixel columns // (i.e. that we do not map pixel columns if the ncols in ASIC pixel // coordinates is not a multiple of strixel ncols) @@ -205,7 +201,7 @@ MappingResult generateUnitMap(aare::InclusiveROI const &roi_user, std::vector mods(multiplicator); for (int i = 0; i < multiplicator; i++) mods[i] = i; - if (rot == Rotation::Inverse) + if (rot == defs::Rotation::Inverse) std::reverse(mods.begin(), mods.end()); // -- 1) Compute effective ROI = intersection( roi_user, roi_group ) @@ -292,8 +288,9 @@ MappingResult generateUnitMap(aare::InclusiveROI const &roi_user, return {ord, nrows_strx, ncols_strx, multiplicator, eff}; } -MappingResult joinQuadMaps(MappingResult const &bottom, - MappingResult const &top, int gap_rows) { +model::MappingResult joinQuadMaps(model::MappingResult const &bottom, + model::MappingResult const &top, + int gap_rows) { if (bottom.cols == 0 && top.cols == 0) return {{}, 0, 0, -1, aare::InclusiveROI::emptyROI()}; @@ -328,17 +325,17 @@ MappingResult joinQuadMaps(MappingResult const &bottom, return {ord, global_cols, global_rows, bottom.multiplicator, scd}; } -MappingResult generateMPStrixelMapping( - aare::InclusiveROI const &roi_user_module, SensorKey key, int chip_id, - std::optional user_rot, BondShift bond_shift) { +model::MappingResult generateMPStrixelMapping( + aare::InclusiveROI const &roi_user_module, defs::SensorKey key, int chip_id, + std::optional user_rot, defs::BondShift bond_shift) { // -- 1) initialize config - auto config = makeSensorConfig(key, user_rot, chip_id, bond_shift); + auto config = model::makeSensorConfig(key, user_rot, chip_id, bond_shift); // static_assert(std::is_same_v); - std::cout << "Initialized config: " << config << std::endl; + std::cout << "Initialized config: " << format::toString(config) << std::endl; - if (!(key.layout == SensorLayout::SingleMP25 || - key.layout == SensorLayout::SingleMP15 || - key.layout == SensorLayout::SingleMP18)) { + if (!(key.layout == defs::SensorLayout::SingleMP25 || + key.layout == defs::SensorLayout::SingleMP15 || + key.layout == defs::SensorLayout::SingleMP18)) { throw std::runtime_error("Invalid sensor type!"); } /* else { std::cout << "Sensor type " << config.label << std::endl; @@ -346,7 +343,7 @@ MappingResult generateMPStrixelMapping( // -- 2) transform user ROI to sensor-local coordinates const aare::InclusiveROI roi_user_local = - aare::remap::geom::alignROIs(roi_user_module, config.roi_module); + geom::alignROIs(roi_user_module, config.roi_module); std::cout << "Transformed user ROI: " << roi_user_local << std::endl; // -- 3) remap @@ -364,20 +361,19 @@ MappingResult generateMPStrixelMapping( aare::InclusiveROI::emptyROI()}; } -MappingResult -generateQuadStrixelMapping(aare::InclusiveROI const &roi_user_module, - SensorKey key, std::optional user_rot, - BondShift bond_shift) { +model::MappingResult generateQuadStrixelMapping( + aare::InclusiveROI const &roi_user_module, defs::SensorKey key, + std::optional user_rot, defs::BondShift bond_shift) { // -- 1) initialize configs - auto config = makeSensorConfig(key, user_rot, std::nullopt, bond_shift); + auto config = model::makeSensorConfig(key, user_rot, std::nullopt, bond_shift); - if (!(key.layout == SensorLayout::Quad)) { + if (!(key.layout == defs::SensorLayout::Quad)) { throw std::runtime_error("Invalid sensor type!"); } // -- 2) transform user module coordinates to local coordinates aare::InclusiveROI roi_user_local = - aare::remap::geom::alignROIs(roi_user_module, config.roi_module); + geom::alignROIs(roi_user_module, config.roi_module); std::cout << "Transformed user ROI: " << roi_user_local << std::endl; // -- 3) get definition of half quad ROI @@ -386,14 +382,14 @@ generateQuadStrixelMapping(aare::InclusiveROI const &roi_user_module, // -- 4) remap bottom half (normal mod order) auto bottom = generateUnitMap(roi_user_local, halfquad, config.strixel_geometry.multiplicator, - Rotation::Normal, /*shifty=*/0); + defs::Rotation::Normal, /*shifty=*/0); // -- 5) top half (mirrored ROI, inverse mod order) aare::InclusiveROI top_halfquad = aare::inclusiveroi::geom::mirrorXY( halfquad, config.chip_geometry.cols, config.chip_geometry.rows); auto top = generateUnitMap(roi_user_local, top_halfquad, config.strixel_geometry.multiplicator, - Rotation::Inverse, /*shifty=*/0); + defs::Rotation::Inverse, /*shifty=*/0); // -- 6) compose into quad constexpr int gap_rows = 12; // I don't like that this is hardcoded here @@ -412,36 +408,38 @@ generateQuadStrixelMapping(aare::InclusiveROI const &roi_user_module, * **************************** ******************************/ namespace aare::remap::resolve { -using namespace aare::remap::config; -StrixelGeometry const &strixelGeometry(SensorKey key) { +defs::StrixelGeometry const &strixelGeometry(defs::SensorKey key) { + + using SL = aare::remap::defs::SensorLayout; + using ST = aare::remap::defs::SensorTech; switch (key.tech) { // ================= iLGAD ================= - case SensorTech::iLGAD: + case ST::iLGAD: switch (key.layout) { - case SensorLayout::SingleMP25: - return SingleChipMP_iLGAD::P25; - case SensorLayout::SingleMP15: - return SingleChipMP_iLGAD::P15; - case SensorLayout::SingleMP18: - return SingleChipMP_iLGAD::P18; - case SensorLayout::Quad: - return Quad_iLGAD::Half; + case SL::SingleMP25: + return defs::SingleChipMP_iLGAD::P25; + case SL::SingleMP15: + return defs::SingleChipMP_iLGAD::P15; + case SL::SingleMP18: + return defs::SingleChipMP_iLGAD::P18; + case SL::Quad: + return defs::Quad_iLGAD::Half; default: throw std::runtime_error("Unsupported SensorLayout for iLGAD"); } // ================= TEW =================== - case SensorTech::TEW: + case ST::TEW: switch (key.layout) { - case SensorLayout::SingleMP25: - return SingleChipMP_TEW::P25; - case SensorLayout::SingleMP15: - return SingleChipMP_TEW::P15; - case SensorLayout::SingleMP18: - return SingleChipMP_TEW::P18; + case SL::SingleMP25: + return defs::SingleChipMP_TEW::P25; + case SL::SingleMP15: + return defs::SingleChipMP_TEW::P15; + case SL::SingleMP18: + return defs::SingleChipMP_TEW::P18; default: throw std::runtime_error("Unsupported SensorLayout for TEW"); } @@ -451,10 +449,10 @@ StrixelGeometry const &strixelGeometry(SensorKey key) { } } -ChipGeometry chipGeometry(SensorKey key) { +defs::ChipGeometry chipGeometry(defs::SensorKey key) { - using SL = SensorLayout; - using ST = SensorTech; + using SL = aare::remap::defs::SensorLayout; + using ST = aare::remap::defs::SensorTech; switch (key.layout) { case SL::SingleMP25: @@ -462,16 +460,16 @@ ChipGeometry chipGeometry(SensorKey key) { case SL::SingleMP18: switch (key.tech) { case ST::iLGAD: - return SingleChipMP_iLGAD::chip; + return defs::SingleChipMP_iLGAD::chip; case ST::TEW: - return SingleChipMP_TEW::chip; + return defs::SingleChipMP_TEW::chip; default: throw std::logic_error("Unsupported SensorTech"); } case SL::Quad: switch (key.tech) { case ST::iLGAD: - return Quad_iLGAD::chip; + return defs::Quad_iLGAD::chip; default: throw std::logic_error( "Unsupported SensorTech for SensorLayout Quad"); @@ -482,10 +480,10 @@ ChipGeometry chipGeometry(SensorKey key) { } } -aare::InclusiveROI moduleROI(SensorKey key, std::optional chip_id) { +aare::InclusiveROI moduleROI(defs::SensorKey key, std::optional chip_id) { - using SL = SensorLayout; - using ST = SensorTech; + using SL = aare::remap::defs::SensorLayout; + using ST = aare::remap::defs::SensorTech; auto requireChip = [&](bool needed) { if (needed && !chip_id) @@ -508,11 +506,11 @@ aare::InclusiveROI moduleROI(SensorKey key, std::optional chip_id) { switch (key.tech) { case ST::iLGAD: - return (cid == 1) ? SingleChipMP_iLGAD::chip1 - : SingleChipMP_iLGAD::chip6; + return (cid == 1) ? defs::SingleChipMP_iLGAD::chip1 + : defs::SingleChipMP_iLGAD::chip6; case ST::TEW: - return (cid == 1) ? SingleChipMP_TEW::chip1 - : SingleChipMP_TEW::chip6; + return (cid == 1) ? defs::SingleChipMP_TEW::chip1 + : defs::SingleChipMP_TEW::chip6; default: throw std::logic_error("Unsupported SensorTech"); } @@ -524,7 +522,7 @@ aare::InclusiveROI moduleROI(SensorKey key, std::optional chip_id) { switch (key.tech) { case ST::iLGAD: - return Quad_iLGAD::coords; + return defs::Quad_iLGAD::coords; default: throw std::logic_error("Quad layout not supported for this tech"); }