23 #include "G4VPhysicalVolume.hh"
28 -> std::tuple<DetectorPtr, ContextDecorators, DetectorElements> {
29 if (
cfg.g4World ==
nullptr) {
30 throw std::invalid_argument(
31 "Geant4Detector: no world Geant4 volume provided");
34 ACTS_INFO(
"Building an Acts::Detector called '"
35 <<
cfg.name <<
"' from the Geant4PhysVolume '"
36 <<
cfg.g4World->GetName());
41 auto [surfaces, elements] = convertGeant4Volumes(
cfg,
logger);
43 return std::tie(detector, decorators, elements);
49 -> std::tuple<TrackingGeometryPtr, ContextDecorators, DetectorElements> {
50 if (
cfg.g4World ==
nullptr) {
51 throw std::invalid_argument(
52 "Geant4Detector: no world Geant4 volume provided");
55 ACTS_INFO(
"Building an Acts::TrackingGeometry called '"
56 <<
cfg.name <<
"' from the Geant4PhysVolume '"
57 <<
cfg.g4World->GetName());
61 auto [surfaces, elements] = convertGeant4Volumes(
cfg,
logger);
64 auto surfaceArrayCreator = std::make_shared<const Acts::SurfaceArrayCreator>(
69 auto layerCreator = std::make_shared<Acts::LayerCreator>(
73 auto layerArrayCreator = std::make_shared<const Acts::LayerArrayCreator>(
77 auto tVolumeArrayCreator =
78 std::make_shared<const Acts::TrackingVolumeArrayCreator>(
79 tvacConfig,
logger.
clone(
"TrackingVolumeArrayCreator"));
83 cvhConfig.trackingVolumeArrayCreator = tVolumeArrayCreator;
84 auto cylinderVolumeHelper =
85 std::make_shared<const Acts::CylinderVolumeHelper>(
91 kdtCfg.layerCreator = layerCreator;
92 kdtCfg.trackingVolumeHelper = cylinderVolumeHelper;
93 kdtCfg.protoDetector =
cfg.protoDetector;
94 kdtCfg.geometryIdentifierHook =
cfg.geometryIdentifierHook;
98 kdtCfg,
logger.
clone(
"KDTreeTrackingGeometryBuilder"));
103 return std::tie(trackingGeometry, decorators, elements);
112 G4Transform3D g4ToWorld;
115 g4SurfaceCache, g4ToWorld, *
cfg.g4World,
cfg.g4SurfaceOptions);
118 <<
" matching Geant4 Physical volumes.");
120 <<
" converted sensitive Geant4 Physical volumes.");
122 <<
" converted passive Geant4 Physical volumes.");
124 <<
" converted Geant4 Material slabs.");
136 elements.push_back(
e);
137 surfaces.push_back(
s);
140 surfaces.insert(surfaces.end(), g4SurfaceCache.
passiveSurfaces.begin(),
143 return std::tie(surfaces, elements);