** Warning **
Issuing rollback() due to DESTROY without explicit disconnect() of DBD::mysql::db handle dbname=lxr_eic at /usr/local/share/lxr/lxr-2.3.7/lib/LXR/Common.pm line 1161, <GEN11> line 1.
Last-Modified: Fri, 16 Oct 2025 09:16:38 GMT
Content-Type: text/html; charset=utf-8
/master/include/geocel/vg/VecgeomParams.hh
File indexing completed on 2025-10-16 08:55:23
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include <string>
0010 #include <unordered_map>
0011 #include <vector>
0012
0013 #include "corecel/Types.hh "
0014 #include "corecel/cont/LabelIdMultiMap.hh "
0015 #include "corecel/data/ParamsDataInterface.hh "
0016 #include "geocel/BoundingBox.hh "
0017 #include "geocel/GeoParamsInterface.hh "
0018 #include "geocel/Types.hh "
0019
0020 #include "VecgeomData.hh "
0021
0022 class G4VPhysicalVolume ;
0023
0024 namespace celeritas
0025 {
0026
0027
0028
0029
0030
0031
0032 class VecgeomParams final : public GeoParamsInterface ,
0033 public ParamsDataInterface <VecgeomParamsData >
0034 {
0035 public :
0036
0037 static bool use_surface_tracking ();
0038
0039
0040 static bool use_vgdml ();
0041
0042
0043 explicit VecgeomParams (std ::string const & gdml_filename);
0044
0045
0046 explicit VecgeomParams (G4VPhysicalVolume const * world );
0047
0048
0049 ~VecgeomParams () final ;
0050
0051
0052 bool supports_safety () const final { return true ; }
0053
0054
0055 BBox const & bbox () const final { return bbox_ ; }
0056
0057
0058 LevelId ::size_type max_depth () const final { return host_ref_ .max_depth ; }
0059
0060
0061
0062
0063 inline VolumeMap const & volumes () const final ;
0064
0065
0066 inline VolInstanceMap const & volume_instances () const final ;
0067
0068
0069 VolumeId find_volume (G4LogicalVolume const * volume ) const final ;
0070
0071
0072 GeantPhysicalInstance id_to_geant (VolumeInstanceId vol_id ) const final ;
0073
0074
0075 using GeoParamsInterface ::find_volume ;
0076
0077
0078
0079
0080 HostRef const & host_ref () const final { return host_ref_ ; }
0081
0082
0083 DeviceRef const & device_ref () const final { return device_ref_ ; }
0084
0085 private :
0086
0087
0088
0089 LabelIdMultiMap <VolumeId > volumes_ ;
0090 VolInstanceMap vol_instances_ ;
0091 std ::unordered_map <G4LogicalVolume const *, VolumeId > g4log_volid_map_ ;
0092 std ::vector <G4VPhysicalVolume const *> g4_pv_map_ ;
0093
0094 BBox bbox_ ;
0095
0096
0097 HostRef host_ref_ ;
0098 DeviceRef device_ref_ ;
0099
0100
0101 bool loaded_geant4_gdml_ {false };
0102
0103
0104
0105
0106 void build_volumes_vgdml (std ::string const & filename );
0107 void build_volumes_geant4 (G4VPhysicalVolume const * world );
0108 void build_tracking ();
0109 void build_surface_tracking ();
0110 void build_volume_tracking ();
0111
0112
0113 void build_data ();
0114
0115 void build_metadata ();
0116 };
0117
0118
0119
0120
0121
0122 auto VecgeomParams ::volumes () const -> VolumeMap const &
0123 {
0124 return volumes_ ;
0125 }
0126
0127
0128
0129
0130
0131
0132
0133 auto VecgeomParams ::volume_instances () const -> VolInstanceMap const &
0134 {
0135 return vol_instances_ ;
0136 }
0137
0138
0139 }