9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
25 using namespace Acts::UnitLiterals;
46 Vector3D mom1a{400_MeV, 600_MeV, 200_MeV};
48 Vector3D mom1b{600_MeV, 400_MeV, -200_MeV};
49 Vector3D pos1c{1.2_mm, 1.3_mm, -7_mm};
50 Vector3D mom1c{300_MeV, 1000_MeV, 100_MeV};
62 std::shared_ptr<PerigeeSurface> perigeeSurface =
63 Surface::makeShared<PerigeeSurface>(pos0);
77 std::vector<const BoundTrackParameters*> vec1 = {¶ms1a, ¶ms1b,
79 std::vector<const BoundTrackParameters*>
vec2 = {¶ms1c, ¶ms1a,
82 auto res1 = finder.find(vec1, vertexingOptions, state);
83 auto res2 = finder.find(vec2, vertexingOptions, state);
86 std::cout << res1.error().message() << std::endl;
90 std::cout << res2.error().message() << std::endl;
93 if (res1.ok() and res2.ok()) {
94 BOOST_CHECK(!(*res1).empty());
95 BOOST_CHECK(!(*res2).empty());
97 Vector3D result2 = (*res2).back().position();
98 BOOST_CHECK(result1 == result2);
110 Vector3D mom1a{400_MeV, 600_MeV, 200_MeV};
112 Vector3D mom1b{600_MeV, 400_MeV, -200_MeV};
113 Vector3D pos1c{1.2_mm, 1.3_mm, -7_mm};
114 Vector3D mom1c{300_MeV, 1000_MeV, 100_MeV};
117 double const expectedZResult = -13.013;
124 Vector3D constraintPos{1.7_mm, 1.3_mm, -6_mm};
139 std::shared_ptr<PerigeeSurface> perigeeSurface =
140 Surface::makeShared<PerigeeSurface>(pos0);
154 std::vector<const BoundTrackParameters*> vec1 = {¶ms1a, ¶ms1b,
157 auto res = finder.find(vec1, vertexingOptions, state);
160 std::cout << res.error().message() << std::endl;
164 BOOST_CHECK(!(*res).empty());
167 BOOST_CHECK(result[
eX] == constraintPos[
eX]);
168 BOOST_CHECK(result[
eY] == constraintPos[
eY]);
175 std::normal_distribution<double>
xdist(1_mm, 0.1_mm);
177 std::normal_distribution<double>
ydist(-0.7_mm, 0.1_mm);
181 std::normal_distribution<double>
z2dist(-3_mm, 0.5_mm);
183 std::uniform_real_distribution<double>
pTDist(0.1_GeV, 100_GeV);
187 std::uniform_real_distribution<double>
etaDist(-4., 4.);
198 std::shared_ptr<PerigeeSurface> perigeeSurface =
199 Surface::makeShared<PerigeeSurface>(pos0);
210 std::mt19937 gen(mySeed);
211 unsigned int nTracks = 200;
213 std::vector<BoundTrackParameters> trackVec;
214 trackVec.reserve(nTracks);
217 for (
unsigned int i = 0; i < nTracks; i++) {
232 std::vector<const BoundTrackParameters*> trackPtrVec;
233 for (
const auto& trk : trackVec) {
234 trackPtrVec.push_back(&trk);
237 auto res3 = finder.find(trackPtrVec, vertexingOptions, state);
239 std::cout << res3.error().message() << std::endl;
243 BOOST_CHECK(!(*res3).empty());
244 Vector3D result = (*res3).back().position();
269 Vector3D mom1a{400_MeV, 600_MeV, 200_MeV};
271 Vector3D mom1b{600_MeV, 400_MeV, -200_MeV};
272 Vector3D pos1c{1.2_mm, 1.3_mm, -7_mm};
273 Vector3D mom1c{300_MeV, 1000_MeV, 100_MeV};
276 double const expectedZResult = -13.013;
282 Vector3D constraintPos{1.7_mm, 1.3_mm, -6_mm};
290 std::function<BoundTrackParameters(InputTrack)> extractParameters =
291 [](
InputTrack params) {
return params.parameters(); };
296 Finder finder(extractParameters);
301 std::shared_ptr<PerigeeSurface> perigeeSurface =
302 Surface::makeShared<PerigeeSurface>(pos0);
307 mom1a.norm(), 1, covMat));
310 mom1b.norm(), -1, covMat));
313 mom1c.norm(), -1, covMat));
316 std::vector<const InputTrack*> vec1 = {¶ms1a, ¶ms1b, ¶ms1c};
318 auto res = finder.find(vec1, vertexingOptions, state);
321 std::cout << res.error().message() << std::endl;
325 BOOST_CHECK(!(*res).empty());
326 Vector3D result = (*res).back().position();
328 BOOST_CHECK(result[
eX] == constraintPos[
eX]);
329 BOOST_CHECK(result[
eY] == constraintPos[
eY]);