Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:13:06

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 #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   // Colorize in blue
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   // As sheet
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()