Import Geant4 11.0.0.beta source tree
This commit is contained in:
@@ -209,7 +209,7 @@ class G4LogicalVolume
|
||||
// Copy-constructor and assignment operator not allowed.
|
||||
|
||||
inline const G4String& GetName() const;
|
||||
inline void SetName(const G4String& pName);
|
||||
void SetName(const G4String& pName);
|
||||
// Returns and sets the name of the logical volume.
|
||||
|
||||
inline size_t GetNoDaughters() const;
|
||||
|
||||
@@ -44,16 +44,6 @@ const G4String& G4LogicalVolume::GetName() const
|
||||
return fName;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
// SetName
|
||||
// ********************************************************************
|
||||
//
|
||||
inline
|
||||
void G4LogicalVolume::SetName(const G4String& pName)
|
||||
{
|
||||
fName = pName;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
// GetInstanceID
|
||||
// ********************************************************************
|
||||
|
||||
@@ -35,22 +35,19 @@
|
||||
// All logical volumes should be registered with G4LogicalVolumeStore,
|
||||
// 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.
|
||||
//
|
||||
// If much additional functionality is added, should consider containment
|
||||
// instead of inheritance for std::vector<T>.
|
||||
//
|
||||
// Member data:
|
||||
//
|
||||
// static G4LogicalVolumeStore* fgInstance
|
||||
// - Ptr to the single G4LogicalVolumeStore.
|
||||
|
||||
// 10.07.95 - P.Kent, Initial version
|
||||
// 18.04.01 - G.Cosmo, Migrated to STL vector
|
||||
// 10.07.95, P.Kent, G.Cosmo - Initial version
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4LOGICALVOLUMESTORE_HH
|
||||
#define G4LOGICALVOLUMESTORE_HH
|
||||
#define G4LOGICALVOLUMESTORE_HH 1
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4VStoreNotifier.hh"
|
||||
@@ -72,7 +69,17 @@ class G4LogicalVolumeStore : public std::vector<G4LogicalVolume*>
|
||||
|
||||
G4LogicalVolume* GetVolume(const G4String& name, G4bool verbose=true) const;
|
||||
// Return the pointer of the first volume in the collection having
|
||||
// that name.
|
||||
// that name. Uses the internal map for fast search and warns if
|
||||
// a volume in the collection is not unique or not found.
|
||||
|
||||
inline G4bool IsMapValid() const { return mvalid; }
|
||||
inline void SetMapValid(G4bool val) { mvalid = val; }
|
||||
// Accessor to assess validity of the internal map.
|
||||
inline const std::map<G4String,
|
||||
std::vector<G4LogicalVolume*> >& GetMap() const { return bmap; }
|
||||
// Return the internal map.
|
||||
void UpdateMap();
|
||||
// Bring contents of internal map up to date and resets validity flag.
|
||||
|
||||
virtual ~G4LogicalVolumeStore();
|
||||
// Destructor: takes care to delete allocated logical volumes.
|
||||
@@ -90,6 +97,9 @@ class G4LogicalVolumeStore : public std::vector<G4LogicalVolume*>
|
||||
static G4LogicalVolumeStore* fgInstance;
|
||||
static G4ThreadLocal G4VStoreNotifier* fgNotifier;
|
||||
static G4ThreadLocal G4bool locked;
|
||||
|
||||
std::map<G4String, std::vector<G4LogicalVolume*> > bmap;
|
||||
G4bool mvalid = false; // Flag to indicate if map is up to date or not
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,22 +34,19 @@
|
||||
//
|
||||
// All 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.
|
||||
//
|
||||
// If much additional functionality is added, should consider containment
|
||||
// instead of inheritance for std::vector<T>
|
||||
//
|
||||
// Member data:
|
||||
//
|
||||
// static G4PhysicalVolumeStore*
|
||||
// - Ptr to the single G4PhysicalVolumeStore.
|
||||
// instead of inheritance for std::vector<T>.
|
||||
|
||||
// 25.07.95, P.Kent - Initial version
|
||||
// 18.04.01, G.Cosmo - Migrated to STL vector
|
||||
// 25.07.95, P.Kent, G.Cosmo - Initial version
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4PHYSICALVOLUMESTORE_HH
|
||||
#define G4PHYSICALVOLUMESTORE_HH
|
||||
#define G4PHYSICALVOLUMESTORE_HH 1
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4VStoreNotifier.hh"
|
||||
@@ -73,7 +70,17 @@ class G4PhysicalVolumeStore : public std::vector<G4VPhysicalVolume*>
|
||||
G4VPhysicalVolume* GetVolume(const G4String& name,
|
||||
G4bool verbose = true) const;
|
||||
// Return the pointer of the first volume in the collection having
|
||||
// that name.
|
||||
// that name. Uses the internal map for fast search and warns if
|
||||
// a volume in the collection is not unique or not found.
|
||||
|
||||
inline G4bool IsMapValid() const { return mvalid; }
|
||||
inline void SetMapValid(G4bool val) { mvalid = val; }
|
||||
// Accessor to assess validity of the internal map.
|
||||
inline const std::map<G4String,
|
||||
std::vector<G4VPhysicalVolume*> >& GetMap() const { return bmap; }
|
||||
// Return the internal map.
|
||||
void UpdateMap();
|
||||
// Bring contents of internal map up to date and resets validity flag.
|
||||
|
||||
virtual ~G4PhysicalVolumeStore();
|
||||
// Destructor: takes care to delete allocated physical volumes.
|
||||
@@ -91,6 +98,9 @@ class G4PhysicalVolumeStore : public std::vector<G4VPhysicalVolume*>
|
||||
static G4PhysicalVolumeStore* fgInstance;
|
||||
static G4ThreadLocal G4VStoreNotifier* fgNotifier;
|
||||
static G4ThreadLocal G4bool locked;
|
||||
|
||||
std::map<G4String, std::vector<G4VPhysicalVolume*> > bmap;
|
||||
G4bool mvalid = false; // Flag to indicate if map is up to date or not
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -121,7 +121,7 @@ class G4Region
|
||||
// NOT already inserted, in which case significant speedup can be
|
||||
// achieved in very complex flat geometry setups.
|
||||
|
||||
inline void SetName(const G4String& name);
|
||||
void SetName(const G4String& name);
|
||||
inline const G4String& GetName() const;
|
||||
// Set/get region's name.
|
||||
|
||||
|
||||
@@ -58,16 +58,6 @@ const G4String& G4Region::GetName() const
|
||||
return fName;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
// SetName
|
||||
// ********************************************************************
|
||||
//
|
||||
inline
|
||||
void G4Region::SetName(const G4String& pName)
|
||||
{
|
||||
fName = pName;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
// RegionModified
|
||||
// ********************************************************************
|
||||
|
||||
@@ -34,21 +34,20 @@
|
||||
//
|
||||
// All regions should be registered with G4RegionStore, and removed on their
|
||||
// destruction. The underlying container initially has a capacity of 20.
|
||||
// A map indexed by volume names is also recorded for fast search;
|
||||
// pointers to regions with same name are stored in buckets.
|
||||
//
|
||||
// If much additional functionality is added, should consider containment
|
||||
// instead of inheritance for std::vector<T>
|
||||
//
|
||||
// Member data:
|
||||
//
|
||||
// static G4RegionStore*
|
||||
// - Pointer to the single G4RegionStore
|
||||
// instead of inheritance for std::vector<T>.
|
||||
|
||||
// 18.09.02, G.Cosmo - Initial version
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4REGIONSTORE_HH
|
||||
#define G4REGIONSTORE_HH
|
||||
#define G4REGIONSTORE_HH 1
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "G4Types.hh"
|
||||
#include "G4String.hh"
|
||||
#include "G4VStoreNotifier.hh"
|
||||
@@ -84,7 +83,18 @@ class G4RegionStore : public std::vector<G4Region*>
|
||||
// in the store.
|
||||
|
||||
G4Region* GetRegion(const G4String& name, G4bool verbose = true) const;
|
||||
// Returns a region through its name specification.
|
||||
// Returns a region through its name specification. Uses the internal
|
||||
// map for fast search and warns if a region in the collection is not
|
||||
// unique or not found.
|
||||
|
||||
inline G4bool IsMapValid() const { return mvalid; }
|
||||
inline void SetMapValid(G4bool val) { mvalid = val; }
|
||||
// Accessor to assess validity of the internal map.
|
||||
inline const std::map<G4String,
|
||||
std::vector<G4Region*> >& GetMap() const { return bmap; }
|
||||
// Return the internal map.
|
||||
void UpdateMap();
|
||||
// Bring contents of internal map up to date and resets validity flag.
|
||||
|
||||
G4Region* FindOrCreateRegion(const G4String& name);
|
||||
// Returns a region through its name specification, if it exists.
|
||||
@@ -113,6 +123,9 @@ class G4RegionStore : public std::vector<G4Region*>
|
||||
static G4RegionStore* fgInstance;
|
||||
static G4ThreadLocal G4VStoreNotifier* fgNotifier;
|
||||
static G4ThreadLocal G4bool locked;
|
||||
|
||||
std::map<G4String, std::vector<G4Region*> > bmap;
|
||||
G4bool mvalid = false; // Flag to indicate if map is up to date or not
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,23 +34,19 @@
|
||||
//
|
||||
// All solids should be registered with G4SolidStore, and removed on their
|
||||
// destruction. The underlying container initially has a capacity of 100.
|
||||
// A map indexed by solid names is also recorded for fast search;
|
||||
// pointers to solids with same name are stored in buckets.
|
||||
//
|
||||
// If much additional functionality is added, should consider containment
|
||||
// instead of inheritance for std::vector<T>
|
||||
//
|
||||
// Member data:
|
||||
//
|
||||
// static G4SolidStore*
|
||||
// - Ptr to the single G4SolidStore
|
||||
// instead of inheritance for std::vector<T>.
|
||||
|
||||
// History:
|
||||
// 10.07.95, P.Kent - Initial version
|
||||
// 18.04.01, G.Cosmo - Migrated to STL vector
|
||||
// 10.07.95, P.Kent, G.Cosmo - Initial version
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4VSOLIDSTORE_HH
|
||||
#define G4VSOLIDSTORE_HH
|
||||
#define G4VSOLIDSTORE_HH 1
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "G4VSolid.hh"
|
||||
#include "G4VStoreNotifier.hh"
|
||||
@@ -72,7 +68,17 @@ class G4SolidStore : public std::vector<G4VSolid*>
|
||||
|
||||
G4VSolid* GetSolid(const G4String& name, G4bool verbose = true) const;
|
||||
// Return the pointer of the first solid in the collection having
|
||||
// that name.
|
||||
// that name. Uses the internal map for fast search and warns if
|
||||
// a solid in the collection is not unique or not found.
|
||||
|
||||
inline G4bool IsMapValid() const { return mvalid; }
|
||||
inline void SetMapValid(G4bool val) { mvalid = val; }
|
||||
// Accessor to assess validity of the internal map.
|
||||
inline const std::map<G4String,
|
||||
std::vector<G4VSolid*> >& GetMap() const { return bmap; }
|
||||
// Return the internal map.
|
||||
void UpdateMap();
|
||||
// Bring contents of internal map up to date and resets validity flag.
|
||||
|
||||
virtual ~G4SolidStore();
|
||||
// Destructor: takes care to delete allocated solids.
|
||||
@@ -90,6 +96,9 @@ class G4SolidStore : public std::vector<G4VSolid*>
|
||||
static G4SolidStore* fgInstance;
|
||||
static G4ThreadLocal G4VStoreNotifier* fgNotifier;
|
||||
static G4ThreadLocal G4bool locked;
|
||||
|
||||
std::map<G4String, std::vector<G4VSolid*> > bmap;
|
||||
G4bool mvalid = false; // Flag to indicate if map is up to date or not
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -189,6 +189,10 @@ class G4UAdapter : public G4VSolid, protected UnplacedVolume_t
|
||||
// Smart access function - creates on request and stores for future
|
||||
// access. A null pointer means "not available".
|
||||
|
||||
inline friend std::ostream& operator<< ( std::ostream& os, const G4UAdapter<UnplacedVolume_t>& uad )
|
||||
{ const UnplacedVolume_t& origUnplaced = uad; return operator<< ( os, origUnplaced ); }
|
||||
// Streaming operator, forward to VecGeom method
|
||||
|
||||
public: // without description
|
||||
|
||||
G4UAdapter(__void__&);
|
||||
|
||||
@@ -151,7 +151,7 @@ class G4VPhysicalVolume
|
||||
|
||||
inline const G4String& GetName() const;
|
||||
// Return the volume's name.
|
||||
inline void SetName(const G4String& pName);
|
||||
void SetName(const G4String& pName);
|
||||
// Set the volume's name.
|
||||
|
||||
virtual G4int GetMultiplicity() const;
|
||||
|
||||
@@ -69,12 +69,6 @@ const G4String& G4VPhysicalVolume::GetName() const
|
||||
return fname;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VPhysicalVolume::SetName(const G4String& pName)
|
||||
{
|
||||
fname = pName;
|
||||
}
|
||||
|
||||
inline
|
||||
EVolume G4VPhysicalVolume::DeduceVolumeType() const
|
||||
{
|
||||
|
||||
@@ -97,7 +97,7 @@ class G4VSolid
|
||||
|
||||
inline G4String GetName() const;
|
||||
// Returns the current shape's name.
|
||||
inline void SetName(const G4String& name);
|
||||
void SetName(const G4String& name);
|
||||
// Sets the current shape's name.
|
||||
|
||||
inline G4double GetTolerance() const;
|
||||
|
||||
@@ -45,12 +45,6 @@ G4String G4VSolid::GetName() const
|
||||
return fshapeName;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VSolid::SetName(const G4String& name)
|
||||
{
|
||||
fshapeName = name;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4VSolid::GetTolerance() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user