3 #include "DD4hep/Detector.h"
10 string_view DDSpecPar::strValue(
const string&
key)
const {
11 auto const&
item = spars.find(
key);
17 bool DDSpecPar::hasValue(
const string&
key)
const {
18 if (numpars.find(
key) !=
end(numpars))
24 bool DDSpecPar::hasPath(
const string&
path)
const {
33 std::vector<double> DDSpecPar::value<std::vector<double>>(
const string&
key)
const {
34 std::vector<double>
result;
36 auto const& nitem = numpars.find(
key);
37 if (nitem !=
end(numpars)) {
38 return std::vector<double>(
begin(nitem->second),
end(nitem->second));
41 auto const& sitem = spars.find(
key);
42 if (sitem !=
end(spars)) {
44 return dd4hep::_toDouble(i);
52 std::vector<int> DDSpecPar::value<std::vector<int>>(
const string&
key)
const {
55 auto const& nitem = numpars.find(
key);
56 if (nitem !=
end(numpars)) {
57 return std::vector<int>(
begin(nitem->second),
end(nitem->second));
60 auto const& sitem = spars.find(
key);
61 if (sitem !=
end(spars)) {
63 return dd4hep::_toInt(i);
71 std::vector<std::string> DDSpecPar::value<std::vector<std::string>>(
const string&
key)
const {
72 std::vector<std::string>
result;
74 auto const& nitem = numpars.find(
key);
75 if (nitem !=
end(numpars)) {
77 return std::to_string(i);
83 auto const& sitem = spars.find(
key);
84 if (sitem !=
end(spars)) {
85 return std::vector<std::string>(
begin(sitem->second),
end(sitem->second));
91 double DDSpecPar::dblValue(
const string&
key)
const {
92 auto const&
item = numpars.find(
key);
102 for_each(
begin(
k.second.spars),
end(
k.second.spars), [&](
const auto&
l) {
103 if (l.first == attribute) {
107 for_each(begin(l.second), end(l.second), [&](const auto& m) {
115 k.second.name =
k.first;
116 refs.emplace_back(&
k.second);
122 std::vector<std::string_view>
result;
123 for_each(
begin(specpars),
end(specpars), [&](
const auto&
i) {
124 if (
i.second.hasPath(
path))
131 std::vector<std::string_view>
result;
136 bool DDSpecParRegistry::hasSpecPar(std::string_view
name)
const {
138 find_if(
begin(specpars),
end(specpars), [&
name](
const auto&
i) {
return (
i.first.compare(
name) == 0); });
147 find_if(
begin(specpars),
end(specpars), [&
name](
const auto&
i) {
return (
i.first.compare(
name) == 0); });