9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
32 using namespace Acts::UnitLiterals;
53 auto propagator = std::make_shared<Propagator>(
stepper);
59 IPEstimator ipEstimator(ipEstimatorCfg);
61 std::vector<double> temperatures{8.0, 4.0, 2.0, 1.4142136, 1.2247449, 1.0};
69 fitterCfg.annealingTool = annealingUtility;
76 fitterCfg.doSmoothing =
true;
78 Fitter fitter(fitterCfg);
82 SeedFinder seedFinder;
86 Finder::Config finderConfig(std::move(fitter), seedFinder, ipEstimator,
92 Finder finder(finderConfig);
97 std::cout <<
"Number of tracks in event: " << tracks.size() << std::endl;
100 for (
const auto& trk : tracks) {
101 std::cout << count <<
". track: " << std::endl;
102 std::cout <<
"params: " << trk << std::endl;
104 if (count == maxCout) {
110 std::vector<const BoundParameters*> tracksPtr;
111 for (
const auto& trk : tracks) {
112 tracksPtr.push_back(&trk);
120 constraintCov << 0.000196000008145347238, 0, 0, 0, 0.000196000008145347238, 0,
129 auto findResult = finder.find(tracksPtr, vertexingOptions);
131 if (!findResult.ok()) {
132 std::cout << findResult.error().message() << std::endl;
135 BOOST_CHECK(findResult.ok());
137 std::vector<Vertex<BoundParameters>> allVertices = *findResult;
140 std::cout <<
"Number of vertices reconstructed: " << allVertices.size()
144 for (
const auto& vtx : allVertices) {
146 std::cout << count <<
". Vertex at position: " << vtx.
position()[0]
147 <<
", " << vtx.position()[1] <<
", " << vtx.position()[2]
149 std::cout << count <<
". Vertex with cov: " << vtx.covariance()
151 std::cout <<
"\t with n tracks: " << vtx.tracks().size() << std::endl;
157 const int expNRecoVertices = 15;
162 expVtx1Cov << 0.000, 1.e-05, -8.e-05, 1.e-05, 0.000, -8.e-05, -8.e-05,
164 std::vector<double> expVtx1TrkWeights{0.9796, 0.0334, 0.9884, 0.9697};
165 std::vector<double> expVtx1TrkComp{1.2542, 15.7317, 0.1144, 2.067};
166 std::vector<double> expVtx1TrkChi2{0, 0, 0, 0};
171 expVtx15Cov << 0.000, 1.e-06, 0.000, 1.e-06, 0.000, -6.e-05, 0.000, -6.e-05,
173 std::vector<double> expVtx15TrkWeights{0.0048, 0.0005, 0.0236, 0.8481,
175 std::vector<double> expVtx15TrkComp{19.6561, 24.1389, 16.4425, 5.5604,
177 std::vector<double> expVtx15TrkChi2{0, 0, 0, 0};
180 const std::vector<double> expAllVtxZPos{
181 -6.070_mm, -12.0605_mm, -15.1093_mm, -27.6569_mm, -22.1054_mm,
182 -45.7010_mm, -5.0622_mm, -26.5496_mm, -28.9597_mm, -37.7430_mm,
183 5.4828_mm, -47.8939_mm, 2.5777_mm, -0.2656_mm, -39.8197_mm};
186 const std::vector<int> expAllNTracks{4, 2, 3, 14, 5, 9, 8, 17,
187 7, 2, 2, 4, 2, 7, 5};
189 BOOST_CHECK_EQUAL(allVertices.size(), expNRecoVertices);
192 for (
const auto& vtx : allVertices) {
196 BOOST_CHECK_EQUAL(vtx.tracks().size(), expAllNTracks[count]);
203 for (
const auto& trk : vtx.tracks()) {
217 for (
const auto& trk : vtx.tracks()) {
233 : m_parameters(params), m_id(id) {}
238 int id()
const {
return m_id; }
258 auto propagator = std::make_shared<Propagator>(
stepper);
262 std::function<BoundParameters(InputTrack)> extractParameters =
263 [](
InputTrack params) {
return params.parameters(); };
269 IPEstimator ipEstimator(ipEstimatorCfg);
271 std::vector<double> temperatures{8.0, 4.0, 2.0, 1.4142136, 1.2247449, 1.0};
279 fitterCfg.annealingTool = annealingUtility;
286 fitterCfg.doSmoothing =
true;
288 Fitter fitter(fitterCfg, extractParameters);
292 SeedFinder seedFinder(extractParameters);
296 Finder::Config finderConfig(std::move(fitter), seedFinder, ipEstimator,
299 Finder finder(finderConfig, extractParameters);
303 std::vector<InputTrack> userTracks;
305 for (
const auto& trk : tracks) {
306 userTracks.push_back(
InputTrack(trk, idCount));
311 std::cout <<
"Number of tracks in event: " << tracks.size() << std::endl;
314 for (
const auto& trk : tracks) {
315 std::cout << count <<
". track: " << std::endl;
316 std::cout <<
"params: " << trk << std::endl;
318 if (count == maxCout) {
324 std::vector<const InputTrack*> userTracksPtr;
325 for (
const auto& trk : userTracks) {
326 userTracksPtr.push_back(&trk);
333 constraintCov << 0.000196000008145347238, 0, 0, 0, 0.000196000008145347238, 0,
342 auto findResult = finder.find(userTracksPtr, vertexingOptions);
344 if (!findResult.ok()) {
345 std::cout << findResult.error().message() << std::endl;
348 BOOST_CHECK(findResult.ok());
350 std::vector<Vertex<InputTrack>> allVertices = *findResult;
353 std::cout <<
"Number of vertices reconstructed: " << allVertices.size()
357 for (
const auto& vtx : allVertices) {
359 std::cout << count <<
". Vertex at position: " << vtx.
position()[0]
360 <<
", " << vtx.position()[1] <<
", " << vtx.position()[2]
362 std::cout << count <<
". Vertex with cov: " << vtx.covariance()
364 std::cout <<
"\t with n tracks: " << vtx.tracks().size() << std::endl;
366 for (
auto& trk : allVertices[0].tracks()) {
367 std::cout <<
"Track ID at first vertex: " << trk.originalParams->id()
374 const int expNRecoVertices = 15;
379 expVtx1Cov << 0.000, 1.e-05, -8.e-05, 1.e-05, 0.000, -8.e-05, -8.e-05,
381 std::vector<double> expVtx1TrkWeights{0.9796, 0.0334, 0.9884, 0.9697};
382 std::vector<double> expVtx1TrkComp{1.2542, 15.7317, 0.1144, 2.067};
383 std::vector<double> expVtx1TrkChi2{0, 0, 0, 0};
388 expVtx15Cov << 0.000, 1.e-06, 0.000, 1.e-06, 0.000, -6.e-05, 0.000, -6.e-05,
390 std::vector<double> expVtx15TrkWeights{0.0048, 0.0005, 0.0236, 0.8481,
392 std::vector<double> expVtx15TrkComp{19.6561, 24.1389, 16.4425, 5.5604,
394 std::vector<double> expVtx15TrkChi2{0, 0, 0, 0};
397 const std::vector<double> expAllVtxZPos{
398 -6.070_mm, -12.0605_mm, -15.1093_mm, -27.6569_mm, -22.1054_mm,
399 -45.7010_mm, -5.0622_mm, -26.5496_mm, -28.9597_mm, -37.7430_mm,
400 5.4828_mm, -47.8939_mm, 2.5777_mm, -0.2656_mm, -39.8197_mm};
403 const std::vector<int> expAllNTracks{4, 2, 3, 14, 5, 9, 8, 17,
404 7, 2, 2, 4, 2, 7, 5};
406 const std::vector<int> expTracksIDs{29, 51, 89, 132};
408 BOOST_CHECK_EQUAL(allVertices.size(), expNRecoVertices);
411 for (
const auto& vtx : allVertices) {
415 BOOST_CHECK_EQUAL(vtx.tracks().size(), expAllNTracks[count]);
422 for (
const auto& trk : vtx.tracks()) {
426 BOOST_CHECK_EQUAL(trk.originalParams->id(), expTracksIDs[trkCount]);
437 for (
const auto& trk : vtx.tracks()) {