ATLAS Offline Software
Geo2G4Builder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GEO2G4_GEO2G4BUILDER_H
6 #define GEO2G4_GEO2G4BUILDER_H
7 
13 #include "G4LogicalVolume.hh"
14 #include "VolumeBuilder.h"
15 
16 #include "GaudiKernel/ServiceHandle.h"
18 
20 #include "GeoModelKernel/GeoVPhysVol.h"
21 #include "GeoModelKernel/GeoDefinitions.h"
24 
25 // STL includes
26 #include <string>
27 #include <vector>
28 
29 class GeoMaterial;
30 class StoreGateSvc;
31 class GeoModelExperiment;
32 
33 class Geo2G4Builder : public AthMessaging {
34 
35 public:
36  // Constructor:
37  Geo2G4Builder(const std::string& detectorName);
38  // Destructor:
39  ~Geo2G4Builder() = default;
40 
41  // Build method - geometry
42  G4LogicalVolume* BuildTree();
43 
44  // Build method - optical surfaces
45  void BuildOpticalSurfaces(const GeoBorderSurfaceContainer* surface_container,
46  const OpticalVolumesMap* optical_volumes);
47 
48  // Access volume builder:
49  VolumeBuilder* GetVolumeBuilder(std::string);
50 
52 
53 private:
54 
55  // GeoVDetectorManager* theDetectorElement;
56  std::string m_detectorName;
58  std::vector<PVConstLink> m_treeTops;
60 
61  // std::Air in the case when top boolean envelope has to be built
62  const GeoMaterial* m_matAir{nullptr};
63  ServiceHandle<StoreGateSvc> m_pDetStore{"DetectorStore", "Geo2G4Builder"};
64  ServiceHandle<IGeo2G4Svc> m_g2gSvc{"Geo2G4Svc", "Geo2G4Builder"};
66 };
67 
68 #endif
Geo2G4Builder::m_treeTops
std::vector< PVConstLink > m_treeTops
Definition: Geo2G4Builder.h:58
Geo2G4Builder::m_matAir
const GeoMaterial * m_matAir
Definition: Geo2G4Builder.h:62
Geo2G4Builder::m_g2gSvc
ServiceHandle< IGeo2G4Svc > m_g2gSvc
Definition: Geo2G4Builder.h:64
VolumeBuilder
Definition: Simulation/G4Utilities/Geo2G4/src/VolumeBuilder.h:20
GeoModelExperiment
Definition: GeoModelExperiment.h:32
Geo2G4Builder
Main builder to create/position all volumes described in a GeoModel Tree.
Definition: Geo2G4Builder.h:33
OpticalVolumesMap
std::map< const GeoOpticalPhysVol *, G4VPhysicalVolume *, std::less< const GeoOpticalPhysVol * > > OpticalVolumesMap
Definition: Simulation/G4Utilities/Geo2G4/src/VolumeBuilder.h:17
Geo2G4Builder::BuildOpticalSurfaces
void BuildOpticalSurfaces(const GeoBorderSurfaceContainer *surface_container, const OpticalVolumesMap *optical_volumes)
Definition: Geo2G4Builder.cxx:173
GeoBorderSurfaceContainer.h
Geo2G4Builder::m_motherTransform
GeoTrf::Transform3D m_motherTransform
Definition: Geo2G4Builder.h:57
Geo2G4Builder::GetDetectorTransform
HepGeom::Transform3D GetDetectorTransform()
Definition: Geo2G4Builder.h:51
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Geo2G4Builder::BuildTree
G4LogicalVolume * BuildTree()
Definition: Geo2G4Builder.cxx:84
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
CLHEPtoEigenConverter.h
Geo2G4Builder::~Geo2G4Builder
~Geo2G4Builder()=default
Geo2G4Builder::m_pDetStore
ServiceHandle< StoreGateSvc > m_pDetStore
Definition: Geo2G4Builder.h:63
IGeo2G4Svc.h
VolumeBuilder.h
GeoBorderSurfaceContainer
std::vector< GeoBorderSurface > GeoBorderSurfaceContainer
Definition: GeoBorderSurfaceContainer.h:12
AthMessaging.h
Amg::EigenTransformToCLHEP
HepGeom::Transform3D EigenTransformToCLHEP(const Amg::Transform3D &eigenTransf)
Converts an Eigen-based Amg::Transform3D into a CLHEP-based HepGeom::Transform3D.
Definition: CLHEPtoEigenConverter.h:120
Geo2G4Builder::Geo2G4Builder
Geo2G4Builder(const std::string &detectorName)
Definition: Geo2G4Builder.cxx:32
Geo2G4Builder::GetVolumeBuilder
VolumeBuilder * GetVolumeBuilder(std::string)
Definition: Geo2G4Builder.cxx:167
Geo2G4Builder::m_theExpt
GeoModelExperiment * m_theExpt
Definition: Geo2G4Builder.h:65
Geo2G4Builder::m_theBuilder
VolumeBuilder * m_theBuilder
Definition: Geo2G4Builder.h:59
ServiceHandle< StoreGateSvc >
Geo2G4Builder::m_detectorName
std::string m_detectorName
Definition: Geo2G4Builder.h:56