Import Geant4 10.7.0.beta source tree
This commit is contained in:
@@ -32,9 +32,9 @@
|
||||
// This is a class for run control in GEANT4 for multi-threaded runs
|
||||
// It extends G4RunManager re-implementing multi-threaded behavior in
|
||||
// key methods. See documentation for G4RunManager
|
||||
// User should never initialize instances of this class, that are usually handled
|
||||
// by G4MTRunManager.
|
||||
// There exists one instance of this class for each worker in a MT application.
|
||||
// User should never initialize instances of this class, that are usually
|
||||
// handled by G4MTRunManager. There exists one instance of this class for each
|
||||
// worker in a MT application.
|
||||
|
||||
#ifndef G4WorkerRunManager_h
|
||||
#define G4WorkerRunManager_h 1
|
||||
@@ -44,71 +44,79 @@
|
||||
class G4WorkerThread;
|
||||
class G4WorkerRunManagerKernel;
|
||||
|
||||
class G4WorkerRunManager : public G4RunManager {
|
||||
public:
|
||||
static G4WorkerRunManager* GetWorkerRunManager();
|
||||
static G4WorkerRunManagerKernel* GetWorkerRunManagerKernel();
|
||||
G4WorkerRunManager();
|
||||
~G4WorkerRunManager();
|
||||
//Modified for worker behavior
|
||||
////////virtual void BeamOn(G4int n_event,const char* macroFile=0,G4int n_select=-1);
|
||||
virtual void InitializeGeometry();
|
||||
virtual void RunInitialization();
|
||||
virtual void DoEventLoop(G4int n_event,const char* macroFile=0,G4int n_select=-1);
|
||||
virtual void ProcessOneEvent(G4int i_event);
|
||||
virtual G4Event* GenerateEvent(G4int i_event);
|
||||
//G4int NewCommands( const std::vector<G4String>& newCmdsToExecute , G4String& currentCmd );
|
||||
//Called by the MTRunManager when new UI commands are to be executed.
|
||||
//It is not assumed method is not thread-safe: i.e. should be called sequentially
|
||||
//Returns 0 if commands are executed corrected, otherwise returns error code (see G4UImanager::ApplyCommand)
|
||||
//In case of error currentCmd is set to the command that gave the problem
|
||||
virtual void RunTermination();
|
||||
virtual void TerminateEventLoop();
|
||||
class G4WorkerRunManager : public G4RunManager
|
||||
{
|
||||
public:
|
||||
static G4WorkerRunManager* GetWorkerRunManager();
|
||||
static G4WorkerRunManagerKernel* GetWorkerRunManagerKernel();
|
||||
G4WorkerRunManager();
|
||||
~G4WorkerRunManager();
|
||||
// Modified for worker behavior
|
||||
////////virtual void BeamOn(G4int n_event,const char* macroFile=0,G4int
|
||||
///n_select=-1);
|
||||
virtual void InitializeGeometry();
|
||||
virtual void RunInitialization();
|
||||
virtual void DoEventLoop(G4int n_event, const char* macroFile = 0,
|
||||
G4int n_select = -1);
|
||||
virtual void ProcessOneEvent(G4int i_event);
|
||||
virtual G4Event* GenerateEvent(G4int i_event);
|
||||
// G4int NewCommands( const std::vector<G4String>& newCmdsToExecute ,
|
||||
// G4String& currentCmd ); Called by the MTRunManager when new UI commands are
|
||||
// to be executed. It is not assumed method is not thread-safe: i.e. should be
|
||||
// called sequentially Returns 0 if commands are executed corrected, otherwise
|
||||
// returns error code (see G4UImanager::ApplyCommand) In case of error
|
||||
// currentCmd is set to the command that gave the problem
|
||||
virtual void RunTermination();
|
||||
virtual void TerminateEventLoop();
|
||||
|
||||
//This function is called by the thread function: it should loop until some
|
||||
//work is requested
|
||||
virtual void DoWork();
|
||||
protected:
|
||||
virtual void ConstructScoringWorlds();
|
||||
virtual void StoreRNGStatus(const G4String& filenamePrefix );
|
||||
virtual void MergePartialResults();
|
||||
//This method will merge (reduce) the results of this run into the
|
||||
//global run
|
||||
public:
|
||||
//! Sets the worker context
|
||||
void SetWorkerThread( G4WorkerThread* wc ) { workerContext = wc; }
|
||||
private:
|
||||
G4WorkerThread* workerContext;
|
||||
void SetupDefaultRNGEngine();
|
||||
// This function is called by the thread function: it should loop until some
|
||||
// work is requested
|
||||
virtual void DoWork();
|
||||
|
||||
public:
|
||||
virtual void SetUserInitialization(G4VUserPhysicsList* userInit);
|
||||
virtual void SetUserInitialization(G4VUserDetectorConstruction* userInit);
|
||||
virtual void SetUserInitialization(G4VUserActionInitialization* userInit);
|
||||
virtual void SetUserInitialization(G4UserWorkerInitialization* userInit);
|
||||
virtual void SetUserInitialization(G4UserWorkerThreadInitialization* userInit);
|
||||
virtual void SetUserAction(G4UserRunAction* userAction);
|
||||
virtual void SetUserAction(G4VUserPrimaryGeneratorAction* userAction);
|
||||
virtual void SetUserAction(G4UserEventAction* userAction);
|
||||
virtual void SetUserAction(G4UserStackingAction* userAction);
|
||||
virtual void SetUserAction(G4UserTrackingAction* userAction);
|
||||
virtual void SetUserAction(G4UserSteppingAction* userAction);
|
||||
protected:
|
||||
virtual void ConstructScoringWorlds();
|
||||
virtual void StoreRNGStatus(const G4String& filenamePrefix);
|
||||
virtual void MergePartialResults();
|
||||
// This method will merge (reduce) the results of this run into the
|
||||
// global run
|
||||
public:
|
||||
//! Sets the worker context
|
||||
void SetWorkerThread(G4WorkerThread* wc) { workerContext = wc; }
|
||||
|
||||
protected:
|
||||
G4bool eventLoopOnGoing;
|
||||
G4bool runIsSeeded;
|
||||
G4int nevModulo;
|
||||
G4int currEvID;
|
||||
G4int luxury;
|
||||
G4SeedsQueue seedsQueue;
|
||||
G4bool readStatusFromFile;
|
||||
|
||||
public:
|
||||
virtual void RestoreRndmEachEvent(G4bool flag) { readStatusFromFile = flag; }
|
||||
protected:
|
||||
G4WorkerThread* workerContext;
|
||||
#ifdef G4MULTITHREADED
|
||||
private:
|
||||
G4bool visIsSetUp;
|
||||
G4bool visIsSetUp;
|
||||
#endif
|
||||
|
||||
private:
|
||||
void SetupDefaultRNGEngine();
|
||||
|
||||
public:
|
||||
virtual void SetUserInitialization(G4VUserPhysicsList* userInit);
|
||||
virtual void SetUserInitialization(G4VUserDetectorConstruction* userInit);
|
||||
virtual void SetUserInitialization(G4VUserActionInitialization* userInit);
|
||||
virtual void SetUserInitialization(G4UserWorkerInitialization* userInit);
|
||||
virtual void SetUserInitialization(
|
||||
G4UserWorkerThreadInitialization* userInit);
|
||||
virtual void SetUserAction(G4UserRunAction* userAction);
|
||||
virtual void SetUserAction(G4VUserPrimaryGeneratorAction* userAction);
|
||||
virtual void SetUserAction(G4UserEventAction* userAction);
|
||||
virtual void SetUserAction(G4UserStackingAction* userAction);
|
||||
virtual void SetUserAction(G4UserTrackingAction* userAction);
|
||||
virtual void SetUserAction(G4UserSteppingAction* userAction);
|
||||
|
||||
protected:
|
||||
G4bool eventLoopOnGoing;
|
||||
G4bool runIsSeeded;
|
||||
G4int nevModulo;
|
||||
G4int currEvID;
|
||||
G4int luxury;
|
||||
G4SeedsQueue seedsQueue;
|
||||
G4bool readStatusFromFile;
|
||||
|
||||
public:
|
||||
virtual void RestoreRndmEachEvent(G4bool flag) { readStatusFromFile = flag; }
|
||||
};
|
||||
|
||||
#endif //G4WorkerRunManager_h
|
||||
#endif // G4WorkerRunManager_h
|
||||
|
||||
Reference in New Issue
Block a user