Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Geant4DetectorSurfaceFactory.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Geant4DetectorSurfaceFactory.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2022 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 <cstddef>
17 #include <memory>
18 #include <tuple>
19 #include <vector>
20 
21 #include "G4Transform3D.hh"
22 
23 class G4VPhysicalVolume;
24 
25 namespace Acts {
26 
27 class Geant4DetectorElement;
28 class IGeant4PhysicalVolumeSelector;
29 class Surface;
30 
35  public:
38  struct Config {};
39 
40  // Collect the sensitive surfaces
42  std::tuple<std::shared_ptr<Geant4DetectorElement>,
43  std::shared_ptr<Surface>>;
44 
45  // Collect the passive surfaces
46  using Geant4PassiveSurface = std::shared_ptr<Surface>;
47 
49  struct Cache {
51  std::vector<Geant4SensitiveSurface> sensitiveSurfaces;
53  std::vector<Geant4PassiveSurface> passiveSurfaces;
55  std::size_t matchedG4Volumes = 0;
57  std::size_t convertedSurfaces = 0;
59  std::size_t convertedMaterials = 0;
60  };
61 
63  struct Options {
67  bool convertMaterial = true;
71  std::shared_ptr<IGeant4PhysicalVolumeSelector> sensitiveSurfaceSelector =
72  nullptr;
74  std::shared_ptr<IGeant4PhysicalVolumeSelector> passiveSurfaceSelector =
75  nullptr;
76  };
77 
81  Geant4DetectorSurfaceFactory() = default;
82 
90  void construct(Cache& cache, const G4Transform3D& g4ToGlobal,
91  const G4VPhysicalVolume& g4PhysVol, const Options& option);
92 };
93 } // namespace Acts