Skip to content

Commit

Permalink
Merge pull request #28019 from ianna/dd4hep-filtered-view-v9
Browse files Browse the repository at this point in the history
DD4hep: get a current node SpecPar value by name
  • Loading branch information
cmsbuild committed Sep 19, 2019
2 parents dfa1c73 + ccb3f4e commit 582a19a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion DetectorDescription/DDCMS/src/DDFilteredView.cc
Expand Up @@ -295,9 +295,21 @@ std::string_view DDFilteredView::get<string_view>(const char* key) const {
std::string_view result;
DDSpecParRefs refs;
registry_->filter(refs, key);
int level = it_.back().GetLevel();
for_each(begin(refs), end(refs), [&](auto const& i) {
auto k = find_if(begin(i->paths), end(i->paths), [&](auto const& j) {
return (compareEqual(name(), *rbegin(split(realTopName(j), "/"))));
auto const& names = split(realTopName(j), "/");
int count = names.size();
bool flag = false;
for (int nit = level; count > 0 && nit > 0; --nit) {
if (!compareEqual(noNamespace(it_.back().GetNode(nit)->GetVolume()->GetName()), names[--count])) {
flag = false;
break;
} else {
flag = true;
}
}
return flag;
});
if (k != end(i->paths)) {
result = i->strValue(key);
Expand Down

0 comments on commit 582a19a

Please sign in to comment.