20 namespace tt = boost::test_tools;
23 namespace IntegrationTest {
45 ? Vector3D::UnitZ().cross(T).normalized()
46 : Vector3D::UnitX().cross(T).normalized();
50 curvilinearRotation.col(0) = U;
51 curvilinearRotation.col(1) = V;
52 curvilinearRotation.col(2) =
T;
55 ctransform.pretranslate(nposition);
59 return std::make_shared<Transform3D>(ctransform);
73 ctransform.setIdentity();
74 ctransform.pretranslate(nposition);
75 ctransform.prerotate(
AngleAxis3D(angleX, Vector3D::UnitX()));
76 ctransform.prerotate(
AngleAxis3D(angleY, Vector3D::UnitY()));
77 return std::make_shared<Transform3D>(ctransform);
80 template <
typename Propagator_type>
84 double disttol = 0.1 *
87 using namespace Acts::UnitLiterals;
88 namespace VH = VectorHelpers;
100 double px = pT * cos(phi);
101 double py = pT * sin(phi);
102 double pz = pT / tan(theta);
109 const auto&
tp = propagator.propagate(pars, options).value().endParameters;
118 double r = (q * Bz != 0.) ?
std::abs(pT / (q * Bz))
124 turns = (q * Bz < 0) ? turns : -turns;
127 double exp_phi = std::fmod(phi + turns * 2 *
M_PI, 2 * M_PI);
128 if (exp_phi < -M_PI) {
131 if (exp_phi > M_PI) {
136 double exp_z =
z + pz / pT * 2 * M_PI *
r *
std::abs(turns);
141 double dx =
r * cos(M_PI / 2 - phi);
142 double dy =
r * sin(M_PI / 2 - phi);
151 double phi0 = std::atan2(
y - yc,
x - xc);
154 double exp_x = xc +
r * cos(phi0 + turns * 2 * M_PI);
155 double exp_y = yc +
r * sin(phi0 + turns * 2 * M_PI);
163 return tp->position();
166 template <
typename Propagator_type>
171 bool debug =
false) {
172 using namespace Acts::UnitLiterals;
194 double px = pT * cos(phi);
195 double py = pT * sin(phi);
196 double pz = pT / tan(theta);
204 const auto& fwdResult = propagator.propagate(start, fwdOptions).value();
205 const auto& bwdResult =
206 propagator.propagate(*fwdResult.endParameters, bwdOptions).value();
208 const Vector3D& bwdPosition = bwdResult.endParameters->position();
209 const Vector3D& bwdMomentum = bwdResult.endParameters->momentum();
222 auto fwdOutput = fwdResult.template get<DebugOutput::result_type>();
223 std::cout <<
">>>>> Output for forward propagation " << std::endl;
224 std::cout << fwdOutput.debugString << std::endl;
225 std::cout <<
" - resulted at position : "
226 << fwdResult.endParameters->position() << std::endl;
228 auto bwdOutput = bwdResult.template get<DebugOutput::result_type>();
229 std::cout <<
">>>>> Output for backward propagation " << std::endl;
230 std::cout << bwdOutput.debugString << std::endl;
231 std::cout <<
" - resulted at position : "
232 << bwdResult.endParameters->position() << std::endl;
237 template <
typename Propagator_type>
239 const Propagator_type& propagator,
double pT,
double phi,
double theta,
241 bool covtransport =
false,
bool debug =
false) {
242 using namespace Acts::UnitLiterals;
255 double px = pT * cos(phi);
256 double py = pT * sin(phi);
257 double pz = pT / tan(theta);
263 std::optional<Covariance> covOpt = std::nullopt;
269 10
_mm, 0, 0.123, 0, 0.5, 0,
270 0, 10
_mm, 0, 0.162, 0, 0,
271 0.123, 0, 0.1, 0, 0, 0,
272 0, 0.162, 0, 0.1, 0, 0,
273 0.5, 0, 0, 0, 1
_e / 10
_GeV, 0,
281 0.04 * rand1, 0.04 * rand2);
282 auto endSurface = Surface::makeShared<CylinderSurface>(
292 propagator.propagate(*
start, *endSurface, options).value();
293 const auto&
tp = result.endParameters;
295 BOOST_CHECK(
tp !=
nullptr);
297 return std::pair<Vector3D, double>(
tp->position(), result.pathLength);
302 propagator.propagate(*
start, *endSurface, options).value();
303 const auto&
tp = result.endParameters;
305 BOOST_CHECK(
tp !=
nullptr);
307 return std::pair<Vector3D, double>(
tp->position(), result.pathLength);
312 template <
typename Propagator_type,
typename SurfaceType>
314 const Propagator_type& propagator,
double pT,
double phi,
double theta,
316 bool planar =
true,
bool covtransport =
false,
bool debug =
false) {
317 using namespace Acts::UnitLiterals;
331 double px = pT * cos(phi);
332 double py = pT * sin(phi);
333 double pz = pT / tan(theta);
339 std::optional<Covariance> covOpt = std::nullopt;
345 10
_mm, 0, 0.123, 0, 0.5, 0,
346 0, 10
_mm, 0, 0.162, 0, 0,
347 0.123, 0, 0.1, 0, 0, 0,
348 0, 0.162, 0, 0.1, 0, 0,
349 0.5, 0, 0, 0, 1
_e / 10
_GeV, 0,
357 const auto result_s = propagator.propagate(*
start, options).value();
358 const auto& tp_s = result_s.endParameters;
362 tp_s->momentum().normalized(),
367 auto endSurface = Surface::makeShared<SurfaceType>(seTransform,
nullptr);
372 std::cout <<
">>> Path limit for this propgation is set to: "
376 auto result = propagator.propagate(*
start, *endSurface, options);
377 const auto& propRes = *result;
378 const auto&
tp = propRes.endParameters;
380 BOOST_CHECK(
tp !=
nullptr);
384 const auto& debugOutput =
385 propRes.template get<DebugOutput::result_type>();
386 std::cout <<
">>> Debug output of this propagation " << std::endl;
387 std::cout << debugOutput.debugString << std::endl;
388 std::cout <<
">>> Propagation status is : ";
390 std::cout <<
"success";
392 std::cout << result.error();
394 std::cout << std::endl;
398 return std::pair<Vector3D, double>(
tp->position(), propRes.pathLength);
401 const auto result_s = propagator.propagate(*
start, options).value();
402 const auto& tp_s = result_s.endParameters;
406 tp_s->momentum().normalized(),
411 auto endSurface = Surface::makeShared<SurfaceType>(seTransform,
nullptr);
416 std::cout <<
">>> Path limit for this propgation is set to: "
420 auto result = propagator.propagate(*
start, *endSurface, options);
421 const auto& propRes = *result;
422 const auto&
tp = propRes.endParameters;
424 BOOST_CHECK(
tp !=
nullptr);
428 const auto& debugOutput =
429 propRes.template get<DebugOutput::result_type>();
430 std::cout <<
">>> Debug output of this propagation " << std::endl;
431 std::cout << debugOutput.debugString << std::endl;
432 std::cout <<
">>> Propagation status is : ";
434 std::cout <<
"success";
436 std::cout << result.error();
438 std::cout << std::endl;
441 return std::pair<Vector3D, double>(
tp->position(), propRes.pathLength);
445 template <
typename Propagator_type>
448 double plimit,
bool debug =
false) {
449 using namespace Acts::UnitLiterals;
462 double px = pT * cos(phi);
463 double py = pT * sin(phi);
464 double pz = pT / tan(theta);
474 10
_mm, 0, 0.123, 0, 0.5, 0,
475 0, 10
_mm, 0, 0.162, 0, 0,
476 0.123, 0, 0.1, 0, 0, 0,
477 0, 0.162, 0, 0.1, 0, 0,
478 0.5, 0, 0, 0, 1
_e / 10
_GeV, 0,
485 const auto result = propagator.propagate(start, options).value();
486 const auto&
tp = result.endParameters;
488 return *(
tp->covariance());
491 template <
typename Propagator_type,
typename StartSurfaceType,
492 typename DestSurfaceType>
496 double rand3,
bool startPlanar =
true,
497 bool destPlanar =
true,
bool debug =
false) {
498 using namespace Acts::UnitLiterals;
510 double px = pT * cos(phi);
511 double py = pT * sin(phi);
512 double pz = pT / tan(theta);
522 10
_mm, 0, 0.123, 0, 0.5, 0,
523 0, 10
_mm, 0, 0.162, 0, 0,
524 0.123, 0, 0.1, 0, 0, 0,
525 0, 0.162, 0, 0.1, 0, 0,
526 0.5, 0, 0, 0, 1
_e / 10
_GeV, 0,
532 const auto result_c = propagator.propagate(start_c, options).value();
533 const auto& tp_c = result_c.endParameters;
539 auto seTransform = destPlanar
541 tp_c->momentum().normalized(),
547 Surface::makeShared<StartSurfaceType>(ssTransform,
nullptr);
553 auto endSurface = Surface::makeShared<DestSurfaceType>(seTransform,
nullptr);
554 const auto result = propagator.propagate(start, *endSurface, options).value();
555 const auto&
tp = result.endParameters;
558 return *(
tp->covariance());