forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
cvarni
authored and
cvarni
committed
Sep 24, 2024
1 parent
0a1093b
commit 7cecdb5
Showing
3 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// This file is part of the Acts project. | ||
// | ||
// Copyright (C) 2024 CERN for the benefit of the Acts project | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
#include <boost/test/unit_test.hpp> | ||
|
||
#include "Acts/EventData/Seed.hpp" | ||
|
||
namespace Acts::Test { | ||
|
||
struct SpacePoint {}; | ||
|
||
BOOST_AUTO_TEST_CASE(seed_edm_default) { | ||
std::array<Acts::Test::SpacePoint, 3> storage{}; | ||
storage[0] = SpacePoint(); | ||
storage[1] = SpacePoint(); | ||
storage[2] = SpacePoint(); | ||
|
||
Seed<Acts::Test::SpacePoint> seed(storage[0], storage[1], storage[2]); | ||
const std::array<const Acts::Test::SpacePoint*, 3> sps = seed.sp(); | ||
BOOST_CHECK_NE(sps[0], nullptr); | ||
BOOST_CHECK_NE(sps[1], nullptr); | ||
BOOST_CHECK_NE(sps[2], nullptr); | ||
BOOST_CHECK_EQUAL(sps[0], &storage[0]); | ||
BOOST_CHECK_EQUAL(sps[1], &storage[1]); | ||
BOOST_CHECK_EQUAL(sps[2], &storage[2]); | ||
|
||
seed.setZvertex(-1.2f); | ||
BOOST_CHECK_EQUAL(seed.z(), -1.2f); | ||
|
||
seed.setQuality(345.23f); | ||
BOOST_CHECK_EQUAL(seed.seedQuality(), 345.23f); | ||
} | ||
|
||
BOOST_AUTO_TEST_CASE(seed_edm_3d) { | ||
std::array<Acts::Test::SpacePoint, 3> storage{}; | ||
storage[0] = SpacePoint(); | ||
storage[1] = SpacePoint(); | ||
storage[2] = SpacePoint(); | ||
|
||
Seed<Acts::Test::SpacePoint, 3> seed(storage[0], storage[1], storage[2]); | ||
const std::array<const Acts::Test::SpacePoint*, 3> sps = seed.sp(); | ||
BOOST_CHECK_NE(sps[0], nullptr); | ||
BOOST_CHECK_NE(sps[1], nullptr); | ||
BOOST_CHECK_NE(sps[2], nullptr); | ||
BOOST_CHECK_EQUAL(sps[0], &storage[0]); | ||
BOOST_CHECK_EQUAL(sps[1], &storage[1]); | ||
BOOST_CHECK_EQUAL(sps[2], &storage[2]); | ||
|
||
seed.setZvertex(-1.2f); | ||
BOOST_CHECK_EQUAL(seed.z(), -1.2f); | ||
|
||
seed.setQuality(345.23f); | ||
BOOST_CHECK_EQUAL(seed.seedQuality(), 345.23f); | ||
} | ||
|
||
BOOST_AUTO_TEST_CASE(seed_edm_4d) { | ||
std::array<Acts::Test::SpacePoint, 4> storage{}; | ||
storage[0] = SpacePoint(); | ||
storage[1] = SpacePoint(); | ||
storage[2] = SpacePoint(); | ||
storage[3] = SpacePoint(); | ||
|
||
Seed<Acts::Test::SpacePoint, 4> seed(storage[0], storage[1], storage[2], | ||
storage[3]); | ||
const std::array<const Acts::Test::SpacePoint*, 4> sps = seed.sp(); | ||
BOOST_CHECK_NE(sps[0], nullptr); | ||
BOOST_CHECK_NE(sps[1], nullptr); | ||
BOOST_CHECK_NE(sps[2], nullptr); | ||
BOOST_CHECK_NE(sps[3], nullptr); | ||
BOOST_CHECK_EQUAL(sps[0], &storage[0]); | ||
BOOST_CHECK_EQUAL(sps[1], &storage[1]); | ||
BOOST_CHECK_EQUAL(sps[2], &storage[2]); | ||
BOOST_CHECK_EQUAL(sps[3], &storage[3]); | ||
|
||
seed.setZvertex(-1.2f); | ||
BOOST_CHECK_EQUAL(seed.z(), -1.2f); | ||
|
||
seed.setQuality(345.23f); | ||
BOOST_CHECK_EQUAL(seed.seedQuality(), 345.23f); | ||
} | ||
|
||
} // namespace Acts::Test |