Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 08:20:24

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/Propagator/EigenStepper.hpp"
0010 #include "Acts/Propagator/Navigator.hpp"
0011 #include "Acts/Propagator/Propagator.hpp"
0012 #include "Acts/TrackFitting/GainMatrixSmoother.hpp"
0013 #include "Acts/TrackFitting/GainMatrixUpdater.hpp"
0014 #include "ActsAlignment/Kernel/Alignment.hpp"
0015 #include "ActsExamples/Alignment/AlignmentAlgorithm.hpp"
0016 #include "ActsExamples/MagneticField/MagneticField.hpp"
0017 
0018 namespace {
0019 
0020 using Updater = Acts::GainMatrixUpdater;
0021 using Smoother = Acts::GainMatrixSmoother;
0022 using Stepper = Acts::EigenStepper<>;
0023 using Propagator = Acts::Propagator<Stepper, Acts::Navigator>;
0024 using Fitter = Acts::KalmanFitter<Propagator, Acts::VectorMultiTrajectory>;
0025 using Alignment = ActsAlignment::Alignment<Fitter>;
0026 
0027 struct AlignmentFunctionImpl
0028     : public ActsExamples::AlignmentAlgorithm::AlignmentFunction {
0029   Alignment align;
0030 
0031   explicit AlignmentFunctionImpl(Alignment&& a) : align(std::move(a)) {}
0032 
0033   ActsExamples::AlignmentAlgorithm::AlignmentResult operator()(
0034       const std::vector<std::vector<ActsExamples::IndexSourceLink>>&
0035           sourceLinks,
0036       const ActsExamples::TrackParametersContainer& initialParameters,
0037       const ActsAlignment::AlignmentOptions<
0038           ActsExamples::AlignmentAlgorithm::TrackFitterOptions>& options)
0039       const override {
0040     return align.align(sourceLinks, initialParameters, options);
0041   };
0042 };
0043 }  // namespace
0044 
0045 std::shared_ptr<ActsExamples::AlignmentAlgorithm::AlignmentFunction>
0046 ActsExamples::AlignmentAlgorithm::makeAlignmentFunction(
0047     std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry,
0048     std::shared_ptr<const Acts::MagneticFieldProvider> magneticField) {
0049   Stepper stepper(std::move(magneticField));
0050   Acts::Navigator::Config cfg{std::move(trackingGeometry)};
0051   cfg.resolvePassive = false;
0052   cfg.resolveMaterial = true;
0053   cfg.resolveSensitive = true;
0054   Acts::Navigator navigator(cfg);
0055   Propagator propagator(std::move(stepper), std::move(navigator));
0056   Fitter trackFitter(std::move(propagator));
0057   Alignment alignment(std::move(trackFitter));
0058 
0059   // build the alignment functions. owns the alignment object.
0060   return std::make_shared<AlignmentFunctionImpl>(std::move(alignment));
0061 }