Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-11-01 07:55:20

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 "ActsExamples/Alignment/AlignmentAlgorithm.hpp"
0012 
0013 using namespace Acts;
0014 using namespace ActsExamples;
0015 
0016 namespace ActsTests {
0017 
0018 BOOST_AUTO_TEST_SUITE(AlignmentSuite)
0019 
0020 BOOST_AUTO_TEST_CASE(Single_sensitive_Test) {
0021   auto geoId = GeometryIdentifier().withSensitive(1);
0022   AlignmentGroup aGroup("test", {geoId});
0023   BOOST_CHECK(aGroup.has(geoId));
0024 
0025   auto badId = GeometryIdentifier().withSensitive(2);
0026   BOOST_CHECK(!aGroup.has(badId));
0027 }
0028 
0029 BOOST_AUTO_TEST_CASE(Single_layer_Test) {
0030   auto geoId = GeometryIdentifier().withLayer(1);
0031   AlignmentGroup aGroup("test", {geoId});
0032   BOOST_CHECK(aGroup.has(geoId));
0033 
0034   auto badId = GeometryIdentifier().withLayer(2);
0035   BOOST_CHECK(!aGroup.has(badId));
0036 }
0037 
0038 BOOST_AUTO_TEST_CASE(Single_volume_Test) {
0039   auto geoId = GeometryIdentifier().withVolume(1);
0040   AlignmentGroup aGroup("test", {geoId});
0041   BOOST_CHECK(aGroup.has(geoId));
0042 
0043   auto badId = GeometryIdentifier().withVolume(2);
0044   BOOST_CHECK(!aGroup.has(badId));
0045 }
0046 
0047 BOOST_AUTO_TEST_CASE(Hierarchy_test) {
0048   auto geoId = GeometryIdentifier().withVolume(1);
0049   AlignmentGroup aGroup("test", {geoId});
0050 
0051   auto geoId2 = GeometryIdentifier().withVolume(1).withLayer(2);
0052   BOOST_CHECK(aGroup.has(geoId2));
0053 
0054   auto geoId3 = GeometryIdentifier().withVolume(1).withLayer(3);
0055   BOOST_CHECK(aGroup.has(geoId3));
0056 }
0057 
0058 BOOST_AUTO_TEST_CASE(Hierarchy_test_2) {
0059   auto geoId = GeometryIdentifier().withVolume(1).withLayer(1);
0060   AlignmentGroup aGroup("test", {geoId});
0061 
0062   auto badId = GeometryIdentifier().withVolume(1);
0063   BOOST_CHECK(!aGroup.has(badId));
0064 }
0065 
0066 BOOST_AUTO_TEST_CASE(Multiple_test) {
0067   auto geoId1 = GeometryIdentifier().withVolume(1).withLayer(1);
0068   auto geoId2 = GeometryIdentifier().withVolume(2).withLayer(2);
0069   auto geoId3 = GeometryIdentifier().withVolume(3).withLayer(3);
0070   auto geoId4 = GeometryIdentifier().withVolume(4).withLayer(4);
0071 
0072   AlignmentGroup aGroup("test", {geoId1, geoId2, geoId3});
0073 
0074   BOOST_CHECK(aGroup.has(geoId1));
0075   BOOST_CHECK(aGroup.has(geoId2));
0076   BOOST_CHECK(aGroup.has(geoId3));
0077   BOOST_CHECK(!aGroup.has(geoId4));
0078 }
0079 
0080 BOOST_AUTO_TEST_SUITE_END()
0081 
0082 }  // namespace ActsTests