File indexing completed on 2025-09-18 09:09:03
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include <vector>
0010
0011 #include "corecel/Config.hh"
0012
0013 #include "corecel/io/Label.hh"
0014 #include "geocel/GeoParamsInterface.hh"
0015 #include "celeritas/Types.hh"
0016
0017
0018 class G4VPhysicalVolume;
0019 class G4LogicalVolume;
0020
0021 namespace celeritas
0022 {
0023
0024
0025
0026
0027 class GeantVolumeMapper
0028 {
0029 public:
0030
0031 explicit GeantVolumeMapper(GeoParamsInterface const& tgt);
0032
0033
0034 GeantVolumeMapper(G4VPhysicalVolume const& world,
0035 GeoParamsInterface const& tgt);
0036
0037
0038 VolumeId operator()(G4LogicalVolume const&);
0039
0040 private:
0041 G4VPhysicalVolume const* world_;
0042 GeoParamsInterface const& geo_;
0043 std::vector<Label> labels_;
0044 };
0045
0046 #if !CELERITAS_USE_GEANT4
0047 inline GeantVolumeMapper::GeantVolumeMapper(GeoParamsInterface const& geo)
0048 : geo_{geo}
0049 {
0050 CELER_DISCARD(labels_);
0051 CELER_DISCARD(world_);
0052 CELER_DISCARD(geo_);
0053 CELER_NOT_CONFIGURED("Geant4");
0054 }
0055
0056 inline GeantVolumeMapper::GeantVolumeMapper(G4VPhysicalVolume const&,
0057 GeoParamsInterface const& geo)
0058 : geo_{geo}
0059 {
0060 CELER_NOT_CONFIGURED("Geant4");
0061 }
0062
0063 inline VolumeId GeantVolumeMapper::operator()(G4LogicalVolume const&)
0064 {
0065 CELER_ASSERT_UNREACHABLE();
0066 }
0067 #endif
0068
0069
0070 }