Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-11-23 09:33:26

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/Geometry/GeometryHierarchyMap.hpp"
0013 #include "Acts/Plugins/ActSVG/SvgUtils.hpp"
0014 #include <actsvg/core.hpp>
0015 #include <actsvg/meta.hpp>
0016 
0017 #include <numbers>
0018 
0019 namespace Acts {
0020 
0021 class Layer;
0022 
0023 namespace Svg {
0024 
0025 using ProtoVolume = actsvg::proto::volume<std::vector<Vector3>>;
0026 
0027 static std::array<double, 2> noLimitZ = {std::numeric_limits<double>::lowest(),
0028                                          std::numeric_limits<double>::max()};
0029 
0030 static std::array<double, 2> noLimitPhi = {-std::numbers::pi, std::numbers::pi};
0031 
0032 namespace LayerConverter {
0033 
0034 /// The enumeration for sheets
0035 enum Sheets {
0036   eModuleInfo = 0,
0037   eGridInfo = 1,
0038   eCrossSectionXY = 2,
0039   eCrossSectionZR = 3
0040 };
0041 
0042 /// A nested options class for the layer conversion
0043 struct Options {
0044   /// The name for the conversion object
0045   std::string name = "";
0046   /// The style of the surface objects
0047   GeometryHierarchyMap<Style> surfaceStyles;
0048   /// The z limit for projections
0049   std::array<double, 2> zRange = noLimitZ;
0050   /// The phi limit for projections
0051   std::array<double, 2> phiRange = noLimitPhi;
0052   /// Configuration of the views
0053   bool gridInfo = true;
0054   bool moduleInfo = true;
0055   bool projectionInfo = true;
0056   /// Label checks
0057   bool labelProjection = false;
0058   double labelGauge = 0.;
0059 };
0060 
0061 /// Write/create the layer sheets for a given layer
0062 ///
0063 /// @param gctx the geometry context
0064 /// @param layer the layer to be displayed
0065 /// @param cOptions the conversion objects
0066 ///
0067 /// @return a vector of svg objects
0068 std::vector<actsvg::svg::object> convert(const GeometryContext& gctx,
0069                                          const Layer& layer,
0070                                          const Options& cOptions);
0071 
0072 }  // namespace LayerConverter
0073 
0074 }  // namespace Svg
0075 
0076 }  // namespace Acts