25 if (item == end(
spars))
26 return std::string_view();
27 return *begin(item->second);
38 auto result = std::find(std::begin(
paths), std::end(
paths), path);
39 if (result != end(
paths))
46 std::vector<double> SpecPar::value<std::vector<double>>(
const std::string&
key)
const {
47 std::vector<double> result;
49 auto const& nitem = numpars.find(
key);
50 if (nitem != end(numpars)) {
51 return std::vector<double>(begin(nitem->second), end(nitem->second));
54 auto const& sitem = spars.find(
key);
55 if (sitem != end(spars)) {
56 std::transform(begin(sitem->second), end(sitem->second), std::back_inserter(result), [](
auto& i) ->
double {
57 return dd4hep::_toDouble(i);
65 std::vector<int> SpecPar::value<std::vector<int>>(
const std::string&
key)
const {
66 std::vector<int> result;
68 auto const& nitem = numpars.find(
key);
69 if (nitem != end(numpars)) {
70 return std::vector<int>(begin(nitem->second), end(nitem->second));
73 auto const& sitem = spars.find(
key);
74 if (sitem != end(spars)) {
75 std::transform(begin(sitem->second), end(sitem->second), std::back_inserter(result), [](
auto& i) ->
int {
76 return dd4hep::_toInt(i);
84 std::vector<std::string> SpecPar::value<std::vector<std::string>>(
const std::string&
key)
const {
85 std::vector<std::string> result;
87 auto const& nitem = numpars.find(
key);
88 if (nitem != end(numpars)) {
89 std::transform(begin(nitem->second), end(nitem->second), std::back_inserter(result), [](
auto& i) -> std::string {
90 return std::to_string(i);
96 auto const& sitem = spars.find(
key);
97 if (sitem != end(spars)) {
98 return std::vector<std::string>(begin(sitem->second), end(sitem->second));
108 return *begin(item->second);
113 for_each(begin(
specpars), end(
specpars), [&refs, &attribute, &value, &found](
auto& k) {
115 for_each(begin(k.second.spars), end(k.second.spars), [&](
const auto& l) {
116 if (l.first == attribute) {
120 for_each(begin(l.second), end(l.second), [&](const auto& m) {
128 refs.emplace_back(std::string(k.first.data(), k.first.size()), &k.second);
135 if (it.second.hasValue(
key) || (it.second.spars.find(
key) != end(it.second.spars))) {
136 refs.emplace_back(it.first, &it.second);
143 std::vector<std::string_view> result;
145 if (i.second.hasPath(path))
146 result.emplace_back(i.first);
152 std::vector<std::string_view> result;
153 for_each(begin(
specpars), end(
specpars), [&result](
const auto& i) { result.emplace_back(i.first); });
159 find_if(begin(
specpars), end(
specpars), [&name](
const auto& i) {
return (i.first.compare(name) == 0); });
168 find_if(begin(
specpars), end(
specpars), [&name](
const auto& i) {
return (i.first.compare(name) == 0); });
170 return &result->second;