Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Ray.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Ray.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018-2019 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
13 
14 namespace Acts {
15 
20 template <typename value_t, size_t DIM>
21 class Ray {
22  public:
26  using VertexType = Eigen::Matrix<value_t, DIM, 1>;
28  using vertex_array_type = Eigen::Array<value_t, DIM, 1>;
30  using transform_type = Eigen::Transform<value_t, DIM, Eigen::Affine>;
31 
35  Ray(const VertexType& origin, const VertexType& dir);
36 
39  const VertexType& origin() const { return m_origin; }
40 
43  const VertexType& dir() const { return m_dir; }
44 
47  const vertex_array_type& idir() const { return m_idir; }
48 
53 
57  std::ostream& toStream(std::ostream& os) const;
58 
62  template <size_t D = DIM, std::enable_if_t<D == 3, int> = 0>
63  void draw(IVisualization3D& helper, value_type far_distance = 10) const;
64 
65  private:
69 };
70 
75 template <typename T, size_t D>
76 std::ostream& operator<<(std::ostream& os, const Ray<T, D>& ray) {
77  ray.dump(os);
78  return os;
79 }
80 
82 
83 } // namespace Acts
84 
85 #include "Acts/Utilities/Ray.ipp"