Belle II Software  release-05-01-25
EIncDec.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 NIncDec {
25 
27  enum EIncDec : signed short {
28 
30  c_Increasing = 1,
31 
33  c_Constant = 0,
34 
36  c_Decreasing = -1,
37 
39  c_Invalid = SHRT_MIN,
40  };
41 
43  inline EIncDec reversed(EIncDec eIncDec)
44  { return EIncDec(-eIncDec); }
45 
47  inline bool isValid(EIncDec eIncDec)
48  { return std::abs(eIncDec) <= 1; }
49  }
50 
52  using EIncDec = NIncDec::EIncDec;
53 
54  }
56 }
Belle2::TrackFindingCDC::NIncDec::reversed
EIncDec reversed(EIncDec eIncDec)
Return the reversed increasing decreasing indicator. Leaves EIncDec::c_Invalid the same.
Definition: EIncDec.h:51
Belle2::TrackFindingCDC::NIncDec::EIncDec
EIncDec
Enumeration to represent the distinct possibilities of the right left passage information.
Definition: EIncDec.h:35
Belle2::TrackFindingCDC::NIncDec::c_Decreasing
@ c_Decreasing
Constant for a variable that decreases.
Definition: EIncDec.h:44
Belle2::TrackFindingCDC::NIncDec::c_Increasing
@ c_Increasing
Constant for a variable that increases.
Definition: EIncDec.h:38
Belle2::TrackFindingCDC::NIncDec::c_Constant
@ c_Constant
Constant for a variable that is constant.
Definition: EIncDec.h:41
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::NIncDec::isValid
bool isValid(EIncDec eIncDec)
Check whether the given enum instance is one of the valid values.
Definition: EIncDec.h:55
Belle2::TrackFindingCDC::NIncDec::c_Invalid
@ c_Invalid
Constant for an invalid information.
Definition: EIncDec.h:47