File indexing completed on 2026-11-06 09:26:57
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "ActsExamples/AlignmentMillePede/MillePedeSolverAlgorithm.hpp"
0010
0011 #include "Acts/Utilities/Logger.hpp"
0012 #include "ActsExamples/Framework/ProcessCode.hpp"
0013 #include "ActsPlugins/Mille/MillePedeResultReader.hpp"
0014 #include "ActsPlugins/Mille/MillePedeSolver.hpp"
0015 #include "ActsPlugins/Mille/MillePedeSteering.hpp"
0016
0017 namespace ActsExamples {
0018
0019 ProcessCode MillePedeSolverAlgorithm::finalize() {
0020 ACTS_INFO("=== Generating alignment steering file for Millepede-II ===");
0021 auto confPath = ActsPlugins::generateMillePedeSteeringFile(
0022 m_cfg.solverConfig.steeringFile, m_cfg.steeringConfig, logger());
0023 if (!confPath.ok()) {
0024 ACTS_ERROR(
0025 "Failed to generate the steering file, aborting alignment attempt");
0026 return ProcessCode::ABORT;
0027 }
0028 ACTS_INFO("=== Proceeding to run Millepede-II alignment fit ===");
0029
0030 const auto& solverResult =
0031 ActsPlugins::runMillePedeSolver(m_cfg.solverConfig, logger());
0032
0033 if (!solverResult.ok()) {
0034 ACTS_ERROR("=== Alignment FAILED! ===");
0035 return ProcessCode::ABORT;
0036 }
0037
0038 const auto& readRes =
0039 ActsPlugins::readMillePedeResult(solverResult->resultsFile, logger());
0040
0041 if (!readRes.ok()) {
0042 ACTS_ERROR("Failed to read the MP result file!");
0043 return ProcessCode::ABORT;
0044 }
0045 ACTS_INFO("=== Finished alignment and readback with exit code "
0046 << solverResult->exitCode << " (" << solverResult->exitMessage
0047 << "), found " << readRes->size() << " alignment parameters ===");
0048
0049
0050
0051
0052 return ProcessCode::SUCCESS;
0053 }
0054
0055 }