9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
30 namespace tt = boost::test_tools;
31 using namespace Acts::UnitLiterals;
42 struct PropagatorState {
48 using BoundState = std::tuple<BoundTrackParameters, Jacobian, double>;
50 std::tuple<CurvilinearTrackParameters, Jacobian, double>;
53 template <
typename,
typename>
75 double pathAccumulated = 0.;
81 double previousStepSize = 0.;
93 const double )
const {}
120 return detail::updateSingleSurfaceStatus<Stepper>(*
this, state,
surface,
124 template <
typename object_
intersection_t>
126 const object_intersection_t& oIntersection,
128 detail::updateSingleStepSize<Stepper>(state, oIntersection,
release);
148 state.
pos4, state.
dir, state.
p, state.
q);
181 static_assert(StepperConcept<Stepper>,
182 "Dummy stepper does not fulfill concept");
189 std::string debugString =
"";
191 size_t debugPfxWidth = 30;
192 size_t debugMsgWidth = 50;
198 const Surface* startSurface =
nullptr;
201 const Surface* currentSurface =
nullptr;
204 const Surface* targetSurface =
nullptr;
205 bool targetReached =
false;
220 template <
typename stepper_state_t>
221 void step(stepper_state_t& sstate) {
238 size_t navLay,
size_t navBound,
size_t extSurf) {
291 state.options.debug =
debug;
294 state.stepping.pos4 = position4;
295 state.stepping.dir = momentum.normalized();
304 navigator.
status(state, stepper);
307 nullptr,
nullptr,
nullptr,
nullptr,
308 nullptr,
nullptr,
nullptr));
312 navigator.
status(state, stepper);
315 nullptr,
nullptr,
nullptr,
nullptr,
316 nullptr,
nullptr,
nullptr));
322 state.navigation.navigationBreak =
true;
324 state.navigation.targetReached =
true;
325 navigator.
status(state, stepper);
328 nullptr,
nullptr,
nullptr,
nullptr,
329 nullptr,
nullptr,
nullptr));
331 state.navigation.targetReached =
false;
332 state.navigation.targetSurface =
nullptr;
333 navigator.
status(state, stepper);
336 nullptr,
nullptr,
nullptr,
nullptr,
337 nullptr,
nullptr,
nullptr));
341 startSurf->
center(state.geoContext);
342 const Surface* targetSurf = startSurf;
343 state.navigation.targetSurface = targetSurf;
344 navigator.
status(state, stepper);
347 nullptr,
nullptr, targetSurf,
nullptr,
348 nullptr,
nullptr, targetSurf));
355 state.stepping.pos4 << 0., 0., 0., 0.;
358 state.geoContext, stepper.
position(state.stepping));
360 state.geoContext, stepper.
position(state.stepping));
361 navigator.
status(state, stepper);
364 startLay,
nullptr,
nullptr, startVol,
365 nullptr,
nullptr,
nullptr));
369 state.navigation.startSurface = startSurf;
370 navigator.
status(state, stepper);
373 startLay, startSurf, startSurf,
374 startVol,
nullptr,
nullptr,
nullptr));
378 state.navigation.startVolume = startVol;
379 navigator.
status(state, stepper);
382 startLay,
nullptr,
nullptr, startVol,
383 nullptr,
nullptr,
nullptr));
400 state.options.debug =
debug;
403 state.stepping.pos4 = position4;
404 state.stepping.dir = momentum.normalized();
408 std::cout <<
"<<<<<<<<<<<<<<<<<<<<< FORWARD NAVIGATION >>>>>>>>>>>>>>>>>>"
418 navigator.
status(state, stepper);
420 BOOST_CHECK_NE(state.navigation.currentVolume,
nullptr);
422 BOOST_CHECK_EQUAL(state.navigation.currentVolume,
423 state.navigation.startVolume);
425 BOOST_CHECK_EQUAL(state.navigation.currentSurface,
nullptr);
427 BOOST_CHECK_EQUAL(state.navigation.navLayers.size(), 0
u);
429 navigator.
target(state, stepper);
431 BOOST_CHECK_EQUAL(state.navigation.navLayers.size(), 1
u);
433 BOOST_CHECK(state.navigation.navLayerIter ==
434 state.navigation.navLayers.begin());
436 double beamPipeR =
perp(state.navigation.navLayerIter->intersection.position);
440 std::cout <<
"<<< Test 1a >>> initialize at "
441 <<
toString(state.stepping.pos4) << std::endl;
442 std::cout << state.options.debugString << std::endl;
444 state.options.debugString =
"";
448 step(state.stepping);
452 navigator.
status(state, stepper);
454 BOOST_CHECK_EQUAL(state.navigation.currentVolume,
455 state.navigation.startVolume);
457 BOOST_CHECK_EQUAL(state.navigation.navLayers.size(), 1
u);
460 (state.navigation.navLayerIter == state.navigation.navLayers.begin()));
462 navigator.
target(state, stepper);
465 std::cout <<
"<<< Test 1b >>> step to the BeamPipe at "
466 <<
toString(state.stepping.pos4) << std::endl;
467 std::cout << state.options.debugString << std::endl;
468 state.options.debugString =
"";
472 step(state.stepping);
476 navigator.
status(state, stepper);
478 navigator.
target(state, stepper);
481 std::cout <<
"<<< Test 1c >>> step to the Boundary at "
482 <<
toString(state.stepping.pos4) << std::endl;
483 std::cout << state.options.debugString << std::endl;
484 state.options.debugString =
"";
488 step(state.stepping);
491 navigator.
status(state, stepper);
493 navigator.
target(state, stepper);
496 std::cout <<
"<<< Test 1d >>> step to 1st layer at "
497 <<
toString(state.stepping.pos4) << std::endl;
498 std::cout << state.options.debugString << std::endl;
499 state.options.debugString =
"";
503 for (
size_t isf = 0; isf < 5; ++isf) {
504 step(state.stepping);
507 navigator.
status(state, stepper);
509 navigator.
target(state, stepper);
512 std::cout <<
"<<< Test 1e-1i >>> step within 1st layer at "
513 <<
toString(state.stepping.pos4) << std::endl;
514 std::cout << state.options.debugString << std::endl;
515 state.options.debugString =
"";
520 step(state.stepping);
523 navigator.
status(state, stepper);
525 navigator.
target(state, stepper);
528 std::cout <<
"<<< Test 1j >>> step to 2nd layer at "
529 <<
toString(state.stepping.pos4) << std::endl;
530 std::cout << state.options.debugString << std::endl;
531 state.options.debugString =
"";
535 for (
size_t isf = 0; isf < 5; ++isf) {
536 step(state.stepping);
539 navigator.
status(state, stepper);
541 navigator.
target(state, stepper);
544 std::cout <<
"<<< Test 1k-1o >>> step within 2nd layer at "
545 <<
toString(state.stepping.pos4) << std::endl;
546 std::cout << state.options.debugString << std::endl;
547 state.options.debugString =
"";
552 step(state.stepping);
555 navigator.
status(state, stepper);
557 navigator.
target(state, stepper);
560 std::cout <<
"<<< Test 1p >>> step to 3rd layer at "
561 <<
toString(state.stepping.pos4) << std::endl;
562 std::cout << state.options.debugString << std::endl;
563 state.options.debugString =
"";
567 for (
size_t isf = 0; isf < 3; ++isf) {
568 step(state.stepping);
571 navigator.
status(state, stepper);
573 navigator.
target(state, stepper);
576 std::cout <<
"<<< Test 1q-1s >>> step within 3rd layer at "
577 <<
toString(state.stepping.pos4) << std::endl;
578 std::cout << state.options.debugString << std::endl;
579 state.options.debugString =
"";
584 step(state.stepping);
587 navigator.
status(state, stepper);
589 navigator.
target(state, stepper);
592 std::cout <<
"<<< Test 1t >>> step to 4th layer at "
593 <<
toString(state.stepping.pos4) << std::endl;
594 std::cout << state.options.debugString << std::endl;
595 state.options.debugString =
"";
599 for (
size_t isf = 0; isf < 3; ++isf) {
600 step(state.stepping);
603 navigator.
status(state, stepper);
605 navigator.
target(state, stepper);
608 std::cout <<
"<<< Test 1t-1v >>> step within 4th layer at "
609 <<
toString(state.stepping.pos4) << std::endl;
610 std::cout << state.options.debugString << std::endl;
611 state.options.debugString =
"";
616 step(state.stepping);
619 navigator.
status(state, stepper);
621 navigator.
target(state, stepper);
624 std::cout <<
"<<< Test 1w >>> step to boundary at "
625 <<
toString(state.stepping.pos4) << std::endl;
626 std::cout << state.options.debugString << std::endl;
627 state.options.debugString =
"";