File indexing completed on 2025-01-18 09:13:06
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/Plugins/ActSVG/DetectorSvgConverter.hpp"
0025 #include "Acts/Surfaces/CylinderBounds.hpp"
0026 #include "Acts/Surfaces/CylinderSurface.hpp"
0027 #include "Acts/Surfaces/DiscSurface.hpp"
0028 #include "Acts/Surfaces/RadialBounds.hpp"
0029 #include "Acts/Surfaces/Surface.hpp"
0030 #include "Acts/Tests/CommonHelpers/CylindricalDetector.hpp"
0031 #include "Acts/Utilities/BinningType.hpp"
0032 #include "Acts/Utilities/Enumerate.hpp"
0033 #include "Acts/Utilities/Logger.hpp"
0034
0035 #include <fstream>
0036 #include <memory>
0037 #include <vector>
0038
0039 using namespace Acts;
0040 using namespace Acts::Test;
0041 using namespace Acts::Experimental;
0042
0043 GeometryContext tContext;
0044
0045 BOOST_AUTO_TEST_SUITE(ActSvg)
0046
0047 BOOST_AUTO_TEST_CASE(CylindricalDetector) {
0048 auto detector = buildCylindricalDetector(tContext);
0049
0050 Acts::Svg::DetectorConverter::Options detectorOptions;
0051 auto pDetector = Acts::Svg::DetectorConverter::convert(tContext, *detector,
0052 detectorOptions);
0053 pDetector._name = detector->name();
0054
0055
0056 actsvg::style::color gray({{155, 155, 155}});
0057 actsvg::style::color pink({{255, 153, 255}});
0058 actsvg::style::color brown({{153, 102, 51}});
0059 actsvg::style::color red({{255, 0, 0}});
0060 actsvg::style::color green({{0, 255, 0}});
0061 actsvg::style::color blue({{0, 0, 255}});
0062 std::vector<actsvg::style::color> colors = {gray, pink, brown,
0063 red, green, blue};
0064 for (auto& c : colors) {
0065 c._opacity = 0.1;
0066 }
0067
0068 pDetector.colorize(colors);
0069
0070
0071 auto dv_zr = Acts::Svg::View::zr(pDetector, pDetector._name);
0072 Acts::Svg::toFile({dv_zr}, pDetector._name + "_zr.svg");
0073 }
0074
0075 BOOST_AUTO_TEST_SUITE_END()