Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:40

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include "Acts/EventData/TrackContainer.hpp"
0010 #include "Acts/Propagator/Navigator.hpp"
0011 #include "Acts/Propagator/Propagator.hpp"
0012 #include "Acts/Propagator/SympyStepper.hpp"
0013 #include "Acts/TrackFinding/CombinatorialKalmanFilter.hpp"
0014 #include "Acts/Utilities/Logger.hpp"
0015 #include "ActsExamples/EventData/Track.hpp"
0016 #include "ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp"
0017 
0018 #include <memory>
0019 #include <utility>
0020 
0021 namespace Acts {
0022 class MagneticFieldProvider;
0023 class TrackingGeometry;
0024 }  // namespace Acts
0025 
0026 namespace {
0027 
0028 using Stepper = Acts::SympyStepper;
0029 using Navigator = Acts::Navigator;
0030 using Propagator = Acts::Propagator<Stepper, Navigator>;
0031 using CKF =
0032     Acts::CombinatorialKalmanFilter<Propagator, ActsExamples::TrackContainer>;
0033 
0034 struct TrackFinderFunctionImpl
0035     : public ActsExamples::TrackFindingAlgorithm::TrackFinderFunction {
0036   CKF trackFinder;
0037 
0038   explicit TrackFinderFunctionImpl(CKF&& f) : trackFinder(std::move(f)) {}
0039 
0040   ActsExamples::TrackFindingAlgorithm::TrackFinderResult operator()(
0041       const ActsExamples::TrackParameters& initialParameters,
0042       const ActsExamples::TrackFindingAlgorithm::TrackFinderOptions& options,
0043       ActsExamples::TrackContainer& tracks,
0044       ActsExamples::TrackProxy rootBranch) const override {
0045     return trackFinder.findTracks(initialParameters, options, tracks,
0046                                   rootBranch);
0047   }
0048 };
0049 
0050 }  // namespace
0051 
0052 std::shared_ptr<ActsExamples::TrackFindingAlgorithm::TrackFinderFunction>
0053 ActsExamples::TrackFindingAlgorithm::makeTrackFinderFunction(
0054     std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry,
0055     std::shared_ptr<const Acts::MagneticFieldProvider> magneticField,
0056     const Acts::Logger& logger) {
0057   Stepper stepper(std::move(magneticField));
0058   Navigator::Config cfg{std::move(trackingGeometry)};
0059   cfg.resolvePassive = false;
0060   cfg.resolveMaterial = true;
0061   cfg.resolveSensitive = true;
0062   Navigator navigator(cfg, logger.cloneWithSuffix("Navigator"));
0063   Propagator propagator(std::move(stepper), std::move(navigator),
0064                         logger.cloneWithSuffix("Propagator"));
0065   CKF trackFinder(std::move(propagator), logger.cloneWithSuffix("Finder"));
0066 
0067   // build the track finder functions. owns the track finder object.
0068   return std::make_shared<TrackFinderFunctionImpl>(std::move(trackFinder));
0069 }