Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Detector/DetComponents/src/GeoSvc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ StatusCode GeoSvc::buildDD4HepGeo() {
}

dd4hep::Detector* GeoSvc::getDetector() { return m_dd4hepgeo; }
const dd4hep::Detector* GeoSvc::getDetector() const { return m_dd4hepgeo; }

dd4hep::DetElement GeoSvc::getDD4HepGeo() { return m_dd4hepgeo->world(); }

Expand All @@ -93,6 +94,12 @@ StatusCode GeoSvc::buildGeant4Geo() {

G4VUserDetectorConstruction* GeoSvc::getGeant4Geo() { return m_geant4geo.get(); }

std::string GeoSvc::constantAsString(const std::string& name) { return m_dd4hepgeo->constantAsString(name); }
std::string GeoSvc::constantAsString(std::string const& name) {
return m_dd4hepgeo->constantAsString(name);
}
std::string GeoSvc::constantAsString(std::string const& name) const {
return m_dd4hepgeo->constantAsString(name);
}


DECLARE_COMPONENT(GeoSvc)
10 changes: 6 additions & 4 deletions Detector/DetComponents/src/GeoSvc.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ class GeoSvc : public extends<Service, IGeoSvc> {
// This function generates the Geant4 geometry
StatusCode buildGeant4Geo();
// receive DD4hep Geometry
virtual dd4hep::DetElement getDD4HepGeo() override;
virtual dd4hep::Detector* getDetector() override;
virtual std::string constantAsString(std::string const& name) override;
virtual dd4hep::DetElement getDD4HepGeo();
virtual dd4hep::Detector* getDetector();
virtual const dd4hep::Detector* getDetector() const;
virtual std::string constantAsString(std::string const& name);
virtual std::string constantAsString(std::string const& name) const;
// receive Geant4 Geometry
virtual G4VUserDetectorConstruction* getGeant4Geo() override;
virtual G4VUserDetectorConstruction* getGeant4Geo();

private:
// Pointer to the interface to the DD4hep geometry
Expand Down
2 changes: 1 addition & 1 deletion SimG4Components/src/SimG4MagneticFieldTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ StatusCode SimG4MagneticFieldTool::initialize() {
}

info() << "Adding following field(s):" << endmsg;
dd4hep::Detector* detDescription = m_geoSvc->getDetector();
const dd4hep::Detector* detDescription = m_geoSvc->getDetector();
auto fields = detDescription->fields();
for (const auto& field : fields) {
info() << " - " << field.first << ": " << field.second->type << endmsg;
Expand Down