Back to home page

EIC code displayed by LXR

 
 

    


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

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