Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MeasurementHelpers.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MeasurementHelpers.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019-2020 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 #include <cstddef>
15 
16 namespace Acts {
17 
18 namespace detail {
22 template <size_t I>
34  template <typename L, typename A, typename B>
35  auto static constexpr invoke(A&& param, B&& cov, L&& lambda) {
36  return lambda(param.template head<I>(), cov.template topLeftCorner<I, I>());
37  }
38 };
39 } // namespace detail
40 
54 template <typename L, typename A, typename B>
55 auto visit_measurement(A&& param, B&& cov, size_t dim, L&& lambda) {
56  return template_switch<detail::visit_measurement_callable, 1, eBoundSize>(
57  dim, param, cov, lambda);
58 }
59 
67 template <typename L>
68 auto visit_measurement(size_t dim, L&& lambda) {
69  return template_switch_lambda<1, eBoundSize>(dim, lambda);
70 }
71 
72 } // namespace Acts