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<BoundParameters, Jacobian, double>;
50 std::tuple<CurvilinearParameters, Jacobian, double>;
53 template <
typename,
typename>
78 double pathAccumulated = 0.;
84 double previousStepSize = 0.;
115 return detail::updateSingleSurfaceStatus<Stepper>(*
this, state,
surface,
119 template <
typename object_
intersection_t>
121 const object_intersection_t& oIntersection,
122 bool release =
true)
const {
123 detail::updateSingleStepSize<Stepper>(state, oIntersection, release);
127 State& state,
double stepSize,
143 state.
p * state.
dir, state.
q, state.
t,
152 state.
p * state.
dir, state.
q, state.
t);
176 static_assert(StepperConcept<Stepper>,
177 "Dummy stepper does not fulfill concept");
184 std::string debugString =
"";
186 size_t debugPfxWidth = 30;
187 size_t debugMsgWidth = 50;
191 const Surface* startSurface =
nullptr;
194 const Surface* currentSurface =
nullptr;
197 const Surface* targetSurface =
nullptr;
198 bool targetReached =
false;
213 template <
typename stepper_state_t>
214 void step(stepper_state_t& sstate) {
216 sstate.pos = sstate.pos + sstate.stepSize * sstate.dir;
243 state.options.debug =
debug;
247 state.stepping.dir = momentum.normalized();
251 std::cout <<
"<<<<<<<<<<<<<<<<<<<<< FORWARD NAVIGATION >>>>>>>>>>>>>>>>>>"
261 navigator.
status(state, stepper);
263 BOOST_CHECK_NE(state.navigation.currentVolume,
nullptr);
265 BOOST_CHECK_EQUAL(state.navigation.currentVolume,
266 state.navigation.startVolume);
268 BOOST_CHECK_EQUAL(state.navigation.currentSurface,
nullptr);
270 BOOST_CHECK_EQUAL(state.navigation.navLayers.size(), 0
u);
272 navigator.
target(state, stepper);
274 BOOST_CHECK_EQUAL(state.navigation.navLayers.size(), 1
u);
276 BOOST_CHECK(state.navigation.navLayerIter ==
277 state.navigation.navLayers.begin());
279 double beamPipeR =
perp(state.navigation.navLayerIter->intersection.position);
283 std::cout <<
"<<< Test 1a >>> initialize at "
284 <<
toString(state.stepping.pos) << std::endl;
285 std::cout << state.options.debugString << std::endl;
287 state.options.debugString =
"";
291 step(state.stepping);
295 navigator.
status(state, stepper);
297 BOOST_CHECK_EQUAL(state.navigation.currentVolume,
298 state.navigation.startVolume);
300 BOOST_CHECK_EQUAL(state.navigation.navLayers.size(), 1
u);
303 (state.navigation.navLayerIter == state.navigation.navLayers.begin()));
305 navigator.
target(state, stepper);
308 std::cout <<
"<<< Test 1b >>> step to the BeamPipe at "
309 <<
toString(state.stepping.pos) << std::endl;
310 std::cout << state.options.debugString << std::endl;
311 state.options.debugString =
"";
315 step(state.stepping);
319 navigator.
status(state, stepper);
321 navigator.
target(state, stepper);
324 std::cout <<
"<<< Test 1c >>> step to the Boundary at "
325 <<
toString(state.stepping.pos) << std::endl;
326 std::cout << state.options.debugString << std::endl;
327 state.options.debugString =
"";
331 step(state.stepping);
334 navigator.
status(state, stepper);
336 navigator.
target(state, stepper);
339 std::cout <<
"<<< Test 1d >>> step to 1st layer at "
340 <<
toString(state.stepping.pos) << std::endl;
341 std::cout << state.options.debugString << std::endl;
342 state.options.debugString =
"";
346 for (
size_t isf = 0; isf < 5; ++isf) {
347 step(state.stepping);
350 navigator.
status(state, stepper);
352 navigator.
target(state, stepper);
355 std::cout <<
"<<< Test 1e-1i >>> step within 1st layer at "
356 <<
toString(state.stepping.pos) << std::endl;
357 std::cout << state.options.debugString << std::endl;
358 state.options.debugString =
"";
363 step(state.stepping);
366 navigator.
status(state, stepper);
368 navigator.
target(state, stepper);
371 std::cout <<
"<<< Test 1j >>> step to 2nd layer at "
372 <<
toString(state.stepping.pos) << std::endl;
373 std::cout << state.options.debugString << std::endl;
374 state.options.debugString =
"";
378 for (
size_t isf = 0; isf < 5; ++isf) {
379 step(state.stepping);
382 navigator.
status(state, stepper);
384 navigator.
target(state, stepper);
387 std::cout <<
"<<< Test 1k-1o >>> step within 2nd layer at "
388 <<
toString(state.stepping.pos) << std::endl;
389 std::cout << state.options.debugString << std::endl;
390 state.options.debugString =
"";
395 step(state.stepping);
398 navigator.
status(state, stepper);
400 navigator.
target(state, stepper);
403 std::cout <<
"<<< Test 1p >>> step to 3rd layer at "
404 <<
toString(state.stepping.pos) << std::endl;
405 std::cout << state.options.debugString << std::endl;
406 state.options.debugString =
"";
410 for (
size_t isf = 0; isf < 3; ++isf) {
411 step(state.stepping);
414 navigator.
status(state, stepper);
416 navigator.
target(state, stepper);
419 std::cout <<
"<<< Test 1q-1s >>> step within 3rd layer at "
420 <<
toString(state.stepping.pos) << std::endl;
421 std::cout << state.options.debugString << std::endl;
422 state.options.debugString =
"";
427 step(state.stepping);
430 navigator.
status(state, stepper);
432 navigator.
target(state, stepper);
435 std::cout <<
"<<< Test 1t >>> step to 4th layer at "
436 <<
toString(state.stepping.pos) << std::endl;
437 std::cout << state.options.debugString << std::endl;
438 state.options.debugString =
"";
442 for (
size_t isf = 0; isf < 3; ++isf) {
443 step(state.stepping);
446 navigator.
status(state, stepper);
448 navigator.
target(state, stepper);
451 std::cout <<
"<<< Test 1t-1v >>> step within 4th layer at "
452 <<
toString(state.stepping.pos) << std::endl;
453 std::cout << state.options.debugString << std::endl;
454 state.options.debugString =
"";
459 step(state.stepping);
462 navigator.
status(state, stepper);
464 navigator.
target(state, stepper);
467 std::cout <<
"<<< Test 1w >>> step to boundary at "
468 <<
toString(state.stepping.pos) << std::endl;
469 std::cout << state.options.debugString << std::endl;
470 state.options.debugString =
"";