ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
initialize_parameter_set.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file initialize_parameter_set.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2018 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 namespace Acts {
12 namespace detail {
29 template <typename T, T... params>
30 struct initialize_parset;
31 
33 template <typename T, T first, T... others>
34 struct initialize_parset<T, first, others...> {
35  template <typename ParSetType, typename first_value_type,
36  typename... other_value_types>
37  static void init(ParSetType& parSet, const first_value_type& v1,
38  const other_value_types&... values) {
39  parSet.template setParameter<first>(v1);
40  initialize_parset<T, others...>::init(parSet, values...);
41  }
42 
43  template <typename ParSetType>
44  static void init(ParSetType& parSet,
45  const typename ParSetType::ParVector_t& values,
46  const unsigned int& pos = 0) {
47  parSet.template setParameter<first>(values(pos));
48  initialize_parset<T, others...>::init(parSet, values, pos + 1);
49  }
50 };
51 
52 template <typename T, T last>
53 struct initialize_parset<T, last> {
54  template <typename ParSet_tType, typename last_value_type>
55  static void init(ParSet_tType& ParSet_t, const last_value_type& v1) {
56  ParSet_t.template setParameter<last>(v1);
57  }
58 
59  template <typename ParSetType>
60  static void init(ParSetType& parSet,
61  const typename ParSetType::ParVector_t& values,
62  const unsigned int& pos = 0) {
63  parSet.template setParameter<last>(values(pos));
64  }
65 };
67 } // namespace detail
69 } // namespace Acts