Belle II Software  release-08-01-10
EPreferredDirection.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 #include <stdexcept>
11 #include <string>
12 
13 namespace Belle2 {
18  namespace TrackFindingCDC {
19 
28  enum class EPreferredDirection {
30  c_None,
32  c_Outwards,
34  c_Downwards,
36  c_Symmetric,
38  c_Curling,
39  };
40 
42  inline EPreferredDirection getPreferredDirection(const std::string& preferredDirectionString)
43  {
44  if (preferredDirectionString == std::string("none")) {
45  return EPreferredDirection::c_None;
46  } else if (preferredDirectionString == std::string("symmetric")) {
47  return EPreferredDirection::c_Symmetric;
48  } else if (preferredDirectionString == std::string("outwards")) {
49  return EPreferredDirection::c_Outwards;
50  } else if (preferredDirectionString == std::string("downwards")) {
51  return EPreferredDirection::c_Downwards;
52  } else if (preferredDirectionString == std::string("curling")) {
53  return EPreferredDirection::c_Curling;
54  } else {
55  throw std::invalid_argument("Unexpected preferred direction string : '" + preferredDirectionString + "'");
56  }
57  }
58  }
60 }
Abstract base class for different kinds of events.