Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackFindingAlgorithmFunction.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackFindingAlgorithmFunction.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2021 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
24 
25 #include <algorithm>
26 #include <map>
27 #include <memory>
28 #include <utility>
29 #include <vector>
30 
31 namespace Acts {
32 class MagneticFieldProvider;
33 class TrackingGeometry;
34 } // namespace Acts
35 
36 namespace {
37 
38 using Updater = Acts::GainMatrixUpdater;
39 using Smoother = Acts::GainMatrixSmoother;
40 
42 using Navigator = Acts::Navigator;
44 using CKF =
46 
47 using TrackContainer =
49  Acts::VectorMultiTrajectory, std::shared_ptr>;
50 
51 struct TrackFinderFunctionImpl
53  CKF trackFinder;
54 
55  TrackFinderFunctionImpl(CKF&& f) : trackFinder(std::move(f)) {}
56 
58  const ActsExamples::TrackParameters& initialParameters,
60  TrackContainer& tracks) const override {
61  return trackFinder.findTracks(initialParameters, options, tracks);
62  };
63 };
64 
65 } // namespace
66 
67 std::shared_ptr<ActsExamples::TrackFindingAlgorithm::TrackFinderFunction>
69  std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry,
70  std::shared_ptr<const Acts::MagneticFieldProvider> magneticField,
71  const Acts::Logger& logger) {
72  Stepper stepper(std::move(magneticField));
73  Navigator::Config cfg{std::move(trackingGeometry)};
74  cfg.resolvePassive = false;
75  cfg.resolveMaterial = true;
76  cfg.resolveSensitive = true;
77  Navigator navigator(cfg, logger.cloneWithSuffix("Navigator"));
78  Propagator propagator(std::move(stepper), std::move(navigator),
79  logger.cloneWithSuffix("Propagator"));
80  CKF trackFinder(std::move(propagator), logger.cloneWithSuffix("Finder"));
81 
82  // build the track finder functions. owns the track finder object.
83  return std::make_shared<TrackFinderFunctionImpl>(std::move(trackFinder));
84 }