EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
make_projection_matrix.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file make_projection_matrix.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 namespace Acts {
14 namespace detail {
15 
29 template <unsigned int columns, unsigned int... rows>
31 
32 // build projection matrix by iteratively stacking row vectors
33 template <unsigned int columns, unsigned int i, unsigned int... N>
34 struct make_projection_matrix<columns, i, N...> {
35  static ActsMatrixD<sizeof...(N) + 1, columns> init() {
37  v.setZero();
38  v(i) = 1;
39 
40  ActsMatrixD<sizeof...(N) + 1, columns> m;
41  m.row(0) << v;
42  m.block(1, 0, sizeof...(N), columns)
44 
45  return m;
46  }
47 };
48 
49 // projection matrix for a single local parameter is a simple row vector
50 template <unsigned int columns, unsigned int i>
51 struct make_projection_matrix<columns, i> {
54  v.setZero();
55  v(i) = 1;
56  return v;
57  }
58 };
59 
60 } // namespace detail
61 } // namespace Acts