File indexing completed on 2025-01-18 09:12:35
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <boost/test/unit_test.hpp>
0010
0011 #include "Acts/EventData/Seed.hpp"
0012
0013 #include <vector>
0014
0015 namespace Acts::Test {
0016
0017 struct SpacePoint {};
0018
0019 BOOST_AUTO_TEST_CASE(seed_edm_constructors) {
0020 std::array<Acts::Test::SpacePoint, 5> storage{};
0021 Acts::Seed<Acts::Test::SpacePoint, 5> seed(storage[0], storage[1], storage[2],
0022 storage[3], storage[4]);
0023 const std::array<const Acts::Test::SpacePoint*, 5>& sps = seed.sp();
0024 for (std::size_t i(0ul); i < 5ul; ++i) {
0025 BOOST_CHECK_NE(sps[i], nullptr);
0026 BOOST_CHECK_EQUAL(sps[i], &storage[i]);
0027 }
0028
0029
0030 Acts::Seed<Acts::Test::SpacePoint, 5> seedCopy1(seed);
0031 const std::array<const Acts::Test::SpacePoint*, 5>& spsCopy1 = seedCopy1.sp();
0032 for (std::size_t i(0ul); i < 5ul; ++i) {
0033 BOOST_CHECK_NE(spsCopy1[i], nullptr);
0034 BOOST_CHECK_EQUAL(spsCopy1[i], sps[i]);
0035 }
0036
0037
0038 Acts::Seed<Acts::Test::SpacePoint, 5> seedCopy2{seed};
0039 const std::array<const Acts::Test::SpacePoint*, 5>& spsCopy2 = seedCopy2.sp();
0040 for (std::size_t i(0ul); i < 5ul; ++i) {
0041 BOOST_CHECK_NE(spsCopy2[i], nullptr);
0042 BOOST_CHECK_EQUAL(spsCopy2[i], sps[i]);
0043 }
0044
0045
0046 std::vector<Acts::Seed<Acts::Test::SpacePoint, 5>> seeds{seed};
0047
0048 std::vector<Acts::Seed<Acts::Test::SpacePoint, 5>> seedsCopy1(seeds);
0049 BOOST_CHECK_EQUAL(seedsCopy1.size(), seeds.size());
0050
0051 std::vector<Acts::Seed<Acts::Test::SpacePoint, 5>> seedsCopy2{seeds};
0052 BOOST_CHECK_EQUAL(seedsCopy2.size(), seeds.size());
0053 }
0054
0055 BOOST_AUTO_TEST_CASE(seed_edm_default) {
0056 std::array<Acts::Test::SpacePoint, 3> storage{};
0057 Acts::Seed<Acts::Test::SpacePoint> seed(storage[0], storage[1], storage[2]);
0058 const std::array<const Acts::Test::SpacePoint*, 3>& sps = seed.sp();
0059 for (std::size_t i(0ul); i < 3ul; ++i) {
0060 BOOST_CHECK_NE(sps[i], nullptr);
0061 BOOST_CHECK_EQUAL(sps[i], &storage[i]);
0062 }
0063
0064 seed.setVertexZ(-1.2f);
0065 BOOST_CHECK_EQUAL(seed.z(), -1.2f);
0066
0067 seed.setQuality(345.23f);
0068 BOOST_CHECK_EQUAL(seed.seedQuality(), 345.23f);
0069 }
0070
0071 BOOST_AUTO_TEST_CASE(seed_edm_3d) {
0072 std::array<Acts::Test::SpacePoint, 3> storage{};
0073 Acts::Seed<Acts::Test::SpacePoint, 3> seed(storage[0], storage[1],
0074 storage[2]);
0075 const std::array<const Acts::Test::SpacePoint*, 3>& sps = seed.sp();
0076 for (std::size_t i(0ul); i < 3ul; ++i) {
0077 BOOST_CHECK_NE(sps[i], nullptr);
0078 BOOST_CHECK_EQUAL(sps[i], &storage[i]);
0079 }
0080
0081 seed.setVertexZ(-1.2f);
0082 BOOST_CHECK_EQUAL(seed.z(), -1.2f);
0083
0084 seed.setQuality(345.23f);
0085 BOOST_CHECK_EQUAL(seed.seedQuality(), 345.23f);
0086 }
0087
0088 BOOST_AUTO_TEST_CASE(seed_edm_4d) {
0089 std::array<Acts::Test::SpacePoint, 4> storage{};
0090 Acts::Seed<Acts::Test::SpacePoint, 4> seed(storage[0], storage[1], storage[2],
0091 storage[3]);
0092 const std::array<const Acts::Test::SpacePoint*, 4>& sps = seed.sp();
0093 for (std::size_t i(0ul); i < 4ul; ++i) {
0094 BOOST_CHECK_NE(sps[i], nullptr);
0095 BOOST_CHECK_EQUAL(sps[i], &storage[i]);
0096 }
0097
0098 seed.setVertexZ(-1.2f);
0099 BOOST_CHECK_EQUAL(seed.z(), -1.2f);
0100
0101 seed.setQuality(345.23f);
0102 BOOST_CHECK_EQUAL(seed.seedQuality(), 345.23f);
0103 }
0104
0105 }