Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-07 07:59:15

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 #pragma once
0010 
0011 #include "Acts/Geometry/GeometryIdentifier.hpp"
0012 #include "Acts/Propagator/EigenStepper.hpp"
0013 #include "Acts/Propagator/Navigator.hpp"
0014 #include "Acts/Propagator/Propagator.hpp"
0015 #include "Acts/Propagator/detail/SteppingLogger.hpp"
0016 #include "Acts/TrackFitting/KalmanFitter.hpp"
0017 #include "ActsAlignment/Kernel/Alignment.hpp"
0018 #include "ActsExamples/Framework/DataHandle.hpp"
0019 #include "ActsExamples/Framework/IAlgorithm.hpp"
0020 
0021 #include <memory>
0022 
0023 namespace Acts {
0024 class MagneticFieldProvider;
0025 }
0026 
0027 namespace ActsExamples {
0028 
0029 /// @brief Algorithm for reading Mille binaries into ACTS
0030 /// and solving using them to run an alignment fit
0031 /// with the built-in solver.
0032 class ActsSolverFromMille final : public IAlgorithm {
0033  public:
0034   using SteppingLogger = Acts::detail::SteppingLogger;
0035   using EndOfWorld = Acts::EndOfWorldReached;
0036   using Stepper = Acts::EigenStepper<>;
0037   using Propagator = Acts::Propagator<Stepper, Acts::Navigator>;
0038   using Fitter = Acts::KalmanFitter<Propagator, Acts::VectorMultiTrajectory>;
0039   using Alignment = ActsAlignment::Alignment<Fitter>;
0040 
0041   using AlignmentParameters =
0042       std::unordered_map<Acts::SurfacePlacementBase*, Acts::Transform3>;
0043 
0044   /// configuration
0045   struct Config {
0046     /// name of the mille input binary. You can choose
0047     /// between ".root" / ".csv" / ".dat" extensions
0048     /// to get ROOT tree / plain text / classic Millepede
0049     /// binary outputs. All three can be read by the interface.
0050     std::string milleInput;
0051     // the tracking geometry to use
0052     std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry;
0053     // magnetic field
0054     std::shared_ptr<const Acts::MagneticFieldProvider> magneticField;
0055     // modules to fix in the alignment to suppress global movements
0056     std::set<Acts::GeometryIdentifier> fixModules;
0057   };
0058 
0059   /// Constructor of the sandbox algorithm
0060   /// @param cfg is the config struct to configure the algorithm
0061   /// @param level is the logging level
0062   explicit ActsSolverFromMille(
0063       Config cfg, std::unique_ptr<const Acts::Logger> logger = nullptr);
0064 
0065   /// Framework execute method of the sandbox algorithm
0066   ///
0067   /// @param ctx is the algorithm context that holds event-wise information
0068   /// @return a process code to steer the algorithm flow
0069   ProcessCode execute(const AlgorithmContext& ctx) const override;
0070   ProcessCode finalize() override;
0071 
0072   /// Get readonly access to the config parameters
0073   const Config& config() const { return m_cfg; }
0074 
0075  private:
0076   /// configuration instance
0077   Config m_cfg;
0078 
0079   /// alignment module instance - reuse as much as possible
0080   std::shared_ptr<Alignment> m_align;
0081   /// tracking geometry
0082   std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry;
0083 };
0084 
0085 }  // namespace ActsExamples