ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
ActsPlugins::TGeoAxes Class Reference

Type-safe representation of TGeo surface axes. More...

#include <ActsPlugins/Root/TGeoAxes.hpp>

Public Member Functions

consteval TGeoAxes (const char(&s)[4])
 Construct from a 3-character string literal.
std::string_view value () const
 Return the axes string as a 3-character string view.

Static Public Member Functions

static TGeoAxes parse (std::string_view s)
 Construct from a runtime string.

Detailed Description

Type-safe representation of TGeo surface axes.

The axes string encodes which TGeo coordinate axes map to the local X and Y directions of an Acts surface, with case controlling the sign:

  • Uppercase (X, Y, Z): positive direction
  • Lowercase (x, y, z): negative direction

Valid values are all 3-character permutations of {X,x}, {Y,y}, {Z,z} with no axis letter repeated (e.g. "XYZ", "XZY", "xYz").

String literals are validated at compile time via the consteval constructor — invalid characters or repeated axes are a compile error. Runtime construction is available via parse().

Constructor & Destructor Documentation

◆ TGeoAxes()

ActsPlugins::TGeoAxes::TGeoAxes ( const char(&) s[4])
consteval

Construct from a 3-character string literal.

The parameter type const char (&)[4] only binds to exactly 3-character string literals; wrong lengths are a type error. Invalid characters or repeated axis letters cause a compile error.

Parameters
sA 3-character axes string literal, e.g. "XYZ"

Member Function Documentation

◆ parse()

TGeoAxes ActsPlugins::TGeoAxes::parse ( std::string_view s)
static

Construct from a runtime string.

Throws on invalid input.

Parameters
sA string of exactly 3 characters from [XxYyZz] with no repeated axis letter.
Exceptions
std::invalid_argumentif the string is not a valid axes encoding.
Returns
The parsed axes as a TGeoAxes object.

◆ value()

std::string_view ActsPlugins::TGeoAxes::value ( ) const

Return the axes string as a 3-character string view.

Returns
The axes string as a 3-character string view.