Skip to content

Commit

Permalink
Merge pull request #31949 from ianna/dd4hep-sim-tracker-sd-v1
Browse files Browse the repository at this point in the history
[DD4hep] No Namespace in MuonG4Numbering nor in Tracker SD
  • Loading branch information
cmsbuild committed Oct 28, 2020
2 parents 936e677 + 401af50 commit 8a60385
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion SimG4CMS/Muon/src/MuonG4Numbering.cc
Expand Up @@ -4,6 +4,7 @@
#include "Geometry/MuonNumbering/interface/MuonGeometryConstants.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "DD4hep/Filter.h"
#include "G4VPhysicalVolume.hh"
#include "G4VTouchable.hh"
#include "G4Step.hh"
Expand Down Expand Up @@ -52,7 +53,7 @@ MuonBaseNumber MuonG4Numbering::PhysicalVolumeToBaseNumber(const G4Step* aStep)
int copyno = vol->GetCopyNo();
int extra(0);
if (dd4hep_ && (offMap_ != nullptr)) {
std::string namx = static_cast<std::string>(vol->GetName());
std::string namx = static_cast<std::string>(dd4hep::dd::noNamespace(vol->GetName()));
std::size_t last = namx.rfind('_');
std::string name = ((last == std::string::npos) ? namx : (namx.substr(0, last)));
auto itr = offMap_->muonMap_.find(name);
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc
Expand Up @@ -2,7 +2,7 @@
#include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"

#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "DD4hep/Filter.h"
#include "G4TransportationManager.hh"
#include "G4Navigator.hh"
#include "G4VTouchable.hh"
Expand Down Expand Up @@ -62,7 +62,7 @@ void TrackerG4SimHitNumberingScheme::touchToNavStory(const G4VTouchable* v,
int levels = v->GetHistoryDepth();

for (int k = 0; k <= levels; ++k) {
if (v->GetVolume(k)->GetLogicalVolume()->GetName() != "TOBInactive") {
if (dd4hep::dd::noNamespace(v->GetVolume(k)->GetLogicalVolume()->GetName()) != "TOBInactive") {
st.emplace_back(
std::pair<int, std::string>(v->GetVolume(k)->GetCopyNo(), v->GetVolume(k)->GetLogicalVolume()->GetName()));
#ifdef DEBUG
Expand Down

0 comments on commit 8a60385

Please sign in to comment.