ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
geometry_utils.hpp
1// This file is part of the ACTS project.
2//
3// Copyright (C) 2016 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 https://mozilla.org/MPL/2.0/.
8
9#pragma once
10
11// Project include(s)
12#include "detray/core/concepts.hpp"
13#include "detray/definitions/algebra.hpp"
14#include "detray/definitions/math.hpp"
15#include "detray/geometry/surface.hpp"
16
17namespace detray {
18
27template <concepts::detector detector_t, concepts::point point_t>
28DETRAY_HOST_DEVICE constexpr dscalar<typename detector_t::algebra_type>
29cos_angle(const typename detector_t::geometry_context &ctx,
32 const point_t &loc) {
33 return math::fabs(vector::dot(dir, sf.normal(ctx, loc)));
34}
35
36} // namespace detray
Facade for a detray detector surface.
Definition surface.hpp:36
constexpr auto normal(const context &ctx, const point_t &p) const -> vector3_type
Definition surface.hpp:239
Detray include(s).
Definition array_operators.hpp:18
get_scalar_t< A, T > dscalar
Scalar type for algebra A and value type T.
Definition algebra.hpp:64
constexpr dscalar< typename detector_t::algebra_type > cos_angle(const typename detector_t::geometry_context &ctx, geometry::surface< detector_t > sf, const dvector3D< typename detector_t::algebra_type > &dir, const point_t &loc)
Helper to get the incidence angle of a direction vector on a surface.
Definition geometry_utils.hpp:29
get_vector3D_t< A, T > dvector3D
Three-dimensional vector type for algebra A and value type T.
Definition algebra.hpp:80