9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
44 #include <system_error>
46 #include <type_traits>
51 using namespace Acts::UnitLiterals;
65 std::uniform_real_distribution<>
vXYDist(-0.1_mm, 0.1_mm);
67 std::uniform_real_distribution<>
vZDist(-20_mm, 20_mm);
69 std::uniform_real_distribution<>
d0Dist(-0.01_mm, 0.01_mm);
71 std::uniform_real_distribution<>
z0Dist(-0.2_mm, 0.2_mm);
73 std::uniform_real_distribution<>
pTDist(0.4_GeV, 10_GeV);
75 std::uniform_real_distribution<>
phiDist(-M_PI, M_PI);
77 std::uniform_real_distribution<>
thetaDist(1.0, M_PI - 1.0);
79 std::uniform_real_distribution<>
qDist(-1, 1);
81 std::uniform_real_distribution<>
resIPDist(0., 100_um);
83 std::uniform_real_distribution<>
resAngDist(0., 0.1);
85 std::uniform_real_distribution<>
resQoPDist(-0.01, 0.01);
91 unsigned int nTests = 50;
93 for (
unsigned int iTest = 0; iTest < nTests; ++iTest) {
95 unsigned int nTracks = 30;
99 std::mt19937
gen(mySeed);
102 auto bField = std::make_shared<ConstantBField>(
Vector3{0.0, 0.0, 1_T});
108 auto propagator = std::make_shared<Propagator>(
stepper);
110 using BilloirFitter =
114 std::shared_ptr<PerigeeSurface> perigeeSurface =
115 Surface::makeShared<PerigeeSurface>(
Vector3(0., 0., 0.));
123 double d0_v = std::hypot(x, y);
127 std::vector<BoundTrackParameters>
tracks;
131 for (
unsigned int iTrack = 0; iTrack < nTracks; iTrack++) {
133 double q =
qDist(gen) < 0 ? -1. : 1.;
153 covMat << resD0 * resD0, 0., 0., 0., 0., 0., 0., resZ0 * resZ0, 0., 0.,
154 0., 0., 0., 0., resPh * resPh, 0., 0., 0., 0., 0., 0., resTh * resTh,
155 0., 0., 0., 0., 0., 0., resQp * resQp, 0., 0., 0., 0., 0., 0., 1.;
157 tracks.emplace_back(perigeeSurface, paramVec,
std::move(covMat),
161 std::vector<const BoundTrackParameters*> tracksPtr;
162 for (
const auto& trk : tracks) {
163 tracksPtr.push_back(&trk);
168 static_assert(VertexFinderConcept<VertexFinder>,
169 "Vertex finder does not fulfill vertex finder concept.");
175 IPEstimator ipEstimator(ipEstimatorCfg);
179 VertexFinder finder(cfg);
184 VertexFinder::State
state;
185 auto res = finder.find(tracksPtr, vertexingOptions, state);
187 BOOST_CHECK(res.ok());
190 std::cout << res.error().message() << std::endl;
194 BOOST_CHECK(!(*res).empty());
195 Vector3 result = (*res).back().position();
217 unsigned int nTests = 50;
219 for (
unsigned int iTest = 0; iTest < nTests; ++iTest) {
221 unsigned int nTracks = 30;
225 std::mt19937
gen(mySeed);
228 auto bField = std::make_shared<ConstantBField>(
Vector3{0.0, 0.0, 1_T});
234 auto propagator = std::make_shared<Propagator>(
stepper);
239 std::shared_ptr<PerigeeSurface> perigeeSurface =
240 Surface::makeShared<PerigeeSurface>(
Vector3(0., 0., 0.));
248 double d0_v = std::hypot(x, y);
252 std::vector<InputTrack>
tracks;
256 for (
unsigned int iTrack = 0; iTrack < nTracks; iTrack++) {
258 double q =
qDist(gen) < 0 ? -1. : 1.;
262 double z0track = z0_v +
z0Dist(gen);
276 covMat << resD0 * resD0, 0., 0., 0., 0., 0., 0., resZ0 * resZ0, 0., 0.,
277 0., 0., 0., 0., resPh * resPh, 0., 0., 0., 0., 0., 0., resTh * resTh,
278 0., 0., 0., 0., 0., 0., resQp * resQp, 0., 0., 0., 0., 0., 0., 1.;
285 std::vector<const InputTrack*> tracksPtr;
286 for (
const auto& trk : tracks) {
287 tracksPtr.push_back(&trk);
292 static_assert(VertexFinderConcept<VertexFinder>,
293 "Vertex finder does not fulfill vertex finder concept.");
299 IPEstimator ipEstimator(ipEstimatorCfg);
305 std::function<BoundTrackParameters(InputTrack)> extractParameters =
306 [](
const InputTrack& params) {
return params.parameters(); };
308 VertexFinder finder(cfg, extractParameters);
309 VertexFinder::State
state;
313 auto res = finder.find(tracksPtr, vertexingOptions, state);
315 BOOST_CHECK(res.ok());
318 std::cout << res.error().message() << std::endl;
322 BOOST_CHECK(!(*res).empty());
323 Vector3 result = (*res).back().position();