9 #include <boost/test/unit_test.hpp>
16 namespace tt = boost::test_tools;
43 double stepSize = 123.;
44 double tolerance = 234.;
59 BOOST_TEST(!asState.covTransport);
60 BOOST_TEST(asState.covariance ==
nullptr);
61 BOOST_TEST(asState.pVector[0] == pos.x());
62 BOOST_TEST(asState.pVector[1] == pos.y());
63 BOOST_TEST(asState.pVector[2] == pos.z());
64 BOOST_TEST(asState.pVector[3] == time);
68 BOOST_TEST(asState.pVector[7] == charge / mom.norm());
69 BOOST_TEST(asState.navDir == ndir);
70 BOOST_TEST(asState.pathAccumulated == 0.);
71 BOOST_TEST(asState.stepSize == ndir * stepSize);
72 BOOST_TEST(asState.previousStepSize == 0.);
73 BOOST_TEST(asState.tolerance == tolerance);
80 BOOST_TEST(asState.covTransport);
81 BOOST_TEST(*asState.covariance == cov);
91 double stepSize = 123.;
92 double tolerance = 234.;
105 stepSize, tolerance);
111 BOOST_TEST(as.
momentum(asState) == mom.norm());
113 BOOST_TEST(as.
time(asState) ==
time);
118 const std::string originalStepSize = asState.stepSize.toString();
121 BOOST_TEST(asState.previousStepSize == ndir * stepSize);
122 BOOST_TEST(asState.stepSize == 1337.);
125 BOOST_TEST(asState.stepSize == -123.);
130 auto curvPars = std::get<0>(curvState);
135 BOOST_TEST(curvPars.covariance().has_value());
136 BOOST_TEST(*curvPars.covariance() != cov);
144 double newTime(321.);
145 as.
update(asState, newPos, newMom.normalized(), newMom.norm(), newTime);
146 BOOST_TEST(as.
position(asState) == newPos);
147 BOOST_TEST(as.
direction(asState) == newMom.normalized());
148 BOOST_TEST(as.
momentum(asState) == newMom.norm());
150 BOOST_TEST(as.
time(asState) == newTime);
155 BOOST_TEST(asState.cov != cov);
162 double h = as.
step(ps).value();
163 BOOST_TEST(ps.
stepping.stepSize == ndir * stepSize);
164 BOOST_TEST(ps.
stepping.stepSize == h);
173 double h2 = as.
step(ps).value();
174 BOOST_TEST(ps.
stepping.stepSize == ndir * stepSize);
184 auto plane = Surface::makeShared<PlaneSurface>(
pos, mom.normalized());
187 stepSize, tolerance);
190 auto targetSurface = Surface::makeShared<PlaneSurface>(
191 pos + ndir * 2. * mom.normalized(), mom.normalized());
198 targetSurface->intersect(asState.geoContext, as.
position(asState),
199 asState.navDir * as.
direction(asState),
false),
201 BOOST_TEST(asState.stepSize == 2.);
202 asState.stepSize = ndir * stepSize;
205 targetSurface->intersect(asState.geoContext, as.
position(asState),
206 asState.navDir * as.
direction(asState),
false),
208 BOOST_TEST(asState.stepSize == 2.);
217 BOOST_TEST(boundPars.covariance().has_value());
218 BOOST_TEST(*boundPars.covariance() != cov);
225 -1. * charge, 2. * time, targetSurface);
226 as.
update(asState, bpTarget);
229 BOOST_TEST(as.
momentum(asState) == 2. * mom.norm());
231 BOOST_TEST(as.
time(asState) == 2. *
time);
236 BOOST_TEST(asState.cov != cov);