Import Geant4 10.7.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2020-06-26 10:23:25 +02:00
parent c02c370437
commit 67ba86d073
1871 changed files with 174422 additions and 131884 deletions
+152 -140
View File
@@ -25,12 +25,12 @@
//
//
//
//
//
// class description:
//
// This is a class for mandatory control of GEANT4 kernel.
//
// This is a class for mandatory control of GEANT4 kernel.
//
// This class is constructed by G4RunManager. If a user uses his/her own
// class instead of G4RunManager, this class must be instantiated by
// him/herself at the very beginning of the application and must be deleted
@@ -40,11 +40,11 @@
// InitializePhysics
// RunInitialization
// RunTermination
//
//
// User must provide his/her own classes derived from the following
// abstract class and register it to the RunManagerKernel.
// abstract class and register it to the RunManagerKernel.
// G4VUserPhysicsList - Particle types, Processes and Cuts
//
//
// G4RunManagerKernel does not have any eveny loop. Handling of events
// is managed by G4RunManager.
//
@@ -61,173 +61,185 @@ class G4StackManager;
class G4TrackingManager;
class G4PrimaryTransformer;
#include "globals.hh"
#include "G4EventManager.hh"
#include "globals.hh"
class G4RunManagerKernel
{
public: // with description
static G4RunManagerKernel* GetRunManagerKernel();
// Static method which returns the singleton pointer of G4RunManagerKernel or
// its derived class.
public: // with description
static G4RunManagerKernel* GetRunManagerKernel();
// Static method which returns the singleton pointer of G4RunManagerKernel or
// its derived class.
private:
static G4ThreadLocal G4RunManagerKernel* fRunManagerKernel;
private:
static G4ThreadLocal G4RunManagerKernel* fRunManagerKernel;
public: // with description
public: // with description
G4RunManagerKernel();
virtual ~G4RunManagerKernel();
// The constructor and the destructor. The user must construct this class
// object at the beginning of his/her main() and must delete it at the
// bottom of the main(), unless he/she used G4RunManager.
public:
enum RMKType
{
sequentialRMK,
masterRMK,
workerRMK
};
G4RunManagerKernel();
virtual ~G4RunManagerKernel();
// The constructor and the destructor. The user must construct this class
// object at the beginning of his/her main() and must delete it at the
// bottom of the main(), unless he/she used G4RunManager.
public:
enum RMKType { sequentialRMK, masterRMK, workerRMK };
protected:
//Constructor to be used by derived classes
G4RunManagerKernel(RMKType rmkType);
RMKType runManagerKernelType;
protected:
// Constructor to be used by derived classes
G4RunManagerKernel(RMKType rmkType);
RMKType runManagerKernelType;
public: // with description
void DefineWorldVolume(G4VPhysicalVolume * worldVol,
G4bool topologyIsChanged=true);
public: // with description
void DefineWorldVolume(G4VPhysicalVolume* worldVol,
G4bool topologyIsChanged = true);
void WorkerDefineWorldVolume(G4VPhysicalVolume * worldVol,
G4bool topologyIsChanged=true);
void WorkerDefineWorldVolume(G4VPhysicalVolume* worldVol,
G4bool topologyIsChanged = true);
// This method must be invoked if the geometry setup has been changed between
// runs. The flag 'topologyIsChanged' will specify if the geometry topology is
// different from the original one used in the previous run; if not, it must be
// set to false, so that the original optimisation and navigation history is
// preserved. This method is invoked also at initialisation.
// This method must be invoked if the geometry setup has been changed between
// runs. The flag 'topologyIsChanged' will specify if the geometry topology is
// different from the original one used in the previous run; if not, it must
// be set to false, so that the original optimisation and navigation history
// is preserved. This method is invoked also at initialisation.
void SetPhysics(G4VUserPhysicsList* uPhys);
// This method must be invoked at least once by the user with a valid
// concrete implementation of user physics list.
void SetPhysics(G4VUserPhysicsList* uPhys);
// This method must be invoked at least once by the user with a valid
// concrete implementation of user physics list.
void InitializePhysics();
// This method must be invoked at least once by the user to build physics
// processes.
void InitializePhysics();
// This method must be invoked at least once by the user to build physics
// processes.
G4bool RunInitialization(G4bool fakeRun=false);
// Trigger geometry closing and physics table constructions.
// It returns TRUE if all procedures went well.
G4bool RunInitialization(G4bool fakeRun = false);
// Trigger geometry closing and physics table constructions.
// It returns TRUE if all procedures went well.
void RunTermination();
// Set the application state to G4State_Idle so that the user can modify
// physics/geometry.
void RunTermination();
// Set the application state to G4State_Idle so that the user can modify
// physics/geometry.
public:
void WorkerUpdateWorldVolume();
public:
void WorkerUpdateWorldVolume();
protected:
void SetupDefaultRegion();
//Called by DefineWorldVolume
void SetupPhysics();
void ResetNavigator();
void BuildPhysicsTables(G4bool fakeRun);
void CheckRegions();
protected:
void SetupDefaultRegion();
// Called by DefineWorldVolume
void SetupPhysics();
void ResetNavigator();
void BuildPhysicsTables(G4bool fakeRun);
void CheckRegions();
public: // with description
void UpdateRegion();
// Update region list.
// This method is mandatory before invoking following two dump methods.
// At RunInitialization(), this method is automatically invoked, and thus
// the user needs not invoke.
public: // with description
void UpdateRegion();
// Update region list.
// This method is mandatory before invoking following two dump methods.
// At RunInitialization(), this method is automatically invoked, and thus
// the user needs not invoke.
void DumpRegion(const G4String& rname) const;
// Dump information of a region.
void DumpRegion(const G4String& rname) const;
// Dump information of a region.
void DumpRegion(G4Region* region=0) const;
// Dump information of a region.
// If the pointer is NULL, all regions are shown.
void DumpRegion(G4Region* region = 0) const;
// Dump information of a region.
// If the pointer is NULL, all regions are shown.
private:
G4VUserPhysicsList * physicsList;
G4VPhysicalVolume* currentWorld;
G4bool geometryInitialized;
G4bool physicsInitialized;
G4bool geometryToBeOptimized;
G4bool physicsNeedsToBeReBuilt;
G4int verboseLevel;
G4int numberOfParallelWorld;
private:
G4VUserPhysicsList* physicsList;
G4VPhysicalVolume* currentWorld;
G4bool geometryInitialized;
G4bool physicsInitialized;
G4bool geometryToBeOptimized;
G4bool physicsNeedsToBeReBuilt;
G4int verboseLevel;
G4int numberOfParallelWorld;
G4EventManager * eventManager;
G4ExceptionHandler* defaultExceptionHandler;
G4String versionString;
protected:
G4Region* defaultRegion;
G4Region* defaultRegionForParallelWorld;
G4bool geometryNeedsToBeClosed;
public: // with description
inline void GeometryHasBeenModified()
{ geometryNeedsToBeClosed = true; }
// This method must be invoked (or equivalent UI commands can be used)
// in case the user changes his/her detector geometry.
// This method is automatically invoked from DefineWorldVolume() method.
G4EventManager* eventManager;
G4ExceptionHandler* defaultExceptionHandler;
G4String versionString;
inline void PhysicsHasBeenModified()
{ physicsNeedsToBeReBuilt = true; }
// This method must be invoked in case the user changes his/her physics
// process(es), e.g. (in)activate some processes. Once this method is
// invoked, regardless of cuts are changed or not, BuildPhysicsTable()
// of PhysicsList is invoked for refreshing all physics tables.
protected:
G4Region* defaultRegion;
G4Region* defaultRegionForParallelWorld;
G4bool geometryNeedsToBeClosed;
public:
inline G4EventManager* GetEventManager() const
{ return eventManager; }
inline G4StackManager* GetStackManager() const
{ return eventManager->GetStackManager(); }
inline G4TrackingManager* GetTrackingManager() const
{ return eventManager->GetTrackingManager(); }
inline void SetPrimaryTransformer(G4PrimaryTransformer* pt)
{ eventManager->SetPrimaryTransformer(pt); }
inline G4PrimaryTransformer* GetPrimaryTransformer() const
{ return eventManager->GetPrimaryTransformer(); }
public: // with description
inline void GeometryHasBeenModified() { geometryNeedsToBeClosed = true; }
// This method must be invoked (or equivalent UI commands can be used)
// in case the user changes his/her detector geometry.
// This method is automatically invoked from DefineWorldVolume() method.
inline const G4String& GetVersionString() const
{ return versionString; }
inline void PhysicsHasBeenModified() { physicsNeedsToBeReBuilt = true; }
// This method must be invoked in case the user changes his/her physics
// process(es), e.g. (in)activate some processes. Once this method is
// invoked, regardless of cuts are changed or not, BuildPhysicsTable()
// of PhysicsList is invoked for refreshing all physics tables.
inline void SetVerboseLevel(G4int vl)
{ verboseLevel = vl; }
public:
inline G4EventManager* GetEventManager() const { return eventManager; }
inline G4StackManager* GetStackManager() const
{
return eventManager->GetStackManager();
}
inline G4TrackingManager* GetTrackingManager() const
{
return eventManager->GetTrackingManager();
}
inline void SetPrimaryTransformer(G4PrimaryTransformer* pt)
{
eventManager->SetPrimaryTransformer(pt);
}
inline G4PrimaryTransformer* GetPrimaryTransformer() const
{
return eventManager->GetPrimaryTransformer();
}
inline void SetGeometryToBeOptimized(G4bool vl)
{
if(geometryToBeOptimized != vl)
{
geometryToBeOptimized = vl;
geometryNeedsToBeClosed = true;
}
inline const G4String& GetVersionString() const { return versionString; }
inline void SetVerboseLevel(G4int vl) { verboseLevel = vl; }
inline void SetGeometryToBeOptimized(G4bool vl)
{
if(geometryToBeOptimized != vl)
{
geometryToBeOptimized = vl;
geometryNeedsToBeClosed = true;
}
}
inline G4int GetNumberOfParallelWorld() const
{ return numberOfParallelWorld; }
inline void SetNumberOfParallelWorld(G4int i)
{ numberOfParallelWorld = i; }
inline G4int GetNumberOfParallelWorld() const
{
return numberOfParallelWorld;
}
inline void SetNumberOfParallelWorld(G4int i) { numberOfParallelWorld = i; }
inline G4VUserPhysicsList* GetPhysicsList() const
{ return physicsList; }
inline G4VUserPhysicsList* GetPhysicsList() const { return physicsList; }
inline G4VPhysicalVolume* GetCurrentWorld() const
{ return currentWorld; }
private:
void CheckRegularGeometry();
G4bool ConfirmCoupledTransportation();
void SetScoreSplitter();
inline G4VPhysicalVolume* GetCurrentWorld() const { return currentWorld; }
G4int numberOfStaticAllocators;
private:
void CheckRegularGeometry();
G4bool ConfirmCoupledTransportation();
void SetScoreSplitter();
public:
inline G4int GetNumberOfStaticAllocators() const
{ return numberOfStaticAllocators; }
protected:
virtual void SetupShadowProcess() const;
// This method will setup the G4VProcesses
// instances to have a reference to the process instance
// created by the master thread. See G4VProcess::GetMasterProcess
G4int numberOfStaticAllocators;
void PropagateGenericIonID();
public:
inline G4int GetNumberOfStaticAllocators() const
{
return numberOfStaticAllocators;
}
protected:
virtual void SetupShadowProcess() const;
// This method will setup the G4VProcesses
// instances to have a reference to the process instance
// created by the master thread. See G4VProcess::GetMasterProcess
void PropagateGenericIonID();
};
#endif