Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Geant4Detector.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Geant4Detector.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2022-2023 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
15 
16 #include <memory>
17 #include <string>
18 #include <tuple>
19 #include <vector>
20 
21 class G4VPhysicalVolume;
22 
23 namespace Acts {
24 class TrackingGeometry;
25 class Geant4DetectorElement;
26 class Surface;
27 
28 namespace Experimental {
29 class Detector;
30 }
31 } // namespace Acts
32 
33 namespace ActsExamples {
34 class IContextDecorator;
35 
36 namespace Geant4 {
37 
39  using DetectorElements =
40  std::vector<std::shared_ptr<Acts::Geant4DetectorElement>>;
41  using DetectorPtr = std::shared_ptr<Acts::Experimental::Detector>;
42  using Surfaces = std::vector<std::shared_ptr<Acts::Surface>>;
43 
44  using ContextDecorators =
45  std::vector<std::shared_ptr<ActsExamples::IContextDecorator>>;
46  using TrackingGeometryPtr = std::shared_ptr<const Acts::TrackingGeometry>;
47 
49  struct Config {
53  const G4VPhysicalVolume* g4World = nullptr;
59  std::shared_ptr<const Acts::GeometryIdentifierHook> geometryIdentifierHook =
60  std::make_shared<Acts::GeometryIdentifierHook>();
63  };
64 
69  std::tuple<DetectorPtr, ContextDecorators, DetectorElements>
71 
79  std::tuple<TrackingGeometryPtr, ContextDecorators, DetectorElements>
81 
82  private:
89  std::tuple<Surfaces, DetectorElements> convertGeant4Volumes(
90  const Config& cfg, const Acts::Logger& logger) const;
91 };
92 
93 } // namespace Geant4
94 } // namespace ActsExamples