Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:15:18

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
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 }