Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-14 08:12:28

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