File indexing completed on 2025-01-30 09:15:06
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "ActsFatras/Digitization/DigitizationError.hpp"
0010
0011 #include <string>
0012
0013 namespace {
0014
0015
0016 class DigitizationErrorCategory : public std::error_category {
0017 public:
0018
0019 const char* name() const noexcept final { return "DigitizationError"; }
0020
0021
0022 std::string message(int c) const final {
0023 using ActsFatras::DigitizationError;
0024
0025 switch (static_cast<DigitizationError>(c)) {
0026 case DigitizationError::SmearingOutOfRange:
0027 return "Smeared out of surface bounds.";
0028 case DigitizationError::SmearingError:
0029 return "Smearing error occurred.";
0030 case DigitizationError::UndefinedSurface:
0031 return "Surface undefined for this operation.";
0032 case DigitizationError::MaskingError:
0033 return "Surface mask could not be applied.";
0034 default:
0035 return "unknown";
0036 }
0037 }
0038 };
0039
0040 }
0041
0042 std::error_code ActsFatras::make_error_code(ActsFatras::DigitizationError e) {
0043 static DigitizationErrorCategory c;
0044 return {static_cast<int>(e), c};
0045 }