9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
29 using namespace Acts::UnitLiterals;
35 using Propagator = Propagator<EigenStepper<ConstantBField>>;
43 std::uniform_real_distribution<>
vXYDist(-0.1_mm, 0.1_mm);
45 std::uniform_real_distribution<>
vZDist(-20_mm, 20_mm);
47 std::uniform_real_distribution<>
d0Dist(-0.01_mm, 0.01_mm);
49 std::uniform_real_distribution<>
z0Dist(-0.2_mm, 0.2_mm);
51 std::uniform_real_distribution<>
pTDist(0.4_GeV, 10_GeV);
57 std::uniform_real_distribution<>
qDist(-1, 1);
59 std::uniform_real_distribution<>
resIPDist(0., 100_um);
61 std::uniform_real_distribution<>
resAngDist(0., 0.1);
63 std::uniform_real_distribution<>
resQoPDist(-0.01, 0.01);
69 unsigned int nTests = 50;
71 for (
unsigned int iTest = 0; iTest < nTests; ++iTest) {
73 unsigned int nTracks = 30;
77 std::mt19937 gen(mySeed);
86 auto propagator = std::make_shared<Propagator>(
stepper);
92 std::shared_ptr<PerigeeSurface> perigeeSurface =
93 Surface::makeShared<PerigeeSurface>(
Vector3D(0., 0., 0.));
101 double d0_v = sqrt(x * x + y * y);
105 std::vector<BoundTrackParameters> tracks;
109 for (
unsigned int iTrack = 0; iTrack < nTracks; iTrack++) {
111 double q =
qDist(gen) < 0 ? -1. : 1.;
131 covMat << resD0 * resD0, 0., 0., 0., 0., 0., 0., resZ0 * resZ0, 0., 0.,
132 0., 0., 0., 0., resPh * resPh, 0., 0., 0., 0., 0., 0., resTh * resTh,
133 0., 0., 0., 0., 0., 0., resQp * resQp, 0., 0., 0., 0., 0., 0., 1.;
135 tracks.emplace_back(perigeeSurface, paramVec, std::move(covMat));
138 std::vector<const BoundTrackParameters*> tracksPtr;
139 for (
const auto& trk : tracks) {
140 tracksPtr.push_back(&trk);
145 static_assert(VertexFinderConcept<VertexFinder>,
146 "Vertex finder does not fulfill vertex finder concept.");
152 IPEstimator ipEstimator(ipEstimatorCfg);
161 VertexFinder::State state;
162 auto res = finder.find(tracksPtr, vertexingOptions, state);
164 BOOST_CHECK(res.ok());
167 std::cout << res.error().message() << std::endl;
171 BOOST_CHECK(!(*res).empty());
172 Vector3D result = (*res).back().position();
194 unsigned int nTests = 50;
196 for (
unsigned int iTest = 0; iTest < nTests; ++iTest) {
198 unsigned int nTracks = 30;
202 std::mt19937 gen(mySeed);
211 auto propagator = std::make_shared<Propagator>(
stepper);
216 std::shared_ptr<PerigeeSurface> perigeeSurface =
217 Surface::makeShared<PerigeeSurface>(
Vector3D(0., 0., 0.));
225 double d0_v = sqrt(x * x + y * y);
229 std::vector<InputTrack> tracks;
233 for (
unsigned int iTrack = 0; iTrack < nTracks; iTrack++) {
235 double q =
qDist(gen) < 0 ? -1. : 1.;
239 double z0track = z0_v +
z0Dist(gen);
253 covMat << resD0 * resD0, 0., 0., 0., 0., 0., 0., resZ0 * resZ0, 0., 0.,
254 0., 0., 0., 0., resPh * resPh, 0., 0., 0., 0., 0., 0., resTh * resTh,
255 0., 0., 0., 0., 0., 0., resQp * resQp, 0., 0., 0., 0., 0., 0., 1.;
261 std::vector<const InputTrack*> tracksPtr;
262 for (
const auto& trk : tracks) {
263 tracksPtr.push_back(&trk);
268 static_assert(VertexFinderConcept<VertexFinder>,
269 "Vertex finder does not fulfill vertex finder concept.");
275 IPEstimator ipEstimator(ipEstimatorCfg);
281 std::function<BoundTrackParameters(InputTrack)> extractParameters =
282 [](
InputTrack params) {
return params.parameters(); };
285 VertexFinder::State state;
289 auto res = finder.find(tracksPtr, vertexingOptions, state);
291 BOOST_CHECK(res.ok());
294 std::cout << res.error().message() << std::endl;
298 BOOST_CHECK(!(*res).empty());
299 Vector3D result = (*res).back().position();