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 #include "ActsPlugins/Mille/MillePedeError.hpp"
0010 
0011 #include <string>
0012 
0013 namespace {
0014 
0015 class MillePedeErrorCategory : public std::error_category {
0016  public:
0017   // Return a short descriptive name for the category.
0018   const char* name() const noexcept final { return "MillePedeError"; }
0019 
0020   // Return what each enum means in text.
0021   std::string message(int c) const final {
0022     using ActsPlugins::MillePedeError;
0023     using enum MillePedeError;
0024 
0025     switch (static_cast<MillePedeError>(c)) {
0026       case InstallationNotFound:
0027         return "Installation of the 'pede' program was not found";
0028       case SteeringNotFound:
0029         return "Steering file for `pede` was not found at configured location";
0030       case SolverCrash:
0031         return "The solver crashed";
0032       case InvalidSolution:
0033         return "The solver encountered a serious error and found no valid "
0034                "solution";
0035       case SolutionNotReadable:
0036         return "The solution was not readable";
0037       case UnableToWriteSteering:
0038         return "The steering file could not be generated";
0039       default:
0040         return "unknown";
0041     }
0042   }
0043 };
0044 
0045 }  // namespace
0046 
0047 std::error_code ActsPlugins::make_error_code(MillePedeError e) {
0048   static MillePedeErrorCategory c;
0049   return {static_cast<int>(e), c};
0050 }