diff --git a/include/aare/RemapFormat.hpp b/include/aare/RemapFormat.hpp new file mode 100644 index 0000000..96d45c2 --- /dev/null +++ b/include/aare/RemapFormat.hpp @@ -0,0 +1,12 @@ +#pragma once + +#include "aare/RemapDefs.hpp" + +namespace aare::remap::format { +static inline std::string toString(defs::Rotation); +static inline std::string toString(defs::SensorPixelGeometry const &g); +static inline std::string toString(defs::SensorStrixelGeometry const &g); +static inline std::string toString(defs::SensorGroupConfig const &c); +inline std::ostream &operator<<(std::ostream &os, + defs::SensorGroupConfig const &c); +} // namespace aare::remap::format \ No newline at end of file diff --git a/src/RemapFormat.cpp b/src/RemapFormat.cpp new file mode 100644 index 0000000..4020f42 --- /dev/null +++ b/src/RemapFormat.cpp @@ -0,0 +1,48 @@ +#include "aare/RemapFormat.hpp" + +#include + +namespace aare::remap::format { +static inline std::string toString(defs::Rotation r) { + return (r == defs::Rotation::Normal ? "Normal" : "Inverse"); +} + +static inline std::string toString(defs::SensorPixelGeometry const &g) { + std::ostringstream os; + + os << "SensorPixelGeometry\n" + << " cols x rows: " << g.cols << " x " << g.rows << "\n" + << " guardring :\n" + << " x = " << g.guardring.x << "\n" + << " y = " << g.guardring.y << "\n"; + + return os.str(); +} + +static inline std::string toString(defs::SensorStrixelGeometry const &g) { + std::ostringstream os; + + os << "SensorStrixelGeometry\n" + << " multiplicity: " << g.multiplicity << "\n" + << " pitch : " << g.pitch_um << " um\n"; + + return os.str(); +} + +static inline std::string toString(defs::SensorGroupConfig const &c) { + std::ostringstream os; + + os << "SensorGroupConfig\n" + << toString(c.pixel) << "\n" + << toString(c.strixel) << "\n" + << " placement on sensor:\n" + << c.placement_on_sensor << "\n"; + + return os.str(); +} + +inline std::ostream &operator<<(std::ostream &os, + defs::SensorGroupConfig const &c) { + return os << toString(c); +} +} // namespace aare::remap::format \ No newline at end of file