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/Plugins/ActSVG/LayerSvgConverter.hpp"
0013 #include "Acts/Plugins/ActSVG/SvgUtils.hpp"
0014 #include <actsvg/core.hpp>
0015 #include <actsvg/meta.hpp>
0016 
0017 namespace Acts {
0018 
0019 class TrackingGeometry;
0020 class TrackingVolume;
0021 
0022 namespace Svg {
0023 
0024 namespace TrackingGeometryConverter {
0025 
0026 /// Nested Options struct for the writing configuration
0027 struct Options {
0028   /// Prefix the output names
0029   std::string prefix = "";
0030   /// Write the layer conversion options
0031   GeometryHierarchyMap<LayerConverter::Options> layerOptions;
0032 };
0033 
0034 /// State object to collect geometry-wise information
0035 struct State {
0036   std::vector<actsvg::svg::object> xyCrossSection;
0037   std::vector<actsvg::svg::object> zrCrossSection;
0038 
0039   std::vector<actsvg::svg::object> finalViews;
0040 };
0041 
0042 /// Write svg files per tracking geometry
0043 ///
0044 /// @param gctx the geometry context
0045 /// @param tGeometry the tracking geometry
0046 /// @param cOptions the conversion options
0047 ///
0048 /// @return a vector of svg objects
0049 std::vector<actsvg::svg::object> convert(const GeometryContext& gctx,
0050                                          const TrackingGeometry& tGeometry,
0051                                          const Options& cOptions);
0052 
0053 /// Recursivele conversion of volumes
0054 ///
0055 /// @param gctx the geometry context
0056 /// @param tVolume the tracking volume
0057 /// @param cOptions the conversion options
0058 /// @param cState [in,out] the conversion state collecting the input
0059 ///
0060 void convert(const GeometryContext& gctx, const TrackingVolume& tVolume,
0061              const Options& cOptions, State& cState);
0062 
0063 }  // namespace TrackingGeometryConverter
0064 
0065 namespace TrackingGeometryProjections {
0066 
0067 struct Options {
0068   std::string prefix = "";
0069 
0070   TrackingGeometryConverter::Options trackingGeometryOptions;
0071 
0072   std::array<std::array<double, 2>, 2> rzAxes;
0073   std::vector<double> rzEtaLines;
0074 };
0075 
0076 /// Convert into xy and zr projections only
0077 ///
0078 /// @param gctx the geometry context
0079 /// @param tVolume the tracking volume
0080 /// @param cOptions the conversion options
0081 ///
0082 /// @note best performant if configured with options
0083 /// that omit the module info and grid info
0084 ///
0085 std::array<actsvg::svg::object, 2> convert(
0086     const GeometryContext& gctx, const Acts::TrackingGeometry& tGeometry,
0087     const Options& cOptions);
0088 }  // namespace TrackingGeometryProjections
0089 
0090 }  // namespace Svg
0091 
0092 }  // namespace Acts