File indexing completed on 2025-01-30 09:15:18
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Plugins/Json/SurfaceBoundsJsonConverter.hpp"
0010
0011 #include "Acts/Plugins/Json/DetrayJsonHelper.hpp"
0012 #include "Acts/Surfaces/SurfaceBounds.hpp"
0013
0014 void Acts::to_json(nlohmann::json& j, const Acts::SurfaceBounds& bounds) {
0015 j["type"] = bounds.type();
0016 j["values"] = bounds.values();
0017 }
0018
0019 nlohmann::json Acts::SurfaceBoundsJsonConverter::toJson(
0020 const Acts::SurfaceBounds& bounds) {
0021 return nlohmann::json(bounds);
0022 }
0023
0024 nlohmann::json Acts::SurfaceBoundsJsonConverter::toJsonDetray(
0025 const Acts::SurfaceBounds& bounds, bool portal) {
0026 nlohmann::json jMask;
0027 auto [shape, boundaries] = DetrayJsonHelper::maskFromBounds(bounds, portal);
0028 jMask["shape"] = shape;
0029 jMask["boundaries"] = boundaries;
0030 return jMask;
0031 }