9 #include <boost/test/unit_test.hpp>
52 using namespace Acts::Test;
53 using namespace Acts::UnitLiterals;
90 std::default_random_engine
rng(42);
104 std::make_shared<Acts::ConstantBField>(
Acts::Vector3(0.0, 0.0, 2._T));
109 std::array<double, 2> pArray = {0.5_GeV, 1.0_GeV};
110 std::array<double, 3> phiArray = {20._degree, 0._degree - 20._degree};
111 std::array<double, 3> thetaArray = {80._degree, 90.0_degree, 100._degree};
112 std::array<double, 2> qArray = {1, -1};
117 for (
const auto& p : pArray) {
118 for (
const auto& phi : phiArray) {
119 for (
const auto& theta : thetaArray) {
120 for (
const auto& q : qArray) {
121 BOOST_TEST_INFO(
"Test track with p = " << p <<
", phi = " << phi
122 <<
", theta = " << theta
129 std::map<GeometryIdentifier::Value, SpacePoint> spacePoints;
130 const Surface* bottomSurface =
nullptr;
131 for (
const auto& sl : measurements.sourceLinks) {
133 const auto&
layer = geoId.layer();
134 auto it = spacePoints.find(
layer);
136 if (
it != spacePoints.end()) {
140 const auto& localPos = sl.parameters;
141 Vector3 globalFakeMom(1, 1, 1);
146 float r = std::hypot(globalPos.x(), globalPos.y());
149 static_cast<float>(globalPos.y()),
150 static_cast<float>(globalPos.z()), r,
151 static_cast<int>(geoId.layer()), 0., 0.});
152 if (spacePoints.size() == 1) {
158 if (spacePoints.size() < 3) {
159 BOOST_TEST_WARN(
"Number of space points less than 3.");
164 const auto& expParams = measurements.truthParameters[0];
166 "The truth track parameters at the bottom space point: \n"
167 << expParams.transpose());
173 std::array<const SpacePoint*, 3> spacePointPtrs{};
175 spacePointPtrs.begin(),
176 [](
const auto& sp) {
return &sp.second; });
180 spacePointPtrs.begin(), spacePointPtrs.end(), *
logger);
181 BOOST_REQUIRE(partialParamsOpt.has_value());
182 const auto& estPartialParams = partialParamsOpt.value();
184 "The estimated track parameters at the transverse plane: \n"
185 << estPartialParams.transpose());
200 geoCtx, spacePointPtrs.begin(), spacePointPtrs.end(),
202 BOOST_REQUIRE(fullParamsOpt.has_value());
203 const auto& estFullParams = fullParamsOpt.value();
205 "The estimated full track parameters at the bottom space point: "
207 << estFullParams.transpose());