EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ValueCorrector.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ValueCorrector.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-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 
12 
13 #include <utility>
14 
15 #include <Eigen/Core>
16 
17 namespace Acts {
18 namespace detail {
19 
24 template <typename indices_t, indices_t... kParameters>
26  using StorageSequence = std::make_index_sequence<sizeof...(kParameters)>;
27 
32  template <typename values_t>
33  static void run(Eigen::MatrixBase<values_t>& values) {
34  runImpl(values, StorageSequence{});
35  }
36 
37  template <typename values_t, std::size_t... kStorage>
38  static void runImpl(Eigen::MatrixBase<values_t>& values,
39  std::index_sequence<kStorage...>) {
40  EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(values_t, sizeof...(kParameters));
41  static_assert(sizeof...(kParameters) == sizeof...(kStorage),
42  "Parameters and storage index packs must have the same size");
43 
44  ((values[kStorage] =
46  ...);
47  }
48 };
49 
50 } // namespace detail
51 } // namespace Acts