File Ray.hpp

namespace Acts

Note

This file is foreseen for the Geometry module to replace Extent

Typedefs

using Ray3D = Ray<ActsScalar, 3>

Functions

template<typename T, size_t D>
std::ostream &operator<<(std::ostream &os, const Ray<T, D> &ray)

Overload of the outstream operator.

Parameters
  • os – The out stream

  • ray – The ray to write to os

Returns

The outstream given in os

template<typename value_t, size_t DIM>
class Ray
#include <Acts/Utilities/Ray.hpp>

Class which models a ray.

It is defined by a starting point and a direction.

Template Parameters
  • value_t – The floating point type to use

  • DIM – The number of dimensions in which this ray is defined (2 or 3)

Public Types

using transform_type = Eigen::Transform<value_t, DIM, Eigen::Affine>

Associated transform type.

using value_type = value_t

Re expose the value type.

using vertex_array_type = Eigen::Array<value_t, DIM, 1>

Vertex array type corresponding to the vertex type.

using VertexType = Eigen::Matrix<value_t, DIM, 1>

Vertex type based on the value type and dimension.

Public Functions

Ray(const VertexType &origin, const VertexType &dir)

Constructor from an origin point and a direction.

Parameters
  • origin – The origin of the ray

  • dir – The direction of the ray

inline const VertexType &dir() const

Getter for the direction.

Returns

The direction

template<size_t D = DIM, std::enable_if_t<D == 3, int> = 0>
void draw(IVisualization3D &helper, value_type far_distance = 10) const

Helper to draw this ray using a given visualization helper.

Parameters
  • helper – The visualization helper

  • far_distance – The “length” of the drawn line representing the ray

inline const vertex_array_type &idir() const

Getter for the element wise inverse of the direction.

Returns

The element wise inverse.

inline const VertexType &origin() const

Getter for the origin.

Returns

The origin

std::ostream &toStream(std::ostream &os) const

Write information on this instance to an outstream.

Parameters

os – The out stream

Returns

The out stream given as an argument

Ray<value_t, DIM> transformed(const transform_type &trf) const

Transforms this ray using a given transform and returns a new instance.

Parameters

trf – The transform to apply

Returns

Copy of this ray with the transform applied

Private Members

VertexType m_dir
vertex_array_type m_idir
VertexType m_origin