Belle II Software development
ERightLeft.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
13namespace Belle2 {
19 namespace TrackFindingCDC {
20
22 namespace NRightLeft {
23
25 enum ERightLeft : signed short {
26
29
32
34 c_Left = -1,
35
37 c_Invalid = SHRT_MIN,
38 };
39
41 inline ERightLeft reversed(ERightLeft eRightLeft)
42 { return ERightLeft(-eRightLeft); }
43
45 inline bool isValid(ERightLeft eRightLeft)
46 { return std::abs(eRightLeft) <= 1; }
47 }
48
50 using ERightLeft = NRightLeft::ERightLeft;
51
52 }
54}
ERightLeft reversed(ERightLeft eRightLeft)
Return the reversed right left indicator. Leaves ERightLeft::c_Invalid the same.
Definition: ERightLeft.h:41
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:25
@ c_Invalid
Constant for an invalid passage information.
Definition: ERightLeft.h:37
@ c_Left
Constant for left passage.
Definition: ERightLeft.h:34
@ c_Right
Constant for right passage.
Definition: ERightLeft.h:28
@ c_Unknown
Constant for an not yet determined right left passage.
Definition: ERightLeft.h:31
bool isValid(ERightLeft eRightLeft)
Check whether the given enum instance is one of the valid values.
Definition: ERightLeft.h:45
Abstract base class for different kinds of events.