Import Geant4 10.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2019-12-06 15:12:28 +01:00
parent b2a62ae692
commit 5baee230e9
2997 changed files with 141580 additions and 98673 deletions
+61 -89
View File
@@ -23,36 +23,24 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
// ----------------------------------------------------------------------
// Class G4IStore
// G4IStore
//
// Class description:
//
// An implementation of a "importance store" with the interface
// An implementation of an "importance store" with the interface
// G4VIStore. See description in G4VIStore.
// This implementation uses G4GeometryCellImportance as the container
// to store the "cells" together with the importance values.
// Giving a cell the importance 0 is allowed as
// a flagging that no biasing should happen between this
// cell and it's neighbors
// If a cell is not known by the importance store no biasing
// should be applied between this cell and it's nighbors.
// Giving a cell the importance 0 is allowed as a flagging that no biasing
// should happen between this cell and its neighbors.
// If a cell is not known by the importance store no biasing should be
// applied between this cell and its nighbors.
// Author: Michael Dressel (Michael.Dressel@cern.ch)
//
// Alex Howard (alexander.howard@cern.ch):
// Changed class to a `singleton', with access via the static method
// G4IStore::GetInstance().
//
// Member data:
//
// static G4IStore* fInstance
// - Ptr to the unique instance of class
// Author: Michael Dressel (CERN), 2002
// Modified: Alex Howard (CERN), 2013 - Changed class to a 'singleton'
// ----------------------------------------------------------------------
#ifndef G4IStore_hh
#define G4IStore_hh G4IStore_hh
#ifndef G4ISTORE_HH
#define G4ISTORE_HH 1
#include "G4VIStore.hh"
#include "G4GeometryCellImportance.hh"
@@ -60,92 +48,76 @@
class G4IStore : public G4VIStore
{
public:
public:
static G4IStore* GetInstance();
// return ptr to singleton instance of the class.
// static G4ThreadLocal G4IStore* GetInstance();
static G4IStore* GetInstance();
// Return ptr to singleton instance of the class.
// static G4ThreadLocal G4IStore* GetInstance(G4String ParallelWorldName);
static G4IStore* GetInstance(const G4String& ParallelWorldName);
// Return ptr to singleton instance of the class.
static G4IStore* GetInstance(const G4String& ParallelWorldName);
// return ptr to singleton instance of the class.
protected:
virtual G4double GetImportance(const G4GeometryCell& gCell) const;
// derive an importance value of a "cell" addressed by a
// G4GeometryCell from the store.
explicit G4IStore();
// initialise the importance store for the given geometry
explicit G4IStore(const G4String& ParallelWorldName);
// initialise the importance store for the given geometry
virtual G4bool IsKnown(const G4GeometryCell& gCell) const;
// returns true if the gCell is in the store, else false
~G4IStore();
// destruct
void Clear();
public: // with description
void SetWorldVolume();
// set a reference to the world volume of the "importance" geometry
virtual G4double GetImportance(const G4GeometryCell &gCell) const;
// derive an importance value of a "cell" addressed by a G4GeometryCell
// from the store.
void SetParallelWorldVolume(const G4String& paraName);
// set a reference to parallel world volume of the "importance" geometry
virtual G4bool IsKnown(const G4GeometryCell &gCell) const;
// returns true if the gCell is in the store, else false
virtual const G4VPhysicalVolume& GetWorldVolume() const;
// return a reference to the world volume of the "importance" geometry
void Clear();
virtual const G4VPhysicalVolume* GetParallelWorldVolumePointer() const;
// return a pointer to the world volume of the "importance" geometry
void SetWorldVolume();
// set a reference to the world volume of the
// "importance" geometry
void AddImportanceGeometryCell(G4double importance,
const G4GeometryCell &gCell);
void AddImportanceGeometryCell(G4double importance,
const G4VPhysicalVolume &,
G4int aRepNum = 0);
// add a "cell" together with a importance value to the store.
void SetParallelWorldVolume(G4String paraName);
// set a reference to the parallel world volume of the
// "importance" geometry
void ChangeImportance(G4double importance, const G4GeometryCell& gCell);
void ChangeImportance(G4double importance, const G4VPhysicalVolume&,
G4int aRepNum = 0);
// change a importance value of a "cell".
virtual const G4VPhysicalVolume& GetWorldVolume() const;
// return a reference to the world volume of the
// "importance" geometry
// virtual const G4VPhysicalVolume& GetParallelWorldVolume() const;
// // return a reference to the world volume of the
// // "importance" geometry
virtual const G4VPhysicalVolume* GetParallelWorldVolumePointer() const;
// return a pointer to the world volume of the
// "importance" geometry
void AddImportanceGeometryCell(G4double importance,
const G4GeometryCell &gCell);
void AddImportanceGeometryCell(G4double importance,
const G4VPhysicalVolume &,
G4int aRepNum = 0);
// Add a "cell" together with a importance value to the store.
void ChangeImportance(G4double importance,
const G4GeometryCell &gCell);
void ChangeImportance(G4double importance,
const G4VPhysicalVolume &,
G4int aRepNum = 0);
// Change a importance value of a "cell".
G4double GetImportance(const G4VPhysicalVolume &,
G4int aRepNum = 0) const ;
G4double GetImportance(const G4VPhysicalVolume&, G4int aRepNum = 0) const;
private:
protected:
G4bool IsInWorld(const G4VPhysicalVolume &) const;
void SetInternalIterator(const G4GeometryCell &gCell) const;
void Error(const G4String &m) const;
private:
explicit G4IStore();
// initialise the importance store for the given geometry
explicit G4IStore(const G4String& ParallelWorldName);
// initialise the importance store for the given geometry
~G4IStore();
// destructor
private:
G4bool IsInWorld(const G4VPhysicalVolume&) const;
void SetInternalIterator(const G4GeometryCell& gCell) const;
void Error(const G4String& m) const;
private:
const G4VPhysicalVolume* fWorldVolume;
// const G4VPhysicalVolume* fParallelWorldVolume;
// G4bool fParaFlag;
G4GeometryCellImportance fGeometryCelli;
const G4VPhysicalVolume* fWorldVolume = nullptr;
G4GeometryCellImportance fGeometryCelli;
mutable G4GeometryCellImportance::const_iterator fCurrentIterator;
mutable G4GeometryCellImportance::const_iterator fCurrentIterator;
static G4ThreadLocal G4IStore* fInstance;
static G4ThreadLocal G4IStore* fInstance;
#ifdef G4MULTITHREADED
static G4Mutex IStoreMutex;
static G4Mutex IStoreMutex;
#endif
};