Belle II Software  release-05-01-25
EPreferredDirection.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <stdexcept>
13 #include <string>
14 
15 namespace Belle2 {
20  namespace TrackFindingCDC {
21 
30  enum class EPreferredDirection {
32  c_None,
34  c_Outwards,
36  c_Downwards,
38  c_Symmetric,
40  c_Curling,
41  };
42 
44  inline EPreferredDirection getPreferredDirection(const std::string& preferredDirectionString)
45  {
46  if (preferredDirectionString == std::string("none")) {
47  return EPreferredDirection::c_None;
48  } else if (preferredDirectionString == std::string("symmetric")) {
49  return EPreferredDirection::c_Symmetric;
50  } else if (preferredDirectionString == std::string("outwards")) {
51  return EPreferredDirection::c_Outwards;
52  } else if (preferredDirectionString == std::string("downwards")) {
53  return EPreferredDirection::c_Downwards;
54  } else if (preferredDirectionString == std::string("curling")) {
55  return EPreferredDirection::c_Curling;
56  } else {
57  throw std::invalid_argument("Unexpected preferred direction string : '" + preferredDirectionString + "'");
58  }
59  }
60  }
62 }
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19