Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-11 09:40:21

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