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();
28 virtual dd4hep::Detector* getDetector();
29 virtual const dd4hep::Detector* getDetector() const;
30 virtual std::string constantAsString(std::string const& name);
31 virtual std::string constantAsString(std::string const& name) const;
32 // receive Geant4 Geometry
33 virtual G4VUserDetectorConstruction* getGeant4Geo();
34
35private:
36 // Pointer to the interface to the DD4hep geometry
37 dd4hep::Detector* m_dd4hepgeo{nullptr};
38 // Pointer to the detector construction of DDG4
39 std::shared_ptr<G4VUserDetectorConstruction> m_geant4geo{nullptr};
40
41 Gaudi::Property<std::vector<std::string>> m_xmlFileNames{this, "detectors", {}, "Detector descriptions XML-files"};
42 Gaudi::Property<std::map<std::string, std::string>> m_sensitive_types{
43 this,
44 "sensitiveTypes",
45 {{"tracker", "Geant4tracker"},
46 {"SimpleTrackerSD", "Geant4tracker"},
47 {"calorimeter", "Geant4calorimeter"},
48 {"SimpleCalorimeterSD", "Geant4calorimeter"}}};
49 Gaudi::Property<bool> m_buildGeant4Geo{this, "EnableGeant4Geo", true,
50 "If True the DD4hep geometry is converted for Geant4 Simulations"};
51};
52
53#endif // K4SIMGEANT4_GEOSVC_H
Gaudi::Property< std::map< std::string, std::string > > m_sensitive_types
Definition GeoSvc.h:42
virtual G4VUserDetectorConstruction * getGeant4Geo()
Definition GeoSvc.cpp:95
virtual std::string constantAsString(std::string const &name)
Definition GeoSvc.cpp:97
GeoSvc(const std::string &name, ISvcLocator *svc)
Definition GeoSvc.cpp:12
StatusCode buildGeant4Geo()
Definition GeoSvc.cpp:83
virtual StatusCode finalize() final
Definition GeoSvc.cpp:55
virtual dd4hep::DetElement getDD4HepGeo()
Definition GeoSvc.cpp:81
virtual dd4hep::Detector * getDetector()
Definition GeoSvc.cpp:78
Gaudi::Property< std::vector< std::string > > m_xmlFileNames
Definition GeoSvc.h:41
StatusCode buildDD4HepGeo()
Definition GeoSvc.cpp:57
dd4hep::Detector * m_dd4hepgeo
Definition GeoSvc.h:37
virtual StatusCode initialize() final
Definition GeoSvc.cpp:14
Gaudi::Property< bool > m_buildGeant4Geo
Definition GeoSvc.h:49
std::shared_ptr< G4VUserDetectorConstruction > m_geant4geo
Definition GeoSvc.h:39
Definition GeoConstruction.h:10