9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
41 #include <system_error>
45 using namespace Acts::UnitLiterals;
65 Vector3 pos1a{1.86052_mm, -1.24035_mm, -10_mm};
66 Vector3 mom1a{400_MeV, 600_MeV, 200_MeV};
67 Vector3 pos1b{-1.24035_mm, 1.86052_mm, -3_mm};
68 Vector3 mom1b{600_MeV, 400_MeV, -200_MeV};
69 Vector3 pos1c{1.69457_mm, -0.50837_mm, -7_mm};
70 Vector3 mom1c{300_MeV, 1000_MeV, 100_MeV};
82 std::shared_ptr<PerigeeSurface> perigeeSurface =
83 Surface::makeShared<PerigeeSurface>(pos0);
103 std::vector<const BoundTrackParameters*> vec1 = {¶ms1a, ¶ms1b,
105 std::vector<const BoundTrackParameters*>
vec2 = {¶ms1c, ¶ms1a,
108 auto res1 = finder.find(vec1, vertexingOptions, state);
109 auto res2 = finder.find(vec2, vertexingOptions, state);
112 std::cout << res1.error().message() << std::endl;
116 std::cout << res2.error().message() << std::endl;
119 if (res1.ok() and res2.ok()) {
120 BOOST_CHECK(!(*res1).empty());
121 BOOST_CHECK(!(*res2).empty());
122 Vector3 result1 = (*res1).back().position();
123 Vector3 result2 = (*res2).back().position();
124 BOOST_CHECK(result1 == result2);
135 Vector3 pos1a{1.86052_mm, -1.24035_mm, -10_mm};
136 Vector3 mom1a{400_MeV, 600_MeV, 200_MeV};
137 Vector3 pos1b{-1.24035_mm, 1.86052_mm, -3_mm};
138 Vector3 mom1b{600_MeV, 400_MeV, -200_MeV};
139 Vector3 pos1c{1.69457_mm, -0.50837_mm, -7_mm};
140 Vector3 mom1c{300_MeV, 1000_MeV, 100_MeV};
143 double const expectedZResult = -13.013;
146 Vector3 constraintPos{1.7_mm, 1.3_mm, -6_mm};
163 std::shared_ptr<PerigeeSurface> perigeeSurface =
164 Surface::makeShared<PerigeeSurface>(pos0);
184 std::vector<const BoundTrackParameters*> vec1 = {¶ms1a, ¶ms1b,
187 auto res = finder.find(vec1, vertexingOptions, state);
190 std::cout << res.error().message() << std::endl;
194 BOOST_CHECK(!(*res).empty());
195 Vector3 result = (*res).back().position();
197 BOOST_CHECK(result[
eX] == constraintPos[
eX]);
198 BOOST_CHECK(result[
eY] == constraintPos[
eY]);
205 std::normal_distribution<double>
xdist(1_mm, 0.1_mm);
207 std::normal_distribution<double>
ydist(-0.7_mm, 0.1_mm);
211 std::normal_distribution<double>
z2dist(-3_mm, 0.5_mm);
213 std::uniform_real_distribution<double>
pTDist(0.1_GeV, 100_GeV);
215 std::uniform_real_distribution<double>
phiDist(-M_PI, M_PI);
217 std::uniform_real_distribution<double>
etaDist(-4., 4.);
228 std::shared_ptr<PerigeeSurface> perigeeSurface =
229 Surface::makeShared<PerigeeSurface>(pos0);
240 std::mt19937
gen(mySeed);
241 unsigned int nTracks = 200;
243 std::vector<BoundTrackParameters> trackVec;
244 trackVec.reserve(nTracks);
247 for (
unsigned int i = 0;
i < nTracks;
i++) {
260 perigeeSurface->intersect(
geoContext, pos, direction).closest();
261 pos = intersection.position();
269 direction, charge / pt, covMat,
274 std::vector<const BoundTrackParameters*> trackPtrVec;
275 for (
const auto& trk : trackVec) {
276 trackPtrVec.push_back(&trk);
279 auto res3 = finder.find(trackPtrVec, vertexingOptions, state);
281 std::cout << res3.error().message() << std::endl;
285 BOOST_CHECK(!(*res3).empty());
286 Vector3 result = (*res3).back().position();
310 Vector3 pos1a{1.86052_mm, -1.24035_mm, -10_mm};
311 Vector3 mom1a{400_MeV, 600_MeV, 200_MeV};
312 Vector3 pos1b{-1.24035_mm, 1.86052_mm, -3_mm};
313 Vector3 mom1b{600_MeV, 400_MeV, -200_MeV};
314 Vector3 pos1c{1.69457_mm, -0.50837_mm, -7_mm};
315 Vector3 mom1c{300_MeV, 1000_MeV, 100_MeV};
318 double const expectedZResult = -13.013;
321 Vector3 constraintPos{1.7_mm, 1.3_mm, -6_mm};
331 std::function<BoundTrackParameters(InputTrack)> extractParameters =
332 [](
const InputTrack& params) {
return params.parameters(); };
337 Finder finder(extractParameters);
342 std::shared_ptr<PerigeeSurface> perigeeSurface =
343 Surface::makeShared<PerigeeSurface>(pos0);
348 1_e / mom1a.norm(), covMat,
353 -1_e / mom1b.norm(), covMat,
358 -1_e / mom1c.norm(), covMat,
363 std::vector<const InputTrack*> vec1 = {¶ms1a, ¶ms1b, ¶ms1c};
365 auto res = finder.find(vec1, vertexingOptions, state);
368 std::cout << res.error().message() << std::endl;
372 BOOST_CHECK(!(*res).empty());
373 Vector3 result = (*res).back().position();
375 BOOST_CHECK(result[
eX] == constraintPos[
eX]);
376 BOOST_CHECK(result[
eY] == constraintPos[
eY]);