Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-09 08:30:26

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 /// Helper to define a "simple" interface for running pede
0012 /// as a child process, without bringing in additional
0013 /// external dependencies.
0014 
0015 #include "Acts/Utilities/Logger.hpp"
0016 
0017 #include <filesystem>
0018 #include <optional>
0019 #include <string>
0020 #include <vector>
0021 
0022 namespace ActsPlugins::detail {
0023 
0024 enum class MpSolverStatus {
0025   OK = 0,
0026   ProgNotFound = 1,
0027   FailedRedirectStdout = 2,
0028   FailedWorkDir = 3,
0029   FailedRun = 4,
0030   UnknownError = 5
0031 };
0032 
0033 /// @brief attempt to run a program as a child process.
0034 /// @param program: Program name (search on PATH)
0035 /// @param args: command line args
0036 /// @param runDir: Directory to run in. Caller is responsible for ensuring
0037 /// validity.
0038 /// @param logger: A logger instance
0039 /// @param redirectOutput: if set, redirect pede output to file
0040 /// of given name instead of printing to the host stdout
0041 /// @return the call outcome as a status code
0042 MpSolverStatus runSolverProcess(
0043     const std::string& program, const std::vector<std::string>& args,
0044     const std::filesystem::path& runDir, const Acts::Logger& logger,
0045     const std::optional<std::filesystem::path>& redirectOutput = std::nullopt);
0046 
0047 }  // namespace ActsPlugins::detail