Back to home page

EIC code displayed by LXR

 
 

    


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

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/TrackFitting/GlobalChiSquareFitterError.hpp"
0010 
0011 #include <string>
0012 
0013 namespace {
0014 
0015 class GlobalChiSquareFitterErrorCategory : public std::error_category {
0016  public:
0017   // Return a short descriptive name for the category.
0018   const char* name() const noexcept final {
0019     return "GlobalChiSquareFitterError";
0020   }
0021 
0022   // Return what each enum means in text.
0023   std::string message(int c) const final {
0024     using Acts::Experimental::GlobalChiSquareFitterError;
0025 
0026     switch (static_cast<GlobalChiSquareFitterError>(c)) {
0027       case GlobalChiSquareFitterError::AIsNotInvertible:
0028         return "Gx2f: aMatrix is not invertible.";
0029       case GlobalChiSquareFitterError::DidNotConverge:
0030         return "Gx2f: Did not converge in 'nUpdateMax' updates.";
0031       case GlobalChiSquareFitterError::NotEnoughMeasurements:
0032         return "Gx2f: Not enough measurements.";
0033       case GlobalChiSquareFitterError::UpdatePushedToNewVolume:
0034         return "Gx2f: Update pushed the parameters to a new volume.";
0035       case GlobalChiSquareFitterError::UsedUnreachableMeasurements:
0036         return "Gx2f: Final fit used unreachable measurements.";
0037       default:
0038         return "unknown";
0039     }
0040   }
0041 };
0042 
0043 }  // namespace
0044 
0045 std::error_code Acts::Experimental::make_error_code(
0046     Acts::Experimental::GlobalChiSquareFitterError e) {
0047   static GlobalChiSquareFitterErrorCategory c;
0048   return {static_cast<int>(e), c};
0049 }