5#include "k4Interface/IGeoSvc.h"
8#include "GaudiKernel/IIncidentListener.h"
9#include "GaudiKernel/IIncidentSvc.h"
10#include "GaudiKernel/Incident.h"
11#include "GaudiKernel/MsgStream.h"
12#include "GaudiKernel/Service.h"
13#include "GaudiKernel/ServiceHandle.h"
16#include "DD4hep/Detector.h"
19#include "G4RunManager.hh"
20#include "G4VUserDetectorConstruction.hh"
22class GeoSvc :
public extends<Service, IGeoSvc> {
26 GeoSvc(
const std::string& name, ISvcLocator* svc);
43 virtual G4VUserDetectorConstruction*
getGeant4Geo()
override;
51 Gaudi::Property<std::vector<std::string>>
m_xmlFileNames{
this,
"detectors", {},
"Detector descriptions XML-files"};
53 Gaudi::Property<std::map<std::string, std::string>>
m_sensitive_types{
this,
"sensitiveTypes", {{
"tracker",
"SimpleTrackerSD"}, {
"calorimeter",
"SimpleCalorimeterSD"}}};
55 Gaudi::Property<bool>
m_buildGeant4Geo{
this,
"EnableGeant4Geo",
true,
"If True the DD4hep geometry is converted for Geant4 Simulations"};
Gaudi::Property< std::map< std::string, std::string > > m_sensitive_types
mapping of sensitive detector names
Definition GeoSvc.h:53
GeoSvc(const std::string &name, ISvcLocator *svc)
Default constructor.
Definition GeoSvc.cpp:13
StatusCode buildGeant4Geo()
This function generates the Geant4 geometry.
Definition GeoSvc.cpp:91
virtual std::string constantAsString(std::string const &name) override
Definition GeoSvc.cpp:105
virtual StatusCode finalize() final
Finalize function.
Definition GeoSvc.cpp:63
virtual dd4hep::DetElement getDD4HepGeo() override
Definition GeoSvc.cpp:89
Gaudi::Property< std::vector< std::string > > m_xmlFileNames
XML-files with the detector description.
Definition GeoSvc.h:51
StatusCode buildDD4HepGeo()
This function generates the DD4hep geometry.
Definition GeoSvc.cpp:65
virtual dd4hep::Detector * getDetector() override
Definition GeoSvc.cpp:87
dd4hep::Detector * m_dd4hepgeo
Pointer to the interface to the DD4hep geometry.
Definition GeoSvc.h:47
virtual StatusCode initialize() final
Initialize function.
Definition GeoSvc.cpp:22
Gaudi::Property< bool > m_buildGeant4Geo
Whether to create the geant4 geometry or not.
Definition GeoSvc.h:55
virtual G4VUserDetectorConstruction * getGeant4Geo() override
Definition GeoSvc.cpp:103
std::shared_ptr< G4VUserDetectorConstruction > m_geant4geo
Pointer to the detector construction of DDG4.
Definition GeoSvc.h:49
virtual ~GeoSvc()
Destructor.
Definition GeoSvc.cpp:16