File indexing completed on 2025-08-06 08:11:43
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <boost/test/unit_test.hpp>
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/Extent.hpp"
0013 #include "Acts/Plugins/Json/ExtentJsonConverter.hpp"
0014 #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp"
0015 #include "Acts/Utilities/BinningType.hpp"
0016
0017 #include <nlohmann/json.hpp>
0018
0019 using namespace Acts;
0020
0021 BOOST_AUTO_TEST_SUITE(ExtentJsonConverter)
0022
0023 BOOST_AUTO_TEST_CASE(ExtentRoundtripTests) {
0024 Extent e;
0025 e.set(binR, 0, 200);
0026 e.set(binZ, -50, 50);
0027
0028 nlohmann::json j;
0029 j["extent"] = e;
0030
0031 Extent eIn = j["extent"];
0032
0033 CHECK_CLOSE_ABS(eIn.min(binR), e.min(binR), 10e-5);
0034 CHECK_CLOSE_ABS(eIn.max(binR), e.max(binR), 10e-5);
0035 CHECK_CLOSE_ABS(eIn.min(binZ), e.min(binZ), 10e-5);
0036 CHECK_CLOSE_ABS(eIn.max(binZ), e.max(binZ), 10e-5);
0037 }
0038
0039 BOOST_AUTO_TEST_SUITE_END()