Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PortalJsonConverter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PortalJsonConverter.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2023 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 
9 #pragma once
10 
17 
18 // Custom Json encoder/decoders
19 
20 namespace Acts {
21 
22 namespace Experimental {
23 class DetectorVolume;
24 class Portal;
25 } // namespace Experimental
26 
27 namespace PortalJsonConverter {
28 
29 struct Options {
33 };
34 
43 nlohmann::json toJson(
44  const GeometryContext& gctx, const Experimental::Portal& portal,
45  const std::vector<const Experimental::DetectorVolume*>& detectorVolumes,
46  const Options& options = Options{});
47 
64 std::vector<nlohmann::json> toJsonDetray(
65  const GeometryContext& gctx, const Experimental::Portal& portal,
66  std::size_t ip, const Experimental::DetectorVolume& volume,
67  const OrientedSurfaces& orientedSurfaces,
68  const std::vector<const Experimental::DetectorVolume*>& detectorVolumes,
69  const Options& options = Options{});
70 
76 nlohmann::json toJson(
78  const std::vector<const Experimental::DetectorVolume*>& detectorVolumes);
79 
87 std::shared_ptr<Experimental::Portal> fromJson(
88  const GeometryContext& gctx, const nlohmann::json& jPortal,
89  const std::vector<std::shared_ptr<Experimental::DetectorVolume>>&
90  detectorVolumes);
91 
92 } // namespace PortalJsonConverter
93 } // namespace Acts