k4SimGeant4
Loading...
Searching...
No Matches
GeoSvc.h
Go to the documentation of this file.
1#ifndef K4SIMGEANT4_GEOSVC_H
2#define K4SIMGEANT4_GEOSVC_H
3
4#include <Gaudi/Property.h>
5#include <GaudiKernel/Service.h>
6
7#include "k4Interface/IGeoSvc.h"
8
9namespace dd4hep {
10class Detector;
11}
12class G4VUserDetectorConstruction;
13
14class GeoSvc : public extends<Service, IGeoSvc> {
15
16public:
17 GeoSvc(const std::string& name, ISvcLocator* svc);
18
19 virtual StatusCode initialize() final;
20 virtual StatusCode finalize() final;
21
22 // This function generates the DD4hep geometry
23 StatusCode buildDD4HepGeo();
24 // This function generates the Geant4 geometry
25 StatusCode buildGeant4Geo();
26 // receive DD4hep Geometry
27 virtual dd4hep::DetElement getDD4HepGeo() override;
28 virtual dd4hep::Detector* getDetector() override;
29 virtual std::string constantAsString(std::string const& name) override;
30 // receive Geant4 Geometry
31 virtual G4VUserDetectorConstruction* getGeant4Geo() override;
32
33private:
34 // Pointer to the interface to the DD4hep geometry
35 dd4hep::Detector* m_dd4hepgeo{nullptr};
36 // Pointer to the detector construction of DDG4
37 std::shared_ptr<G4VUserDetectorConstruction> m_geant4geo{nullptr};
38
39 Gaudi::Property<std::vector<std::string>> m_xmlFileNames{this, "detectors", {}, "Detector descriptions XML-files"};
40 Gaudi::Property<std::map<std::string, std::string>> m_sensitive_types{
41 this, "sensitiveTypes", {{"tracker", "SimpleTrackerSD"}, {"calorimeter", "SimpleCalorimeterSD"}}};
42 Gaudi::Property<bool> m_buildGeant4Geo{this, "EnableGeant4Geo", true,
43 "If True the DD4hep geometry is converted for Geant4 Simulations"};
44};
45
46#endif // K4SIMGEANT4_GEOSVC_H
Definition GeoSvc.h:14
Gaudi::Property< std::map< std::string, std::string > > m_sensitive_types
Definition GeoSvc.h:40
GeoSvc(const std::string &name, ISvcLocator *svc)
Definition GeoSvc.cpp:12
StatusCode buildGeant4Geo()
Definition GeoSvc.cpp:82
virtual std::string constantAsString(std::string const &name) override
Definition GeoSvc.cpp:96
virtual StatusCode finalize() final
Definition GeoSvc.cpp:55
virtual dd4hep::DetElement getDD4HepGeo() override
Definition GeoSvc.cpp:80
Gaudi::Property< std::vector< std::string > > m_xmlFileNames
Definition GeoSvc.h:39
StatusCode buildDD4HepGeo()
Definition GeoSvc.cpp:57
virtual dd4hep::Detector * getDetector() override
Definition GeoSvc.cpp:78
dd4hep::Detector * m_dd4hepgeo
Definition GeoSvc.h:35
virtual StatusCode initialize() final
Definition GeoSvc.cpp:14
Gaudi::Property< bool > m_buildGeant4Geo
Definition GeoSvc.h:42
virtual G4VUserDetectorConstruction * getGeant4Geo() override
Definition GeoSvc.cpp:94
std::shared_ptr< G4VUserDetectorConstruction > m_geant4geo
Definition GeoSvc.h:37
Definition GeoConstruction.h:10