Back to home page

EIC code displayed by LXR

 
 

    


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

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/DetectorVolumeSvgConverter.hpp"
0014 #include "ActsPlugins/ActSVG/SvgUtils.hpp"
0015 #include <actsvg/core.hpp>
0016 #include <actsvg/meta.hpp>
0017 
0018 namespace Acts::Experimental {
0019 class Detector;
0020 }  // namespace Acts::Experimental
0021 
0022 namespace ActsPlugins::Svg {
0023 
0024 using ProtoDetector = actsvg::proto::detector<std::vector<Acts::Vector3>>;
0025 
0026 namespace DetectorConverter {
0027 
0028 /// A nested options class for the layer conversion
0029 struct Options {
0030   /// Top level options
0031   DetectorVolumeConverter::Options volumeOptions;
0032 };
0033 
0034 /// Write/create the detector volume
0035 ///
0036 /// @param gctx the geometry context
0037 /// @param detector the detector volumeto be displayed
0038 /// @param detectorOptions the conversion objects
0039 ///
0040 /// @return a vector of svg objects
0041 ProtoDetector convert(const Acts::GeometryContext& gctx,
0042                       const Acts::Experimental::Detector& detector,
0043                       const Options& detectorOptions);
0044 
0045 }  // namespace DetectorConverter
0046 
0047 namespace View {
0048 
0049 /// Convert into an ActsPlugins::Svg::object with an XY view
0050 ///
0051 /// @param detector is the detector (proto representation)
0052 /// @param identification is the to be translated id_ for actsvg
0053 ///
0054 /// @return an svg object that can be written out directly to disc
0055 static inline actsvg::svg::object xy(const ProtoDetector& detector,
0056                                      const std::string& identification) {
0057   actsvg::views::x_y xyView;
0058   return actsvg::display::detector(identification, detector, xyView);
0059 }
0060 
0061 /// Convert into an ActsPlugins::Svg::object with an Zr view
0062 ///
0063 /// @param detector is the detector (proto representation)
0064 /// @param identification is the to be translated id_ for actsvg
0065 ///
0066 /// @return an svg object that can be written out directly to disc
0067 static inline actsvg::svg::object zr(const ProtoDetector& detector,
0068                                      const std::string& identification) {
0069   actsvg::views::z_r zrView;
0070   return actsvg::display::detector(identification, detector, zrView);
0071 }
0072 
0073 }  // namespace View
0074 
0075 }  // namespace ActsPlugins::Svg