Belle II Software development
EForwardBackward.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 NForwardBackward {
23
25 enum EForwardBackward : signed short {
26
29
32
35
37 c_Invalid = SHRT_MIN,
38 };
39
42 { return EForwardBackward(-eForwardBackward); }
43
45 inline bool isValid(EForwardBackward eForwardBackward)
46 { return std::abs(eForwardBackward) <= 1; }
47 }
48
50 using EForwardBackward = NForwardBackward::EForwardBackward;
51
52 }
54}
EForwardBackward reversed(EForwardBackward eForwardBackward)
Return the reversed forward backward indicator. Leaves EForwardBackward::c_Invalid the same.
bool isValid(EForwardBackward eForwardBackward)
Check whether the given enum instance is one of the valid values.
EForwardBackward
Enumeration to represent the distinct possibilities of the right left passage information.
@ c_Invalid
Constant for an invalid information.
@ c_Forward
Constant for a situation where something is more forward.
@ c_Backward
Constant for a situation where something is more backward.
@ c_Unknown
Constant for an not yet determined forward or backward arrangement.
Abstract base class for different kinds of events.