|
||||
File indexing completed on 2025-01-18 09:27:42
0001 // This file is part of the Acts project. 0002 // 0003 // Copyright (C) 2023 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 http://mozilla.org/MPL/2.0/. 0008 0009 #pragma once 0010 0011 #include "Acts/Geometry/GeometryContext.hpp" 0012 #include "Acts/Plugins/Json/ActsJson.hpp" 0013 #include "Acts/Plugins/Json/DetectorVolumeJsonConverter.hpp" 0014 0015 // Custom Json encoder/decoders 0016 0017 namespace Acts { 0018 0019 namespace Experimental { 0020 class Detector; 0021 } 0022 0023 namespace DetectorJsonConverter { 0024 0025 struct Options { 0026 DetectorVolumeJsonConverter::Options volumeOptions = 0027 DetectorVolumeJsonConverter::Options{}; 0028 }; 0029 0030 /// @brief Convert to json format 0031 /// 0032 /// @param gctx the geometry context 0033 /// @param detector the detector instance 0034 /// @param options the writing options that propagate 0035 /// to the downstream converters 0036 /// 0037 /// @return a json object 0038 nlohmann::json toJson(const GeometryContext& gctx, 0039 const Experimental::Detector& detector, 0040 const Options& options = Options{}); 0041 0042 /// @brief Convert to detray json format 0043 /// 0044 /// @param gctx the geometry context 0045 /// @param detector the detector instance 0046 /// @param options the writing options that propagate 0047 /// to the downstream converters 0048 /// 0049 /// @return a json object in detray format 0050 nlohmann::json toJsonDetray(const GeometryContext& gctx, 0051 const Experimental::Detector& detector, 0052 const Options& options = Options{}); 0053 0054 /// @brief convert from json format 0055 /// 0056 /// @param gctx the geometry context 0057 /// @param jDetector the json object 0058 /// 0059 /// @return a newly created shared Detector object 0060 std::shared_ptr<Experimental::Detector> fromJson( 0061 const GeometryContext& gctx, const nlohmann::json& jDetector); 0062 0063 } // namespace DetectorJsonConverter 0064 } // namespace Acts
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |