Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GsfError.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file GsfError.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2021 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 
15 class GsfErrorCategory : public std::error_category {
16  public:
17  // Return a short descriptive name for the category.
18  const char* name() const noexcept final { return "GsfError"; }
19 
20  // Return what each enum means in text.
21  std::string message(int c) const final {
22  using Acts::GsfError;
23 
24  switch (static_cast<GsfError>(c)) {
25  case GsfError::StartParametersHaveNoCovariance:
26  return "Start parameters have no Covariance";
27  case GsfError::StartParametersNotOnStartSurface:
28  return "Start parameters don't lie in the start surface";
29  case GsfError::NoMeasurementStatesCreatedForward:
30  return "No measurement states found in the forward pass";
31  case GsfError::NoMeasurementStatesCreatedBackward:
32  return "No measurement states found in the backward pass";
33  case GsfError::NoMeasurementStatesCreatedFinal:
34  return "No measurement states in the final trajectory";
35  default:
36  return "unknown";
37  }
38  }
39 };
40 
41 } // namespace
42 
44  static GsfErrorCategory c;
45  return {static_cast<int>(e), c};
46 }