9 #include <boost/optional/optional_io.hpp>
10 #include <boost/test/unit_test.hpp>
41 auto plane = Surface::makeShared<PlaneSurface>(
Vector3D{0., 0., 0.},
53 cov2D << 0.04, 0., 0.09, 0.;
56 plane, {}, std::move(cov2D), 0.02, 0.03));
61 auto calibrate = [](
auto& trackstate) {
63 trackstate.measurement.calibrated = **trackstate.measurement.uncalibrated;
69 BOOST_CHECK_EQUAL(*mts1D.size(), 1
u);
90 BOOST_CHECK_EQUAL(*mts2D.size(), 2
u);
93 std::array<double, 6> pars_array = {
94 {-0.1234, 9.8765, 0.45, 0.888, 0.001, 0.}};
96 pars << pars_array[0], pars_array[1], pars_array[2], pars_array[3],
97 pars_array[4], pars_array[5];
117 std::vector<BoundTrackState> trackStates = {std::move(mts1DMoveAssigned),
118 std::move(mts2D), std::move(pts)};
120 BOOST_CHECK_EQUAL(trackStates.size(), 3
u);
124 for (
auto& ts : trackStates) {
125 const Surface* sf = &ts.referenceSurface();
126 BOOST_CHECK_EQUAL(sf,
plane.get());
135 auto& ptsfList = trackStates[2];
136 auto& ataPlanefListPred = ptsfList.parameter.predicted;
137 BOOST_CHECK(ataPlanefListPred);
140 auto& ataPlanefListUpdt = ptsfList.parameter.filtered;
141 BOOST_CHECK(!ataPlanefListUpdt);
143 auto& ataPlanefListSmthd = ptsfList.parameter.smoothed;
144 BOOST_CHECK(!ataPlanefListSmthd);
147 auto& m2DfList = trackStates[1];
149 m2DfList.parameter.filtered = std::move(ataPlaneUpdt);
150 auto& ataPlanefListUpdtM2D = m2DfList.parameter.filtered;
151 BOOST_CHECK(ataPlanefListUpdtM2D);
153 m2DfList.parameter.predicted = std::move(ataPlanePred);
154 auto& ataPlanefListPred2D = m2DfList.parameter.predicted;
155 BOOST_CHECK(ataPlanefListPred2D);
160 ataPlaneState1.parameter.pathLength = 1.;
164 ataPlaneState2.parameter.pathLength = 2.;
166 std::vector<BoundTrackState> unorderedStates = {std::move(ataPlaneState2),
167 std::move(ataPlaneState1)};
171 std::sort(unorderedStates.begin(), unorderedStates.end(), plSorter);
173 auto firstOrdered = unorderedStates[0];
174 BOOST_CHECK_EQUAL(firstOrdered.parameter.pathLength, 1.);
176 auto secondOrdered = unorderedStates[1];
177 BOOST_CHECK_EQUAL(secondOrdered.parameter.pathLength, 2.);
179 auto& pState = firstOrdered.parameter;
181 BOOST_CHECK_EQUAL(pState.pathLength, 1.);
183 std::shuffle(unorderedStates.begin(), unorderedStates.end(),
generator);
186 std::vector<BoundTrackState> copiedStates = {unorderedStates[0],
190 std::shuffle(copiedStates.begin(), copiedStates.end(),
generator);
192 std::sort(copiedStates.begin(), copiedStates.end(), plSorter);