File indexing completed on 2025-01-18 09:59:35
0001
0002
0003
0004
0005
0006
0007
0008 #pragma once
0009
0010 #include <iosfwd>
0011 #include <string>
0012 #include <unordered_set>
0013
0014 #include "corecel/Config.hh"
0015
0016 #include "corecel/Assert.hh"
0017 #include "corecel/cont/Span.hh"
0018
0019
0020
0021 class G4LogicalVolume;
0022 class G4VPhysicalVolume;
0023 class G4Navigator;
0024
0025 #if CELERITAS_GEANT4_VERSION >= 0x0b0200
0026
0027 class G4TouchableHistory;
0028 #else
0029 class G4VTouchable;
0030 #endif
0031
0032 namespace celeritas
0033 {
0034
0035 #if CELERITAS_GEANT4_VERSION >= 0x0b0200
0036
0037 using GeantTouchableBase = G4TouchableHistory;
0038 #else
0039 using GeantTouchableBase = G4VTouchable;
0040 #endif
0041
0042
0043
0044 struct PrintableNavHistory
0045 {
0046 GeantTouchableBase const* touch{nullptr};
0047 };
0048
0049
0050
0051 struct PrintableLV
0052 {
0053 G4LogicalVolume const* lv{nullptr};
0054 };
0055
0056
0057 std::ostream& operator<<(std::ostream& os, PrintableNavHistory const& pnh);
0058
0059
0060 std::ostream& operator<<(std::ostream& os, PrintableLV const& pnh);
0061
0062
0063
0064
0065
0066 G4VPhysicalVolume* load_geant_geometry(std::string const& gdml_filename);
0067
0068
0069 G4VPhysicalVolume* load_geant_geometry_native(std::string const& gdml_filename);
0070
0071
0072
0073 void reset_geant_geometry();
0074
0075
0076
0077 Span<G4LogicalVolume*> geant_logical_volumes();
0078
0079
0080
0081 std::unordered_set<G4LogicalVolume const*>
0082 find_geant_volumes(std::unordered_set<std::string>);
0083
0084
0085
0086 std::string make_gdml_name(G4LogicalVolume const&);
0087
0088
0089
0090
0091 #if !CELERITAS_USE_GEANT4
0092 inline G4VPhysicalVolume* load_geant_geometry(std::string const&)
0093 {
0094 CELER_NOT_CONFIGURED("Geant4");
0095 }
0096
0097 inline G4VPhysicalVolume* load_geant_geometry_native(std::string const&)
0098 {
0099 CELER_NOT_CONFIGURED("Geant4");
0100 }
0101
0102 inline void reset_geant_geometry()
0103 {
0104 CELER_NOT_CONFIGURED("Geant4");
0105 }
0106
0107 inline Span<G4LogicalVolume*> geant_logical_volumes()
0108 {
0109 CELER_NOT_CONFIGURED("Geant4");
0110 }
0111
0112 inline std::unordered_set<G4LogicalVolume const*>
0113 find_geant_volumes(std::unordered_set<std::string>)
0114 {
0115 CELER_NOT_CONFIGURED("Geant4");
0116 }
0117
0118 inline std::string make_gdml_name(G4LogicalVolume const&)
0119 {
0120 CELER_NOT_CONFIGURED("Geant4");
0121 }
0122 #endif
0123
0124
0125 }