CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
cms::DDG4Builder Class Reference

#include <DD4hep_DDG4Builder.h>

Public Member Functions

G4VPhysicalVolume * BuildGeometry (SensitiveDetectorCatalog &)
 
 DDG4Builder (const cms::DDCompactView *, dd4hep::sim::Geant4GeometryMaps::VolumeMap &, bool check)
 

Private Attributes

bool check_
 
const cms::DDCompactViewcompactView_
 
dd4hep::sim::Geant4GeometryMaps::VolumeMap & map_
 

Detailed Description

Definition at line 23 of file DD4hep_DDG4Builder.h.

Constructor & Destructor Documentation

◆ DDG4Builder()

DDG4Builder::DDG4Builder ( const cms::DDCompactView cpv,
dd4hep::sim::Geant4GeometryMaps::VolumeMap &  lvmap,
bool  check 
)

Definition at line 23 of file DD4hep_DDG4Builder.cc.

24  : compactView_(cpv), map_(lvmap), check_(check) {}

Member Function Documentation

◆ BuildGeometry()

G4VPhysicalVolume * DDG4Builder::BuildGeometry ( SensitiveDetectorCatalog catalog)

Definition at line 26 of file DD4hep_DDG4Builder.cc.

26  {
27  G4ReflectionFactory *refFact = G4ReflectionFactory::Instance();
28  refFact->SetScalePrecision(100. * refFact->GetScalePrecision());
29 
30  const cms::DDDetector *det = compactView_->detector();
31 
32  DetElement world = det->description()->world();
33  const Detector &detector = *det->description();
34  Geant4Converter g4Geo(detector);
35  Geant4GeometryInfo *geometry = g4Geo.create(world).detach();
36  map_ = geometry->g4Volumes;
37 
38  std::vector<std::pair<G4LogicalVolume *, const cms::DDSpecPar *>> dd4hepVec;
39  const cms::DDSpecParRegistry &specPars = det->specpars();
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);
47  }
48  }
49  }
50  }
51 
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);
57 
58  edm::LogVerbatim("SimG4CoreApplication")
59  << " DDG4SensitiveConverter: Sensitive " << fff << " Class Name " << sClassName << " ROU Name " << sROUName;
60  }
61 
62  return geometry->world();
63 }

References getEcalConditions_orcoffint2r_cff::catalog, compactView_, cms::dd::compareEqual(), cms::DDDetector::description(), hgcalTestNeighbor_cfi::detector, cms::DDCompactView::detector(), align::Detector, cms::DDSpecParRegistry::filter(), map_, cms::dd::noNamespace(), cms::dd::realTopName(), cms::DDDetector::specpars(), and HistogramManager_cfi::specs.

Referenced by DDDWorld::DDDWorld().

Member Data Documentation

◆ check_

bool cms::DDG4Builder::check_
private

Definition at line 31 of file DD4hep_DDG4Builder.h.

◆ compactView_

const cms::DDCompactView* cms::DDG4Builder::compactView_
private

Definition at line 29 of file DD4hep_DDG4Builder.h.

Referenced by BuildGeometry().

◆ map_

dd4hep::sim::Geant4GeometryMaps::VolumeMap& cms::DDG4Builder::map_
private

Definition at line 30 of file DD4hep_DDG4Builder.h.

Referenced by BuildGeometry().

cms::dd::realTopName
std::string_view realTopName(std::string_view)
cms::DDDetector::specpars
DDSpecParRegistry const & specpars() const
Definition: DDDetector.h:26
cms::DDG4Builder::compactView_
const cms::DDCompactView * compactView_
Definition: DD4hep_DDG4Builder.h:29
getEcalConditions_orcoffint2r_cff.catalog
catalog
Definition: getEcalConditions_orcoffint2r_cff.py:40
geometry
Definition: geometry.py:1
HistogramManager_cfi.specs
specs
Definition: HistogramManager_cfi.py:80
cms::DDSpecParRegistry
Definition: DDSpecParRegistry.h:32
RPCNoise_example.check
check
Definition: RPCNoise_example.py:71
cms::dd::noNamespace
std::string_view noNamespace(std::string_view)
Definition: Filter.cc:63
cms::DDDetector::description
Detector const * description() const
Definition: DDDetector.h:46
cms::DDSpecParRefs
std::vector< const DDSpecPar * > DDSpecParRefs
Definition: DDSpecParRegistry.h:30
edm::LogVerbatim
Definition: MessageLogger.h:297
cms::dd::compareEqual
bool compareEqual(std::string_view, std::string_view)
cms::DDG4Builder::check_
bool check_
Definition: DD4hep_DDG4Builder.h:31
align::Detector
Definition: StructureType.h:86
cms::DDSpecParRegistry::filter
void filter(DDSpecParRefs &, const std::string &, const std::string &="") const
Definition: DDSpecparRegistry.cc:98
cms::DDDetector
Definition: DDDetector.h:11
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
cms::DDG4Builder::map_
dd4hep::sim::Geant4GeometryMaps::VolumeMap & map_
Definition: DD4hep_DDG4Builder.h:30
cms::DDCompactView::detector
const cms::DDDetector * detector() const
Definition: DDCompactView.h:32
fit
Definition: CombinedChiSquaredLikelihood.h:6