Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DigitizationError.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DigitizationError.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
10 
11 #include <string>
12 
13 namespace {
14 
16 class DigitizationErrorCategory : public std::error_category {
17  public:
19  const char* name() const noexcept final { return "DigitizationError"; }
20 
22  std::string message(int c) const final {
24 
25  switch (static_cast<DigitizationError>(c)) {
26  case DigitizationError::SmearingOutOfRange:
27  return "Smeared out of surface bounds.";
28  case DigitizationError::SmearingError:
29  return "Smearing error occured.";
30  case DigitizationError::UndefinedSurface:
31  return "Surface undefined for this operation.";
32  case DigitizationError::MaskingError:
33  return "Surface mask could not be applied.";
34  default:
35  return "unknown";
36  }
37  }
38 };
39 
40 } // namespace
41 
43  static DigitizationErrorCategory c;
44  return {static_cast<int>(e), c};
45 }