Class Acts::Direction¶
-
class Direction¶
The direction is always with respect to a given momentum, surface normal or other general axes.
Public Functions
-
inline constexpr Direction() = default¶
-
inline constexpr std::size_t index() const¶
Convert dir to index [0,1] which allows to store direction dependent objects in std::array<T, 2u>
- Returns
either 0 or 1
-
inline constexpr int sign() const¶
Turns the direction into a signed value.
- Returns
a signed value
-
std::string toString() const¶
Public Static Functions
-
static inline constexpr Direction fromIndex(std::size_t index)¶
Convert and index [0,1] to a direction e.g.
for sorting in std::array<T, 2u>
- Parameters
index – is the direction at input
-
static inline constexpr Direction fromScalar(ActsScalar scalar)¶
This turns a signed value into a direction.
Will assert on zero.
- Parameters
scalar – is the signed value
- Returns
a direction enum
-
static inline constexpr Direction fromScalarZeroAsPositive(ActsScalar scalar)¶
This turns a signed value into a direction and 0 will be handled as a positive direction.
Only use this when you are convinced that the 0 case is properly handled downstream.
- Parameters
scalar – is the signed value
- Returns
a direction enum
-
inline constexpr Direction() = default¶