9 #include "DDG4/Geant4Converter.h" 10 #include "DDG4/Geant4GeometryInfo.h" 11 #include "DDG4/Geant4Mapping.h" 12 #include "DD4hep/Detector.h" 14 #include "G4LogicalVolume.hh" 15 #include "G4ReflectionFactory.hh" 24 : compactView_(cpv), map_(lvmap), check_(check) {}
27 G4ReflectionFactory *refFact = G4ReflectionFactory::Instance();
28 refFact->SetScalePrecision(100. * refFact->GetScalePrecision());
34 Geant4Converter g4Geo(detector);
35 Geant4GeometryInfo *
geometry = g4Geo.create(world).detach();
36 map_ = geometry->g4Volumes;
38 std::vector<std::pair<G4LogicalVolume *, const cms::DDSpecPar *>> dd4hepVec;
41 specPars.
filter(specs,
"SensitiveDetector");
42 for (
auto const &it :
map_) {
43 for (
auto const &
fit : specs) {
44 for (
auto const &pit :
fit->paths) {
46 dd4hepVec.emplace_back(&*it.second, &*
fit);
52 for (
auto const &it : dd4hepVec) {
53 auto sClassName = it.second->strValue(
"SensitiveDetector");
54 auto sROUName = it.second->strValue(
"ReadOutName");
55 auto fff = it.first->GetName();
56 catalog.
insert({sClassName.data(), sClassName.size()}, {sROUName.data(), sROUName.size()}, fff);
59 <<
" DDG4SensitiveConverter: Sensitive " << fff <<
" Class Name " << sClassName <<
" ROU Name " << sROUName;
62 return geometry->world();
std::string_view realTopName(std::string_view)
DDSpecParRegistry const & specpars() const
void filter(DDSpecParRefs &, std::string_view, std::string_view) const
std::string_view noNamespace(std::string_view)
void insert(const std::string &, const std::string &, const std::string &)
dd4hep::sim::Geant4GeometryMaps::VolumeMap & map_
DDG4Builder(const cms::DDCompactView *, dd4hep::sim::Geant4GeometryMaps::VolumeMap &, bool check)
G4VPhysicalVolume * BuildGeometry(SensitiveDetectorCatalog &)
Namespace of DDCMS conversion namespace.
bool compareEqual(std::string_view, std::string_view)
std::vector< const DDSpecPar * > DDSpecParRefs
const cms::DDCompactView * compactView_
Detector const * description() const
const cms::DDDetector * detector() const