9 #include <boost/test/test_tools.hpp>
10 #include <boost/test/unit_test.hpp>
26 using namespace Acts::UnitLiterals;
35 : stepping(std::move(stepperState)) {}
60 static constexpr
auto absMom = 1_GeV;
140 auto newPos4 = (
pos4 +
Vector4D(1_mm, 2_mm, 3_mm, 20_ns)).eval();
141 auto newPos = newPos4.segment<3>(
ePos0);
142 auto newTime = newPos4[
eTime];
144 auto newAbsMom = 0.9 *
absMom;
147 auto plane = Surface::makeShared<PlaneSurface>(newPos, newUnitDir);
162 stepper.update(state, freeParams, *params.
covariance());
178 auto newPos = (
pos +
Vector3D(1_mm, 2_mm, 3_mm)).eval();
179 auto newTime =
time + 20_ns;
181 auto newAbsMom = 0.9 *
absMom;
183 stepper.update(state, newPos, newUnitDir, newAbsMom, newTime);
206 BOOST_CHECK_EQUAL(pars.charge(),
charge);
207 BOOST_CHECK(pars.covariance().has_value());
208 BOOST_CHECK_NE(*pars.covariance(),
cov);
223 auto&& [pars, jac,
pathLength] = stepper.curvilinearState(state);
228 BOOST_CHECK_EQUAL(pars.charge(),
charge);
229 BOOST_CHECK(pars.covariance().has_value());
230 BOOST_CHECK_NE(*pars.covariance(),
cov);
247 auto res = stepper.step(state);
248 BOOST_CHECK(res.ok());
251 auto h = res.value();
257 BOOST_CHECK_LT(0, deltaPos.norm());
260 BOOST_CHECK_LT(0,
std::abs(deltaTime));
263 BOOST_CHECK_LT(projDir, 1);
280 auto res = stepper.step(state);
281 BOOST_CHECK(res.ok());
284 auto h = res.value();
290 BOOST_CHECK_LT(0, deltaPos.norm());
293 BOOST_CHECK_LT(0,
std::abs(deltaTime));
296 BOOST_CHECK_LT(projDir, 1);
302 stepper.covarianceTransport(state.
stepping);
337 BOOST_CHECK_EQUAL(*stateCopy.
covariance, cov);
338 BOOST_CHECK_EQUAL(stepper.
position(stateCopy),
339 freeParams.template segment<3>(
eFreePos0));
340 BOOST_CHECK_EQUAL(stepper.
direction(stateCopy),
341 freeParams.template segment<3>(
eFreeDir0).normalized());
342 BOOST_CHECK_EQUAL(stepper.
momentum(stateCopy),
345 BOOST_CHECK_EQUAL(stepper.
time(stateCopy), freeParams[
eFreeTime]);
346 BOOST_CHECK_EQUAL(stateCopy.
navDir, ndir);
348 BOOST_CHECK_EQUAL(stateCopy.
stepSize, ndir * stepSize);
359 BOOST_CHECK_EQUAL(*stateCopy.
covariance, cov);
360 BOOST_CHECK_EQUAL(stepper.
position(stateCopy),
361 freeParams.template segment<3>(
eFreePos0));
362 BOOST_CHECK_EQUAL(stepper.
direction(stateCopy),
363 freeParams.template segment<3>(
eFreeDir0).normalized());
364 BOOST_CHECK_EQUAL(stepper.
momentum(stateCopy),
365 std::abs(1. / freeParams[eFreeQOverP]));
367 BOOST_CHECK_EQUAL(stepper.
time(stateCopy), freeParams[
eFreeTime]);
368 BOOST_CHECK_EQUAL(stateCopy.
navDir, ndir);
370 BOOST_CHECK_EQUAL(stateCopy.
stepSize,
382 BOOST_CHECK_EQUAL(*stateCopy.
covariance, cov);
383 BOOST_CHECK_EQUAL(stepper.
position(stateCopy),
384 freeParams.template segment<3>(
eFreePos0));
385 BOOST_CHECK_EQUAL(stepper.
direction(stateCopy),
386 freeParams.template segment<3>(
eFreeDir0).normalized());
387 BOOST_CHECK_EQUAL(stepper.
momentum(stateCopy),
388 std::abs(1. / freeParams[eFreeQOverP]));
390 BOOST_CHECK_EQUAL(stepper.
time(stateCopy), freeParams[
eFreeTime]);
401 pos << 1.5, -2.5, 0.;
402 mom << 4.5, -5.5, 6.5;
405 cov = 8.5 * Covariance::Identity();
407 auto disc = Surface::makeShared<DiscSurface>(trafo);
412 stepper.resetState(stateDisc, boundDisc.
parameters(), *boundDisc.covariance(),
413 boundDisc.referenceSurface());
420 pos << 1.5, -2.5, 3.5;
421 mom << 4.5, -5.5, 6.5;
424 cov = 8.5 * Covariance::Identity();
425 auto perigee = Surface::makeShared<PerigeeSurface>(trafo);
431 stepper.resetState(statePerigee, boundPerigee.
parameters(),
432 *boundPerigee.covariance(),
433 boundPerigee.referenceSurface());
440 pos << 1.5, -2.5, 3.5;
441 mom << 4.5, -5.5, 6.5;
444 cov = 8.5 * Covariance::Identity();
445 auto straw = Surface::makeShared<StrawSurface>(trafo);
450 stepper.resetState(stateStraw, boundStraw.
parameters(),
451 *boundStraw.covariance(), boundStraw.referenceSurface());
455 BOOST_CHECK_EQUAL_COLLECTIONS(
470 stepper.setStepSize(state, 5_cm);
472 BOOST_CHECK_EQUAL(state.
stepSize, 5_cm);
474 stepper.releaseStepSize(state);
486 auto distance = 10_mm;
487 auto target = Surface::makeShared<PlaneSurface>(
495 stepper.updateStepSize(
500 BOOST_CHECK_EQUAL(state.
stepSize, distance);
504 stepper.updateStepSize(
509 BOOST_CHECK_EQUAL(state.
stepSize, distance);
512 BOOST_AUTO_TEST_SUITE_END()