Belle II Software  release-08-01-10
EIncDec.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 <cstdlib> // for abs
11 #include <climits>
12 
13 namespace Belle2 {
19  namespace TrackFindingCDC {
20 
22  namespace NIncDec {
23 
25  enum EIncDec : signed short {
26 
29 
32 
35 
37  c_Invalid = SHRT_MIN,
38  };
39 
41  inline EIncDec reversed(EIncDec eIncDec)
42  { return EIncDec(-eIncDec); }
43 
45  inline bool isValid(EIncDec eIncDec)
46  { return std::abs(eIncDec) <= 1; }
47  }
48 
50  using EIncDec = NIncDec::EIncDec;
51 
52  }
54 }
EIncDec
Enumeration to represent the distinct possibilities of the right left passage information.
Definition: EIncDec.h:25
@ c_Decreasing
Constant for a variable that decreases.
Definition: EIncDec.h:34
@ c_Increasing
Constant for a variable that increases.
Definition: EIncDec.h:28
@ c_Invalid
Constant for an invalid information.
Definition: EIncDec.h:37
@ c_Constant
Constant for a variable that is constant.
Definition: EIncDec.h:31
EIncDec reversed(EIncDec eIncDec)
Return the reversed increasing decreasing indicator. Leaves EIncDec::c_Invalid the same.
Definition: EIncDec.h:41
bool isValid(EIncDec eIncDec)
Check whether the given enum instance is one of the valid values.
Definition: EIncDec.h:45
Abstract base class for different kinds of events.