Skip to content

Commit

Permalink
Merge pull request #32612 from ghugo83/fix_sensitive
Browse files Browse the repository at this point in the history
Fix ProdCuts and Sensitive detectors lists creation in DD4hep workflow
  • Loading branch information
cmsbuild committed Jan 9, 2021
2 parents 8fdbde5 + 2d53061 commit f6665b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc
Expand Up @@ -48,7 +48,8 @@ G4VPhysicalVolume *DDG4Builder::BuildGeometry(SensitiveDetectorCatalog &catalog)
for (auto const &it : map_) {
for (auto const &fit : specs) {
for (auto const &pit : fit.second->paths) {
if (dd4hep::dd::compareEqualName(dd4hep::dd::realTopName(pit), dd4hep::dd::noNamespace(it.first.name()))) {
if (dd4hep::dd::compareEqualName(dd4hep::dd::noNamespace(dd4hep::dd::realTopName(pit)),
dd4hep::dd::noNamespace(it.first.name()))) {
dd4hepVec.emplace_back(&*it.second, &*fit.second);
}
}
Expand Down
4 changes: 2 additions & 2 deletions SimG4Core/Geometry/src/DDG4ProductionCuts.cc
Expand Up @@ -115,11 +115,11 @@ void DDG4ProductionCuts::dd4hepInitialize() {
for (auto const& it : *dd4hepMap_) {
for (auto const& fit : specs) {
for (auto const& pit : fit.second->paths) {
const std::string_view selection = dd4hep::dd::realTopName(pit);
const std::string_view selection = dd4hep::dd::noNamespace(dd4hep::dd::realTopName(pit));
const std::string_view name = dd4hep::dd::noNamespace(it.first.name());
if (!(dd4hep::dd::isRegex(selection))
? dd4hep::dd::compareEqual(name, selection)
: std::regex_match(name.begin(), name.end(), std::regex(std::string(selection)))) {
: std::regex_match(name.begin(), name.end(), std::regex(selection.begin(), selection.end()))) {
dd4hepVec_.emplace_back(std::make_pair<G4LogicalVolume*, const dd4hep::SpecPar*>(&*it.second, &*fit.second));
}
}
Expand Down

0 comments on commit f6665b9

Please sign in to comment.