Belle II Software  release-05-02-19
ERightLeft.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 <cstdlib> // for abs
13 #include <climits>
14 
15 namespace Belle2 {
21  namespace TrackFindingCDC {
22 
24  namespace NRightLeft {
25 
27  enum ERightLeft : signed short {
28 
30  c_Right = 1,
31 
33  c_Unknown = 0,
34 
36  c_Left = -1,
37 
39  c_Invalid = SHRT_MIN,
40  };
41 
43  inline ERightLeft reversed(ERightLeft eRightLeft)
44  { return ERightLeft(-eRightLeft); }
45 
47  inline bool isValid(ERightLeft eRightLeft)
48  { return std::abs(eRightLeft) <= 1; }
49  }
50 
52  using ERightLeft = NRightLeft::ERightLeft;
53 
54  }
56 }
Belle2::TrackFindingCDC::NRightLeft::c_Unknown
@ c_Unknown
Constant for an not yet determined right left passage.
Definition: ERightLeft.h:41
Belle2::TrackFindingCDC::NRightLeft::isValid
bool isValid(ERightLeft eRightLeft)
Check whether the given enum instance is one of the valid values.
Definition: ERightLeft.h:55
Belle2::TrackFindingCDC::NRightLeft::c_Right
@ c_Right
Constant for right passage.
Definition: ERightLeft.h:38
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::NRightLeft::reversed
ERightLeft reversed(ERightLeft eRightLeft)
Return the reversed right left indicator. Leaves ERightLeft::c_Invalid the same.
Definition: ERightLeft.h:51
Belle2::TrackFindingCDC::NRightLeft::ERightLeft
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:35
Belle2::TrackFindingCDC::NRightLeft::c_Invalid
@ c_Invalid
Constant for an invalid passage information.
Definition: ERightLeft.h:47
Belle2::TrackFindingCDC::NRightLeft::c_Left
@ c_Left
Constant for left passage.
Definition: ERightLeft.h:44