File indexing completed on 2026-05-28 07:12:25
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 case DigitizationError::DriftError:
0035 return "Drift error occurred.";
0036 case DigitizationError::MaximumRetriesExceeded:
0037 return "Maximum number of retries exceeded.";
0038 default:
0039 return "unknown";
0040 }
0041 }
0042 };
0043
0044 }
0045
0046 std::error_code ActsFatras::make_error_code(ActsFatras::DigitizationError e) {
0047 static DigitizationErrorCategory c;
0048 return {static_cast<int>(e), c};
0049 }