Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-02 08:17:03

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 #pragma once
0010 
0011 #include "Acts/Geometry/GeometryContext.hpp"
0012 #include "Acts/Navigation/IndexGridNavigationPolicy.hpp"
0013 #include "ActsPlugins/Json/ActsJson.hpp"
0014 
0015 #include <nlohmann/json.hpp>
0016 
0017 // Custom Json encoder/decoders. Naming is mandated by nlohmann::json and thus
0018 // can not match our naming guidelines.
0019 namespace Acts {
0020 
0021 class TrackingVolume;
0022 
0023 namespace IndexGridNavigationJsonConverter {
0024 
0025 /// Configure the conversion through that struct
0026 struct Options {
0027   /// Whether to write the surfaces assigned to the grid
0028   bool writeSurfaces = true;
0029   /// Write projected surfaces (i.e. in grid frame for plotting)
0030   bool writeProjectedSurfaces = false;
0031   /// Number of polyhedron points to use for projected surface representation
0032   std::size_t numPolyhedronPoints = 20;
0033 };
0034 
0035 /// Convert an IndexGridNavigationPolicy for regular cylinder to Json
0036 /// @param policy The policy to convert
0037 /// @return The resulting json object
0038 nlohmann::json toJson(const RegularCylinderIndexGridNavigationPolicy& policy);
0039 
0040 /// Convert an IndexGridNavigationPolicy for regular cylinder to Json
0041 /// @param gctx The geometry context
0042 /// @param policy The policy to convert
0043 /// @param volume The tracking volume holding the surfaces
0044 /// @param options The options for the conversion
0045 /// @return The resulting json object
0046 nlohmann::json toJson(const GeometryContext& gctx,
0047                       const RegularCylinderIndexGridNavigationPolicy& policy,
0048                       const TrackingVolume& volume,
0049                       const Options& options = Options());
0050 
0051 /// Convert an IndexGridNavigationPolicy for regular plane to Json
0052 /// @param policy The policy to convert
0053 /// @return The resulting json object
0054 nlohmann::json toJson(const RegularPlaneIndexGridNavigationPolicy& policy);
0055 
0056 /// Convert an IndexGridNavigationPolicy for regular plane to Json
0057 /// @param gctx The geometry context
0058 /// @param policy The policy to convert
0059 /// @param volume The tracking volume holding the surfaces
0060 /// @param options The options for the conversion
0061 /// @return The resulting json object
0062 nlohmann::json toJson(const GeometryContext& gctx,
0063                       const RegularPlaneIndexGridNavigationPolicy& policy,
0064                       const TrackingVolume& volume,
0065                       const Options& options = Options());
0066 
0067 /// Convert an IndexGridNavigationPolicy for regular disc to Json
0068 /// @param policy The policy to convert
0069 /// @return The resulting json object
0070 nlohmann::json toJson(const RegularDiscIndexGridNavigationPolicy& policy);
0071 
0072 /// Convert an IndexGridNavigationPolicy for regular disc to Json
0073 /// @param gctx The geometry context
0074 /// @param policy The policy to convert
0075 /// @param volume The tracking volume holding the surfaces
0076 /// @param options The options for the conversion
0077 /// @return The resulting json object
0078 nlohmann::json toJson(const GeometryContext& gctx,
0079                       const RegularDiscIndexGridNavigationPolicy& policy,
0080                       const TrackingVolume& volume,
0081                       const Options& options = Options());
0082 
0083 /// Convert an IndexGridNavigationPolicy for regular ring to Json
0084 /// @param policy The policy to convert
0085 /// @return The resulting json object
0086 nlohmann::json toJson(const RegularRingIndexGridNavigationPolicy& policy);
0087 
0088 /// Convert an IndexGridNavigationPolicy for regular ring to Json
0089 /// @param gctx The geometry context
0090 /// @param policy The policy to convert
0091 /// @param volume The tracking volume holding the surfaces
0092 /// @param options The options for the conversion
0093 /// @return The resulting json object
0094 nlohmann::json toJson(const GeometryContext& gctx,
0095                       const RegularRingIndexGridNavigationPolicy& policy,
0096                       const TrackingVolume& volume,
0097                       const Options& options = Options());
0098 
0099 }  // namespace IndexGridNavigationJsonConverter
0100 }  // namespace Acts