|
Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
|
G4PhysicalVolumeStore is a singleton class, acting as container for all physical volumes, with functionality derived from std::vector<T>. All physical volumes should be registered with G4PhysicalVolumeStore, and removed on their destruction. The underlying container initially has a capacity of 100. A map indexed by volume names is also recorded for fast search; pointers to volumes with same name are stored in buckets. More...
#include <G4PhysicalVolumeStore.hh>
Public Member Functions | |
| virtual | ~G4PhysicalVolumeStore () |
| G4PhysicalVolumeStore (const G4PhysicalVolumeStore &)=delete | |
| G4PhysicalVolumeStore & | operator= (const G4PhysicalVolumeStore &)=delete |
| G4VPhysicalVolume * | GetVolume (const G4String &name, G4bool verbose=true, G4bool reverseSearch=false) const |
| G4bool | IsMapValid () const |
| void | SetMapValid (G4bool val) |
| const std::map< G4String, std::vector< G4VPhysicalVolume * > > & | GetMap () const |
| void | UpdateMap () |
Static Public Member Functions | |
| static void | Register (G4VPhysicalVolume *pVolume) |
| static void | DeRegister (G4VPhysicalVolume *pVolume) |
| static G4PhysicalVolumeStore * | GetInstance () |
| static void | SetNotifier (G4VStoreNotifier *pNotifier) |
| static void | Clean () |
Protected Member Functions | |
| G4PhysicalVolumeStore () | |
G4PhysicalVolumeStore is a singleton class, acting as container for all physical volumes, with functionality derived from std::vector<T>. All physical volumes should be registered with G4PhysicalVolumeStore, and removed on their destruction. The underlying container initially has a capacity of 100. A map indexed by volume names is also recorded for fast search; pointers to volumes with same name are stored in buckets.
Definition at line 63 of file G4PhysicalVolumeStore.hh.
|
virtual |
Destructor: takes care to delete allocated physical volumes.
Definition at line 66 of file G4PhysicalVolumeStore.cc.
|
delete |
Copy constructor and assignment operator not allowed.
Referenced by Clean(), DeRegister(), G4PhysicalVolumeStore(), GetInstance(), GetVolume(), operator=(), and Register().
|
protected |
Protected constructor.
Definition at line 56 of file G4PhysicalVolumeStore.cc.
|
static |
Deletes all physical volumes from the store. Mother logical volumes are automatically notified and have their daughters de-registered.
Definition at line 76 of file G4PhysicalVolumeStore.cc.
Referenced by G4RunManager::ReinitializeGeometry(), and ~G4PhysicalVolumeStore().
|
static |
Removes the logical volume 'pVolume' from the collection.
Definition at line 171 of file G4PhysicalVolumeStore.cc.
Referenced by G4VPhysicalVolume::~G4VPhysicalVolume().
|
static |
Returns a pointer to the unique instance of G4PhysicalVolumeStore, creating it if necessary.
Definition at line 254 of file G4PhysicalVolumeStore.cc.
Referenced by G4AdjointCrossSurfChecker::AddanExtSurfaceOfAvolume(), G4AdjointCrossSurfChecker::AddaSphericalSurfaceWithCenterAtTheCenterOfAVolume(), Clean(), G4SPSPosDistribution::ConfineSourceToVolume(), G4AdjointPosOnPhysVolGenerator::DefinePhysicalVolume(), DeRegister(), G4GeometryWorkspace::DestroyWorkspace(), G4GDMLReadStructure::GetPhysvol(), G4tgbGeometryDumper::GetTopPhysVol(), GetVolume(), G4GeometryWorkspace::InitialisePhysicalVolumes(), Register(), G4RunManager::ReinitializeGeometry(), G4VPhysicalVolume::SetName(), SetNotifier(), G4VViewer::SetTouchable(), G4ScoringRealWorld::SetupGeometry(), G4RegionStore::SetWorldVolume(), G4GDMLRead::StripNames(), UpdateMap(), and G4PhysicalVolumeModel::Validate().
|
inline |
Return the internal map.
Definition at line 127 of file G4PhysicalVolumeStore.hh.
| G4VPhysicalVolume * G4PhysicalVolumeStore::GetVolume | ( | const G4String & | name, |
| G4bool | verbose = true, | ||
| G4bool | reverseSearch = false ) const |
Returns a pointer to the first or last volume in the collection having that 'name'. Uses the internal map for fast search and warns if a volume in the collection is not unique or not found.
| [in] | name | The name of the volume to search. |
| [in] | verbose | Flag for enabling verbosity (default true). |
| [in] | reverseSearch | Flag to enable inverse search (default false). |
Definition at line 215 of file G4PhysicalVolumeStore.cc.
Referenced by G4AdjointCrossSurfChecker::AddanExtSurfaceOfAvolume(), G4AdjointCrossSurfChecker::AddaSphericalSurfaceWithCenterAtTheCenterOfAVolume(), G4SPSPosDistribution::ConfineSourceToVolume(), and G4GDMLReadStructure::GetPhysvol().
|
inline |
Accessor and modifier to assess validity of the internal map.
Definition at line 120 of file G4PhysicalVolumeStore.hh.
|
delete |
|
static |
Adds the logical volume 'pVolume' to the collection.
Definition at line 147 of file G4PhysicalVolumeStore.cc.
Referenced by G4VPhysicalVolume::G4VPhysicalVolume(), and G4VPhysicalVolume::G4VPhysicalVolume().
|
inline |
Definition at line 121 of file G4PhysicalVolumeStore.hh.
Referenced by G4VPhysicalVolume::SetName().
|
static |
Assigns a notifier for allocation/deallocation of the physical volumes.
Definition at line 110 of file G4PhysicalVolumeStore.cc.
| void G4PhysicalVolumeStore::UpdateMap | ( | ) |
Brings contents of the internal map up to date and resets validity flag.
Definition at line 120 of file G4PhysicalVolumeStore.cc.
Referenced by GetVolume(), and G4GDMLRead::StripNames().