File indexing completed on 2026-07-31 08:18:41
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <boost/test/unit_test.hpp>
0010
0011 #include "Acts/Definitions/Units.hpp"
0012 #include "Acts/Seeding/detail/SpacePointGridPhiBinning.hpp"
0013
0014 #include <stdexcept>
0015
0016 using namespace Acts::UnitLiterals;
0017
0018 namespace Acts::Test {
0019
0020 namespace {
0021
0022
0023
0024 detail::SpacePointGridPhiBinningConfig makeConfig() {
0025 detail::SpacePointGridPhiBinningConfig config;
0026 config.minPt = 500_MeV;
0027 config.bFieldInZ = 2_T;
0028 config.rMax = 200_mm;
0029 config.deltaRMax = 100_mm;
0030 config.impactMax = 10_mm;
0031 config.phiBinDeflectionCoverage = 1;
0032 config.maxPhiBins = 10000;
0033 return config;
0034 }
0035
0036 }
0037
0038 BOOST_AUTO_TEST_SUITE(SpacePointGridPhiBinningTests)
0039
0040 BOOST_AUTO_TEST_CASE(ZeroFieldUsesMaxPhiBins) {
0041 auto config = makeConfig();
0042 config.bFieldInZ = 0;
0043 config.maxPhiBins = 42;
0044 BOOST_CHECK_EQUAL(detail::computeSpacePointGridPhiBins(config), 42);
0045 }
0046
0047 BOOST_AUTO_TEST_CASE(BaselineGivesFinitePositiveBinCount) {
0048 const auto config = makeConfig();
0049 const int phiBins = detail::computeSpacePointGridPhiBins(config);
0050 BOOST_CHECK_GT(phiBins, 1);
0051 BOOST_CHECK_LE(phiBins, config.maxPhiBins);
0052 }
0053
0054 BOOST_AUTO_TEST_CASE(MaxPhiBinsCapsResult) {
0055 auto config = makeConfig();
0056 const int uncapped = detail::computeSpacePointGridPhiBins(config);
0057 config.maxPhiBins = uncapped - 1;
0058 BOOST_CHECK_EQUAL(detail::computeSpacePointGridPhiBins(config),
0059 config.maxPhiBins);
0060 }
0061
0062 BOOST_AUTO_TEST_CASE(DeflectionCoverageIncreasesBinCount) {
0063 auto config = makeConfig();
0064 const int singleCoverage = detail::computeSpacePointGridPhiBins(config);
0065 config.phiBinDeflectionCoverage = 2;
0066 const int doubleCoverage = detail::computeSpacePointGridPhiBins(config);
0067 BOOST_CHECK_GT(doubleCoverage, singleCoverage);
0068 }
0069
0070
0071
0072
0073 BOOST_AUTO_TEST_CASE(LargeImpactParameterStaysFinite) {
0074 auto config = makeConfig();
0075 config.impactMax = config.rMax;
0076 const int phiBins = detail::computeSpacePointGridPhiBins(config);
0077 BOOST_CHECK_GT(phiBins, 0);
0078 BOOST_CHECK_LE(phiBins, config.maxPhiBins);
0079 }
0080
0081 BOOST_AUTO_TEST_CASE(TooSmallHelixRadiusThrows) {
0082 auto config = makeConfig();
0083
0084 config.minPt = 10_MeV;
0085 BOOST_CHECK_THROW(detail::computeSpacePointGridPhiBins(config),
0086 std::domain_error);
0087 }
0088
0089 BOOST_AUTO_TEST_SUITE_END()
0090
0091 }