Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SurfaceBoundsJsonConverter.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SurfaceBoundsJsonConverter.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2021 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
10 
13 
14 void Acts::to_json(nlohmann::json& j, const Acts::SurfaceBounds& bounds) {
15  j["type"] = bounds.type();
16  j["values"] = bounds.values();
17 }
18 
20  const Acts::SurfaceBounds& bounds) {
21  return nlohmann::json(bounds);
22 }
23 
25  const Acts::SurfaceBounds& bounds, bool portal) {
26  nlohmann::json jMask;
27  auto [shape, boundaries] = DetrayJsonHelper::maskFromBounds(bounds, portal);
28  jMask["shape"] = shape;
29  jMask["boundaries"] = boundaries;
30  return jMask;
31 }