ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::geometry::identifier Class Reference

Unique identifier for geometry objects, based on the ACTS GeometryIdentifier. More...

#include <detray/geometry/identifier.hpp>

Public Types

using encoder = detail::bit_encoder<value_t>
 Bit encoder used to read and update the packed fields.
using value_t = std::uint_least64_t
 Unsigned storage type for the packed identifier fields.

Public Member Functions

constexpr identifier ()=default
 Construct default identifier with all values set to 1.
constexpr identifier (value_t encoded)
 Construct from an already encoded value.
constexpr dindex extra () const
constexpr surface_id id () const
constexpr dindex index () const
constexpr bool is_invalid () const noexcept
 Check whether the identifier is valid to use.
bool operator== (const identifier &rhs) const =default
 Compare the complete packed identifier value.
constexpr identifier & set_extra (value_t extra)
 Set the extra identifier.
constexpr identifier & set_id (surface_id id)
 Set the surface id.
constexpr identifier & set_index (value_t index)
 Set the surface index.
constexpr identifier & set_transform (value_t index)
 Set the transform index.
constexpr identifier & set_volume (value_t volume)
 Set the volume index.
constexpr dindex transform () const
constexpr value_t value () const noexcept
constexpr dindex volume () const

Detailed Description

Unique identifier for geometry objects, based on the ACTS GeometryIdentifier.

Encodes the volume index, the type of surface (portal, sensitive, passive etc), an index to identify a surface in a geometry accelerator structure, as well as two extra bytes that can be used to tag surfaces arbitrarily.

Note
the detray identifier is not compatible with the ACTS GeometryIdentifier!
See also
https://github.com/acts-project/acts/blob/main/Core/include/Acts/Geometry/GeometryIdentifier.hpp

Constructor & Destructor Documentation

◆ identifier()

detray::geometry::identifier::identifier ( value_t encoded)
explicitconstexpr

Construct from an already encoded value.

Parameters
encodedValue containing the encoded geometry fields.

Member Function Documentation

◆ extra()

dindex detray::geometry::identifier::extra ( ) const
constexpr
Returns
the extra identifier

◆ id()

surface_id detray::geometry::identifier::id ( ) const
constexpr
Returns
the surface id.

◆ index()

dindex detray::geometry::identifier::index ( ) const
constexpr
Returns
the surface index.

◆ is_invalid()

bool detray::geometry::identifier::is_invalid ( ) const
constexprnoexcept

Check whether the identifier is valid to use.

Note
The extra bits are allowed to be invalid and will not be checked
Returns
True when a required field has its invalid sentinel value.

◆ operator==()

bool detray::geometry::identifier::operator== ( const identifier & rhs) const
default

Compare the complete packed identifier value.

Parameters
rhsIdentifier to compare with.
Returns
True when both encoded values are equal.

◆ set_extra()

identifier & detray::geometry::identifier::set_extra ( value_t extra)
constexpr

Set the extra identifier.

Parameters
extraExtra tag value to encode.
Returns
Reference to this identifier.

◆ set_id()

identifier & detray::geometry::identifier::set_id ( surface_id id)
constexpr

Set the surface id.

Parameters
idSurface category to encode.
Returns
Reference to this identifier.

◆ set_index()

identifier & detray::geometry::identifier::set_index ( value_t index)
constexpr

Set the surface index.

Parameters
indexSurface index to encode.
Returns
Reference to this identifier.

◆ set_transform()

identifier & detray::geometry::identifier::set_transform ( value_t index)
constexpr

Set the transform index.

Parameters
indexTransform index to encode.
Returns
Reference to this identifier.

◆ set_volume()

identifier & detray::geometry::identifier::set_volume ( value_t volume)
constexpr

Set the volume index.

Parameters
volumeVolume index to encode.
Returns
Reference to this identifier.

◆ transform()

dindex detray::geometry::identifier::transform ( ) const
constexpr
Returns
the transform index

◆ value()

value_t detray::geometry::identifier::value ( ) const
constexprnoexcept
Returns
the encoded value.

◆ volume()

dindex detray::geometry::identifier::volume ( ) const
constexpr
Returns
the volume index.