File indexing completed on 2025-10-15 08:06:04
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <boost/test/unit_test.hpp>
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Detector/CylindricalContainerBuilder.hpp"
0013 #include "Acts/Detector/Detector.hpp"
0014 #include "Acts/Detector/DetectorBuilder.hpp"
0015 #include "Acts/Detector/DetectorComponents.hpp"
0016 #include "Acts/Detector/DetectorVolume.hpp"
0017 #include "Acts/Detector/GeometryIdGenerator.hpp"
0018 #include "Acts/Detector/PortalGenerators.hpp"
0019 #include "Acts/Detector/interface/IDetectorComponentBuilder.hpp"
0020 #include "Acts/Geometry/CylinderVolumeBounds.hpp"
0021 #include "Acts/Geometry/GeometryContext.hpp"
0022 #include "Acts/Navigation/DetectorVolumeFinders.hpp"
0023 #include "Acts/Navigation/InternalNavigation.hpp"
0024 #include "Acts/Surfaces/CylinderBounds.hpp"
0025 #include "Acts/Surfaces/CylinderSurface.hpp"
0026 #include "Acts/Surfaces/DiscSurface.hpp"
0027 #include "Acts/Surfaces/RadialBounds.hpp"
0028 #include "Acts/Surfaces/Surface.hpp"
0029 #include "Acts/Utilities/BinningType.hpp"
0030 #include "Acts/Utilities/Enumerate.hpp"
0031 #include "Acts/Utilities/Logger.hpp"
0032 #include "ActsPlugins/ActSVG/DetectorSvgConverter.hpp"
0033 #include "ActsTests/CommonHelpers/CylindricalDetector.hpp"
0034
0035 #include <fstream>
0036 #include <memory>
0037 #include <vector>
0038
0039 using namespace Acts;
0040 using namespace Acts::Experimental;
0041 using namespace ActsPlugins;
0042
0043 GeometryContext tContext;
0044
0045 namespace ActsTests {
0046
0047 BOOST_AUTO_TEST_SUITE(ActSVGSuite)
0048
0049 BOOST_AUTO_TEST_CASE(CylindricalDetector) {
0050 auto detector = buildCylindricalDetector(tContext);
0051
0052 Svg::DetectorConverter::Options detectorOptions;
0053 auto pDetector =
0054 Svg::DetectorConverter::convert(tContext, *detector, detectorOptions);
0055 pDetector._name = detector->name();
0056
0057
0058 actsvg::style::color gray({{155, 155, 155}});
0059 actsvg::style::color pink({{255, 153, 255}});
0060 actsvg::style::color brown({{153, 102, 51}});
0061 actsvg::style::color red({{255, 0, 0}});
0062 actsvg::style::color green({{0, 255, 0}});
0063 actsvg::style::color blue({{0, 0, 255}});
0064 std::vector<actsvg::style::color> colors = {gray, pink, brown,
0065 red, green, blue};
0066 for (auto& c : colors) {
0067 c._opacity = 0.1;
0068 }
0069
0070 pDetector.colorize(colors);
0071
0072
0073 auto dv_zr = Svg::View::zr(pDetector, pDetector._name);
0074 Svg::toFile({dv_zr}, pDetector._name + "_zr.svg");
0075 }
0076
0077 BOOST_AUTO_TEST_SUITE_END()
0078
0079 }