Belle II Software  release-05-01-25
ERotation.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 NRotation {
25 
27  enum ERotation : signed short {
28 
31 
33  c_Unknown = 0,
34 
36  c_Clockwise = -1,
37 
39  c_Invalid = SHRT_MIN,
40  };
41 
43  inline ERotation reversed(ERotation eRotation)
44  { return ERotation(-eRotation); }
45 
47  inline bool isValid(ERotation eRotation)
48  { return std::abs(eRotation) <= 1; }
49  }
50 
52  using ERotation = NRotation::ERotation;
53  }
55 }
Belle2::TrackFindingCDC::NRotation::c_Invalid
@ c_Invalid
Constant for an invalid information.
Definition: ERotation.h:47
Belle2::TrackFindingCDC::NRotation::c_Clockwise
@ c_Clockwise
Constant for clockwise oriented circle.
Definition: ERotation.h:44
Belle2::TrackFindingCDC::NRotation::c_CounterClockwise
@ c_CounterClockwise
Constant for counter clockwise oriented circle.
Definition: ERotation.h:38
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::NRotation::isValid
bool isValid(ERotation eRotation)
Check whether the given enum instance is one of the valid values.
Definition: ERotation.h:55
Belle2::TrackFindingCDC::NRotation::c_Unknown
@ c_Unknown
For the orientation of a line.
Definition: ERotation.h:41
Belle2::TrackFindingCDC::NRotation::ERotation
ERotation
Enumeration to represent the distinct possibilities of the right left passage information.
Definition: ERotation.h:35
Belle2::TrackFindingCDC::NRotation::reversed
ERotation reversed(ERotation eRotation)
Return the reversed rotation. Leaves ERotation::c_Invalid the same.
Definition: ERotation.h:51