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