Back to home page

EIC code displayed by LXR

 
 

    


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

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