Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-19 07:59:27

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 "ActsPlugins/Detray/DetrayConverter.hpp"
0012 #include "ActsTests/CommonHelpers/CylindricalDetector.hpp"
0013 
0014 #include <vecmem/memory/host_memory_resource.hpp>
0015 #include <vecmem/memory/memory_resource.hpp>
0016 
0017 using namespace Acts;
0018 using namespace Experimental;
0019 using namespace ActsPlugins;
0020 
0021 GeometryContext tContext;
0022 
0023 auto logger = getDefaultLogger("DetrayConverterTests", Logging::INFO);
0024 
0025 namespace ActsTests {
0026 
0027 BOOST_AUTO_TEST_SUITE(DetraySuite)
0028 
0029 BOOST_AUTO_TEST_CASE(DetrayConversion) {
0030   // Load the detector from the Test utilities
0031   auto detector = buildCylindricalDetector(tContext);
0032 
0033   DetrayConverter::Options options;
0034 
0035   vecmem::host_memory_resource memoryResource;
0036 
0037   auto detrayDetector =
0038       DetrayConverter(std::move(logger))
0039           .convert<>(tContext, *detector, memoryResource, options);
0040 
0041   BOOST_CHECK_EQUAL(detrayDetector.volumes().size(), 6u);
0042   // Beampipe : original 3 -> split into 5
0043   // Nec:       original 4 -> split into 6
0044   // Layer0:    original 4 -> left  at   4
0045   // Layer1:    original 4 -> left  at   4
0046   // Layer2:    original 4 -> left  at   4
0047   // Pec:       original 4 -> split into 6
0048   // + portals to itself, one per volume 6
0049   BOOST_CHECK_EQUAL(detrayDetector.portals().size(), 35u);
0050 }
0051 
0052 BOOST_AUTO_TEST_SUITE_END()
0053 
0054 }  // namespace ActsTests