Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DetectorVolumeJsonConverter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DetectorVolumeJsonConverter.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 
16 
17 // Custom Json encoder/decoders
18 
19 namespace Acts {
20 
21 namespace Experimental {
22 class DetectorVolume;
23 class Portal;
24 } // namespace Experimental
25 
26 namespace DetectorVolumeJsonConverter {
27 
28 struct Options {
29  // The options how surfaces are written out
31  // The options how portals are written out
33  // The options how transforms are written out
35 };
36 
46 nlohmann::json toJson(
48  const std::vector<const Experimental::DetectorVolume*>& detectorVolumes,
49  const std::vector<const Experimental::Portal*>& portals = {},
50  const Options& options = Options{});
51 
60 nlohmann::json toJsonDetray(
61  const GeometryContext& gctx, const Experimental::DetectorVolume& volume,
62  const std::vector<const Experimental::DetectorVolume*>& detectorVolumes,
63  const Options& options = Options{});
64 
73 std::shared_ptr<Experimental::DetectorVolume> fromJson(
74  const GeometryContext& gctx, const nlohmann::json& jVolume);
75 
76 } // namespace DetectorVolumeJsonConverter
77 } // namespace Acts