Back to home page

EIC code displayed by LXR

 
 

    


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

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/Propagator/EigenStepperError.hpp"
0010 
0011 #include <string>
0012 
0013 namespace {
0014 
0015 class EigenStepperErrorCategory : public std::error_category {
0016  public:
0017   // Return a short descriptive name for the category.
0018   const char* name() const noexcept final { return "EigenStepperError"; }
0019 
0020   // Return what each enum means in text.
0021   std::string message(int c) const final {
0022     using Acts::EigenStepperError;
0023 
0024     switch (static_cast<EigenStepperError>(c)) {
0025       case EigenStepperError::StepSizeStalled:
0026         return "Step size fell below minimum threshold";
0027       case EigenStepperError::StepInvalid:
0028         return "Step calculation was invalid";
0029       case EigenStepperError::StepSizeAdjustmentFailed:
0030         return "Step size adjustment exceeds maximum trials";
0031       default:
0032         return "unknown";
0033     }
0034   }
0035 };
0036 
0037 }  // namespace
0038 
0039 std::error_code Acts::make_error_code(Acts::EigenStepperError e) {
0040   static EigenStepperErrorCategory c;
0041   return {static_cast<int>(e), c};
0042 }