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-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 
11 namespace Acts {
12 namespace detail {
13 
30 template <typename T, T... params>
32 
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_vals(ParSetType& parSet, const first_value_type& v1,
38  const other_value_types&... values) {
39  parSet.template setParameter<first>(v1);
41  }
42 
43  template <typename ParSetType>
44  static void init_vec(ParSetType& parSet,
45  const typename ParSetType::ParametersVector& values,
46  const unsigned int& pos = 0) {
47  parSet.template setParameter<first>(values(pos));
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_vals(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_vec(ParSetType& parSet,
61  const typename ParSetType::ParametersVector& values,
62  const unsigned int& pos = 0) {
63  parSet.template setParameter<last>(values(pos));
64  }
65 };
66 
67 } // namespace detail
68 } // namespace Acts