Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
+1 -2
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.1 1999/01/07 16:14:14 gunter Exp $
# $Id: GNUmakefile,v 1.2 1999/10/07 15:48:30 johna Exp $
# ----------------------------------------------------------
# GNUmakefile for run library. Gabriele Cosmo, 3/4/1997.
# ----------------------------------------------------------
@@ -41,7 +41,6 @@ CPPFLAGS += -I$(G4BASE)/global/management/include \
-I$(G4BASE)/digits+hits/hits/include \
-I$(G4BASE)/digits+hits/digits/include \
-I$(G4BASE)/event/include \
-I$(G4BASE)/graphics_reps/include \
-I$(G4BASE)/intercoms/include
include $(G4INSTALL)/config/common.gmk
+24 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.8 1999/05/21 04:29:04 kurasige Exp $
$Id: History,v 1.15 1999/12/02 16:26:05 asaim Exp $
-------------------------------------------------------------------
=========================================================
@@ -16,6 +16,29 @@ committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Dec 2 99, M.Asai (run-V00-01-04)
- G4RunManager displays the version number when it is constructed.
Nov 7 99, H.Kurashige (run-V00-01-03)
- Comments are enriched for software reference manual.
Nov 4, 99, M.Asai (tag run-V00-01-02)
- Comments are enriched for software reference manual.
Oct 7, 99, J.Allison (tag run-V00-01-01)
- Removed -I$(G4BASE)/graphics_reps/include from GNUmakefile (no
longer necessary after G4VVisManager moved to intercoms).
Jul 25, 99 M.Asai (tag run-V00-01-00)
- Store/restore the status of the random number engine to
separate files
Jun 09, 99 M.Asai (tag run-01-00-06)
- Store/restore the status of the random number engine
- Get methods of G4RunManager for the user action classes
May 21, 99 H.Kurashige (run-01-00-05)
- Fixed bug in G4VUserPhysicsList::InitializeProcessManager()
+24 -11
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Run.hh,v 1.1 1999/01/07 16:14:15 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4Run.hh,v 1.2.4.1 1999/12/07 20:52:58 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef G4Run_h
@@ -19,6 +19,13 @@ class G4Event;
class G4HCtable;
class G4DCtable;
// class description:
//
// This class represents a run. An object of this class is constructed
// and deleted by G4RunManager. Basically the user should use only the
// get methods. All properties are set by G4RunManager.
//
class G4Run
{
public:
@@ -33,23 +40,29 @@ class G4Run
G4HCtable* HCtable;
G4DCtable* DCtable;
public: // with description
inline G4int GetRunID() const
{ return runID; }
// Returns the run ID. Run ID is set by G4RunManager.
inline G4int GetNumberOfEvent() const
{ return numberOfEvent; }
// Returns number of events processed in this run. The number is
// incremented at the end of each event processing.
inline const G4HCtable* GetHCtable() const
{ return HCtable; }
// List of names of hits collection
inline const G4DCtable* GetDCtable() const
{ return DCtable; }
// List of names of digi collection
public:
inline void SetRunID(G4int id)
{ runID = id; }
inline G4int GetRunID() const
{ return runID; }
inline G4int GetNumberOfEvent() const
{ return numberOfEvent; }
inline virtual void RecordEvent(G4Event*)
{ numberOfEvent++; }
inline void SetHCtable(G4HCtable* HCtbl)
{ HCtable = HCtbl; }
inline const G4HCtable* GetHCtable() const
{ return HCtable; }
inline void SetDCtable(G4DCtable* DCtbl)
{ DCtable = DCtbl; }
inline const G4DCtable* GetDCtable() const
{ return DCtable; }
};
extern G4Allocator<G4Run> aRunAllocator;
+162 -27
View File
@@ -1,21 +1,21 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4RunManager.hh,v 1.2 1999/04/22 21:51:11 asaim Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4RunManager.hh,v 1.7.2.1 1999/12/07 20:52:58 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
// class description:
//
// This is a class for run controle in GEANT4
// This is a class for run control in GEANT4
//
// User must provide his own classes derived from the following
// three abstract classes and register them to the RunManager.
// User must provide his own classes derived from the following
// three abstract classes and register them to the RunManager.
// G4VUserDetectorConstruction - Detector Geometry, Materials
// G4VUserPhysicsList - Particle types and Processes
// G4VUserPrimaryGeneratorAction - Event Generator selection
@@ -30,10 +30,21 @@
// G4UserTrackingAction - Actions for each Track
// G4UserSteppingAction - Actions for each Step
//
// History
// first version by Makoto Asai
// modified 11 Mar. 1998 by H.Kurashige
// ------------------------------------------------------------
// G4RunManager is the only manager class in Geant4 kernel which
// the user MUST construct an object by him/herself in the main().
// Also, G4RunManager is the only manager class in Geant4 kernel
// which the user CAN derive it to costomize the behavior of the
// run control. For this case, user should use protected methods
// provided in this class for procedures he/she does not want to
// change.
//
// G4RunManager or the derived class of it MUST be a singleton.
// The user MUST NOT construct more than one object even if there
// are two different concrete implementations.
//
// G4RunManager controls all of state changes. See G4ApplicationState.hh
// in intercoms category for the meanings of each state.
//
#ifndef G4RunManager_h
#define G4RunManager_h 1
@@ -57,41 +68,94 @@ class G4Run;
#include "G4EventManager.hh"
#include "globals.hh"
#include <rw/tpordvec.h>
#include "g4rw/tpordvec.h"
class G4RunManager
{
public:
public: // with description
static G4RunManager* GetRunManager();
// Static method which returns the singleton pointer of G4RunManager or
// its derived class.
private:
static G4RunManager* fRunManager;
public:
public: // with description
G4RunManager();
virtual ~G4RunManager();
// 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().
public:
public: // with description
virtual void BeamOn(G4int n_event,const char* macroFile=NULL,G4int n_select=-1);
// This method starts an event loof of "n_event" events. The condition of Geant4
// is examined before starting the event loop. This method must be invoked at
// Idle state. The state will be changed to GeomClosed during the event loop and
// will go back to Idle when the loop is over or aborted.
// In case a string "macroFile" which represents the name of a macro file is given,
// this macro file will be executed AT THE END of each event processing. In case
// "n_select" is greater than zero, at the ond of first "n_select" events the macro
// file is executed.
virtual void Initialize();
// This method invokes all the necessary initialization procedures for an event
// loop. This method must be invoked at the Geant4 state of PreInit or Idle. The
// state will be changed to Init during the initialization procedures and then
// changed to Idle.
// This method invokes three protected methods, InitializeGeometry(),
// InitializePhysics(), and InitializeCutOff().
// After some event loops, the user can invoke this method once again. It is
// required if the user changes geometry, physics process, and/or cut off value.
// If the user forget the second invokation, G4RunManager will invoke BeamOn()
// method will invoke this method. (Note that this feature is not valid for the
// first initialization.)
virtual void DefineWorldVolume(G4VPhysicalVolume * worldVol);
// Usually, this method is invoked from InitializeGeometry() protected method
// of this class. But, in case all of geometry has already created and kept in
// the ODBMS, the pointer to the world physical volume can be set by this method.
virtual void AbortRun();
// This method safely aborts the current event loop even if an event is in progress.
// This method is available for Geant4 states of GeomClosed and EventProc. The state
// will be changed to Idle, so that another event loop can be done.
protected: // with description
protected:
// methods invoked from Initialize()
virtual void InitializeGeometry();
virtual void InitializePhysics();
virtual void InitializeCutOff();
// These three protected methods are invoked from Initialize() method for the
// initializations of geometry, physics processes, and cut off. The user's concrete
// G4VUserDetectorConstruction class will be accessed from InitializeGeometry() and
// G4VUserPhysicsList class will be accessed from other two methods.
// methods invoked from BeamOn()
virtual G4bool ConfirmBeamOnCondition();
virtual void RunInitialization();
virtual void DoEventLoop(G4int n_event,const char* macroFile=NULL,G4int n_select=-1);
virtual void RunTermination();
// These four protected methods are invoked from BeamOn() method. These four methods
// are invoked in this order.
// ConfirmBeamOnCondition() method checks if all the necessary initializations have
// already done. If the condition is not satisfied, false is returned and the follwing
// three methods will be skipped.
// RunInitialization() method initializes a run. For example, a G4Run class object
// is constructed in this method.
// DoEventLoop() method control an event loop. Arguments are same as BeamOn() method.
// Inide the event loop, two following protected methods are invoked at the begining
// and the end of each event.
// RunTermination() method terminates a run processing. For example, a G4Run class
// object is deleted in this class. If the user uses ODBMS and wants to store the
// G4Run class object, he/she must override this method.
// methods invoked from DoEventLoop()
virtual G4Event* GenerateEvent(G4int i_event);
virtual void AnalyzeEvent(G4Event* anEvent);
// These two protected methods are invoked from DoEventLoop() method at the begining
// and the end of each event processing.
// GenerateEvent() method constructs a G4Event class object and invoke the user's
// G4VUserPrimaryGeneratorAction concrete class. If the user is using ODBMS and event
// objects have been created and stored in the data base, he/she must override this
// method.
// AnalyzeEvent() stores an event to a data base if a concrete G4VPersistentManager
// class is defined.
protected:
void StackPreviousEvent(G4Event* anEvent);
@@ -103,6 +167,11 @@ class G4RunManager
G4UserRunAction * userRunAction;
G4VUserPrimaryGeneratorAction * userPrimaryGeneratorAction;
G4UserEventAction * userEventAction;
G4UserStackingAction * userStackingAction;
G4UserTrackingAction * userTrackingAction;
G4UserSteppingAction * userSteppingAction;
private:
G4RunMessenger* runMessenger;
@@ -125,10 +194,16 @@ class G4RunManager
G4Run* currentRun;
G4Event* currentEvent;
RWTPtrOrderedVector<G4Event>* previousEvents;
G4RWTPtrOrderedVector<G4Event>* previousEvents;
G4int n_perviousEventsToBeStored;
G4int storeRandomNumberStatus;
public:
virtual void StoreRandomNumberStatus(G4int eventID=-1);
virtual void RestoreRandomNumberStatus(G4String fileN);
public: // with description
inline void SetUserInitialization(G4VUserDetectorConstruction* userInit)
{ userDetector = userInit; }
inline void SetUserInitialization(G4VUserPhysicsList* userInit)
@@ -138,24 +213,68 @@ class G4RunManager
inline void SetUserAction(G4VUserPrimaryGeneratorAction* userAction)
{ userPrimaryGeneratorAction = userAction; }
inline void SetUserAction(G4UserEventAction* userAction)
{ eventManager->SetUserAction(userAction); }
{
eventManager->SetUserAction(userAction);
userEventAction = userAction;
}
inline void SetUserAction(G4UserStackingAction* userAction)
{ eventManager->SetUserAction(userAction); }
{
eventManager->SetUserAction(userAction);
userStackingAction = userAction;
}
inline void SetUserAction(G4UserTrackingAction* userAction)
{ eventManager->SetUserAction(userAction); }
{
eventManager->SetUserAction(userAction);
userTrackingAction = userAction;
}
inline void SetUserAction(G4UserSteppingAction* userAction)
{ eventManager->SetUserAction(userAction); }
{
eventManager->SetUserAction(userAction);
userSteppingAction = userAction;
}
// These methods store respective user initialization and action classes.
inline const G4VUserDetectorConstruction* GetUserDetectorConstruction() const
{ return userDetector; }
inline const G4VUserPhysicsList* GetUserPhysicsList() const
{ return physicsList; }
inline const G4UserRunAction* GetUserRunAction() const
{ return userRunAction; }
inline const G4VUserPrimaryGeneratorAction* GetUserPrimaryGeneratorAction() const
{ return userPrimaryGeneratorAction; }
inline const G4UserEventAction* GetUserEventAction() const
{ return userEventAction; }
inline const G4UserStackingAction* GetUserStackingAction() const
{ return userStackingAction; }
inline const G4UserTrackingAction* GetUserTrackingAction() const
{ return userTrackingAction; }
inline const G4UserSteppingAction* GetUserSteppingAction() const
{ return userSteppingAction; }
// These methods returns respective user initialization and action classes.
public:
inline void SetRandomNumberStore(G4int i)
{ storeRandomNumberStatus = i; }
inline G4int GetRandomNumberStore() const
{ return storeRandomNumberStatus; }
public: // with description
inline void GeometryHasBeenModified()
{ geometryNeedsToBeClosed = true; }
inline void CutOffHasBeenModified()
{ cutoffInitialized = false; }
// These two methods must be invoked (or equivalent UI commands can be used)
// in case the user changes his/her detector geometry or cut off value(s) after
// Initialize() metho has been invoked. Then, at the begining of the next BeamOn(),
// all necessary re-initialization will be done.
inline void SetPauseAtBeginOfEvent(G4bool vl)
{ pauseAtBeginOfEvent = vl; }
inline void SetPauseAtEndOfEvent(G4bool vl)
{ pauseAtEndOfEvent = vl; }
// If the boolean flags are true, Pause() method of G4StateManager is invoked
// at the very begining (before generating a G4Event object) or at the end of
// each event. So that, in case a (G)UI session is defined, the user can interact.
public:
inline void SetVerboseLevel(G4int vl)
{ verboseLevel = vl; }
inline G4int GetVerboseLevel() const
@@ -172,21 +291,37 @@ class G4RunManager
inline G4bool GetGeometryToBeOptimized()
{ return geometryToBeOptimized; }
public: // with description
inline void SetNumberOfEventsToBeStored(G4int val)
{ n_perviousEventsToBeStored = val; }
// Sets the number of events to be kept after processing. That is, "val" previous
// events can be used with the most recent event for digitizing pileup. "val"+1
// previous event is deleted.
// This method must be invoked before starting the event loop.
inline const G4Run* GetCurrentRun() const
{ return currentRun; }
// Returns the pointer to the current run. This method is available for Geant4
// states of GeomClosed and EventProc.
inline const G4Event* GetCurrentEvent() const
{ return currentEvent; }
// Returns the pointer to the current event. This method is available for EventProc
// state.
inline const G4Event* GetPreviousEvent(G4int i) const
{
if(i>=1 && i<=n_perviousEventsToBeStored)
{ return (*previousEvents)[i-1]; }
return NULL;
}
// Returns the pointer to the "i" previous event. This method is availavle for
// EventProc state. In case the event loop has not yet to reach to the requested
// event, null will be returned. To use this method, SetNumberOfEventsToBeStored()
// method mentioned above must be invoked previously to the event loop.
inline void SetRunIDCounter(G4int i)
{ runIDCounter = i; }
// Set the run number counter. Initially, the counter is initialized to zero and
// incremented by one for every BeamOn().
public:
inline void SetDCtable(G4DCtable* DCtbl)
{ DCtable = DCtbl; }
};
+11 -8
View File
@@ -1,15 +1,17 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4RunMessenger.hh,v 1.1 1999/01/07 16:14:16 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4RunMessenger.hh,v 1.4.4.1 1999/12/07 20:52:58 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// GEANT 4 class header file
// class description:
//
// This is a messenger class for G4RunManager.
// Implemented commands are following;
@@ -25,10 +27,9 @@
// geometryModified * Force geometry to be closed again.
// cutoffModified * Force closssection tables to be calculated again.
// (and rebuilding physics table will be invoked)
// storeRandomNumberStatus * Set the flag for storing random number status
// restoreRandomNumberStatus * Restore the stored random number status
//
// History
// first version by Makoto Asai
// ------------------------------------------------------------
#ifndef G4RunMessenger_h
#define G4RunMessenger_h 1
@@ -36,6 +37,7 @@
class G4RunManager;
class G4UIdirectory;
class G4UIcmdWithoutParameter;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
class G4UIcmdWithABool;
class G4UIcommand;
@@ -48,7 +50,7 @@ class G4RunMessenger: public G4UImessenger
public:
G4RunMessenger(G4RunManager* runMgr);
~G4RunMessenger();
public:
void SetNewValue(G4UIcommand * command,G4String newValues);
G4String GetCurrentValue(G4UIcommand * command);
@@ -68,7 +70,8 @@ class G4RunMessenger: public G4UImessenger
G4UIcmdWithoutParameter * initCmd;
G4UIcmdWithoutParameter * geomCmd;
G4UIcmdWithoutParameter * cutCmd;
G4UIcmdWithAnInteger * storeRandCmd;
G4UIcmdWithAString * restoreRandCmd;
};
#endif
@@ -1,25 +1,24 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4UserPhysicsListMessenger.hh,v 1.3 1999/04/15 04:13:41 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4UserPhysicsListMessenger.hh,v 1.4.4.1 1999/12/07 20:52:58 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//---------------------------------------------------------------
//
// G4UserPhysicsListMessenger.hh
//
// Description:
// Class Description:
// This is a messenger class to interface to exchange information
// between ParticleUserList and UI.
//
// ------------------------------------------------------
// --
// the List of Directory and Commands
// ------------------------------------------------------
// -
// /run/particle/ Paricle control commands.
// Commands :
// SetCuts * Set default cut value
@@ -28,6 +27,7 @@
// Verbose * Set the Verbose level of G4VUserPhysicsList.
// addProcessManager * add process manager
// buildPhysicsTable * build physics table
//
// ------------------------------------------------------------
// History
// first version 09 Jan. 1998 by H.Kurashige
@@ -60,7 +60,7 @@ class G4UserPhysicsListMessenger: public G4UImessenger
G4UserPhysicsListMessenger(G4VUserPhysicsList* pParticleList);
virtual ~G4UserPhysicsListMessenger();
public:
public: // with description
virtual void SetNewValue(G4UIcommand * command,G4String newValues);
virtual G4String GetCurrentValue(G4UIcommand * command);
+15 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4UserRunAction.hh,v 1.2 1999/04/09 02:28:00 asaim Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4UserRunAction.hh,v 1.3.4.1 1999/12/07 20:52:58 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef G4UserRunAction_h
@@ -14,6 +14,18 @@
class G4Run;
// class description:
//
// This is the base class of a user's action class which defines the
// user's action at the begining and the end of each run. The user can
// override the following two methods but the user should not change
// any of the contents of G4Run object.
// virtual void BeginOfRunAction(const G4Run* aRun);
// virtual void EndOfRunAction(const G4Run* aRun);
// The user's concrete class derived from this class must be set to
// G4RunManager via G4RunManager::SetUserAction() method.
//
class G4UserRunAction
{
public:
+22 -5
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VPersistencyManager.hh,v 1.1 1999/01/07 16:14:17 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VPersistencyManager.hh,v 1.2.4.1 1999/12/07 20:52:58 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef G4VPersistencyManager_h
@@ -18,10 +18,25 @@ class G4Event;
class G4Run;
class G4VPhysicalVolume;
// class description:
//
// This is an abstract base class for persistency management. The user's
// concrete class derived from this class must be a singleton. The user
// must construct the object of his/her concrete persistency manager at
// his/her main().
// The virtual methods of Store() and Retreive() will be invoked from
// G4RunManager if the persistency manager exists.
// Even if the user does not use any ODBMS, the user can use this class
// especially for Store() methods. Writing an ASCII file for storing
// event information can be delegated to this class, for example.
//
class G4VPersistencyManager
{
public:
public: // with description
static G4VPersistencyManager* GetPersistencyManager();
// Static method to return the pointer to the singleton object.
// Note that this method does NOT create the singleton object.
protected:
G4VPersistencyManager();
@@ -32,14 +47,16 @@ class G4VPersistencyManager
private:
static G4VPersistencyManager * fPersistencyManager;
public:
public: // with description
virtual G4bool Store(const G4Event* anEvent)=0;
virtual G4bool Store(const G4Run* aRun)=0;
virtual G4bool Store(const G4VPhysicalVolume* theWorld)=0;
// Stores G4Event, G4Run, and geometry tree characterized by the world volume.
virtual G4bool Retrieve(G4Event*& anEvent)=0;
virtual G4bool Retrieve(G4Run*& aRun)=0;
virtual G4bool Retrieve(G4VPhysicalVolume*& theWorld)=0;
// Restore G4Event, G4Run, and geometry tree characterized by the world volume.
};
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VUserDetectorConstruction.hh,v 1.1 1999/01/07 16:14:17 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VUserDetectorConstruction.hh,v 1.2.4.1 1999/12/07 20:52:59 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef G4VUserDetectorConstruction_h
@@ -14,6 +14,15 @@
class G4VPhysicalVolume;
// class description:
//
// This is the abstract base class of the user's mandatory initialization class
// for detector setup. It has only one pure virtual method Construct() which is
// invoked by G4RunManager when it's Initialize() method is invoked.
// The Construct() method must return the G4VPhysicalVolume pointer which represents
// the world volume.
//
class G4VUserDetectorConstruction
{
public:
+25 -24
View File
@@ -1,17 +1,17 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VUserPhysicsList.hh,v 1.4 1999/04/16 09:32:05 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VUserPhysicsList.hh,v 1.5 1999/11/07 13:11:49 kurasige Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// Class Description:
// This class is an abstruct class for
// constructing particles and processes.
// User must implement following four virtual methods
@@ -23,7 +23,8 @@
// G4VUserPhysicsList::SetCuts()
// set cut values in range to all particles
// (and rebuilding physics table will be invoked )
//
//
// -------------------------------------------
// History
// first version 09 Jan. 1998 by H.Kurashige
// modified 24 Jan. 1998 by H.Kurashige
@@ -54,17 +55,17 @@ class G4UserPhysicsListMessenger;
class G4VUserPhysicsList
{
public:
public:
G4VUserPhysicsList();
virtual ~G4VUserPhysicsList();
public:
public: // with description
// By calling the "Construct" method,
// particles and processes are created
void Construct();
protected:
protected: // with description
// These two methods of ConstructParticle() and ConstructProcess()
// will be invoked in the Construct() method.
@@ -75,7 +76,7 @@ class G4VUserPhysicsList
// registered to the process manager of each particle type
virtual void ConstructProcess() = 0;
protected:
protected: // with description
// User must invoke this method in his ConstructProcess()
// implementation in order to insures particle transportation.
// !! Caution: this class must not be overriden !!
@@ -87,16 +88,16 @@ class G4VUserPhysicsList
// in the particle table
virtual void SetCuts() = 0;
protected:
protected: // with description
// "SetCutsWithDefault" method sets a cut value with the default
// cut values for all particle types in the particle table
void SetCutsWithDefault();
public:
public: // with description
//
void BuildPhysicsTable(G4ParticleDefinition* );
protected:
protected: // with description
// Following are utility methods for SetCuts/reCalcCuts
// Reset cut values in energy for all particle types
@@ -131,7 +132,7 @@ class G4VUserPhysicsList
// to all particle types which have not be called SetCuts() methods yet.
void ReCalcCutValueForOthers();
public:
public: // with description
// set/get the default cut value
// Calling SetDefaultCutValue causes re-calcuration of cut values
// and physics tables just before the next event loop
@@ -143,27 +144,27 @@ class G4VUserPhysicsList
G4double defaultCutValue;
/////////////////////////////////////
public:
public: // with description
// Print out the List of registered particles types
void DumpList() const;
public:
public: // with description
// Print out information of cut values
void DumpCutValuesTable() const;
void DumpCutValues(const G4String &particle_name = "ALL") const;
void DumpCutValues(G4ParticleDefinition* ) const;
protected:
protected: // with description
// adds new ProcessManager to all particles in the Particle Table
// this routine is used in Construct()
void InitializeProcessManager();
public:
public: // with description
// remove and delete ProcessManagers for all particles in tha Particle Table
// this routine is invoked from RunManager
void RemoveProcessManager();
public:
public: // with description
// add process manager for particles created on-the-fly
void AddProcessManager(G4ParticleDefinition* newParticle,
G4ProcessManager* newManager = NULL );
@@ -173,21 +174,21 @@ class G4VUserPhysicsList
G4ParticleTable* theParticleTable;
G4ParticleTable::G4PTblDicIterator* theParticleIterator;
protected:
protected:
// pointer to G4UserPhysicsListMessenger
G4UserPhysicsListMessenger* theMessenger;
public:
public: // with description
void SetVerboseLevel(G4int value);
G4int GetVerboseLevel() const;
protected:
G4int verboseLevel;
// controle flag for output message
// set/get controle flag for output message
// 0: Silent
// 1: Warning message
// 2: More
protected:
G4int verboseLevel;
};
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VUserPrimaryGeneratorAction.hh,v 1.1 1999/01/07 16:14:17 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VUserPrimaryGeneratorAction.hh,v 1.2.4.1 1999/12/07 20:52:59 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef G4VUserPrimaryGeneratorAction_h
@@ -14,6 +14,19 @@
class G4Event;
// class description:
//
// This is the abstract base class of the user's mandatory action class
// for primary vertex/particle generation. This class has only one pure
// virtual method GeneratePrimaries() which is invoked from G4RunManager
// during the event loop.
// Note that this class is NOT intended for generating primary vertex/particle
// by itself. This class should
// - have one or more G4VPrimaryGenerator concrete classes such as G4ParticleGun
// - set/change properties of generator(s)
// - pass G4Event object so that the generator(s) can generate primaries.
//
class G4VUserPrimaryGeneratorAction
{
public:
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Run.cc,v 1.1 1999/01/07 16:14:17 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4Run.cc,v 1.1.10.1 1999/12/07 20:52:59 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "G4Run.hh"
+56 -7
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4RunManager.cc,v 1.5 1999/05/17 16:17:44 stesting Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4RunManager.cc,v 1.10.2.1 1999/12/07 20:52:59 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
@@ -16,6 +16,7 @@
#include "G4RunManager.hh"
#include "Randomize.hh"
#include "G4Run.hh"
#include "G4RunMessenger.hh"
#include "G4VUserDetectorConstruction.hh"
@@ -36,6 +37,12 @@
#include "G4VVisManager.hh"
#include "G4ios.hh"
#ifdef WIN32
# include <Strstrea.h>
#else
# include <strstream.h>
#endif
G4RunManager* G4RunManager::fRunManager = NULL;
@@ -44,12 +51,14 @@ G4RunManager* G4RunManager::GetRunManager()
G4RunManager::G4RunManager()
:userDetector(NULL),physicsList(NULL),
userRunAction(NULL),userPrimaryGeneratorAction(NULL),
userRunAction(NULL),userPrimaryGeneratorAction(NULL),userEventAction(NULL),
userStackingAction(NULL),userTrackingAction(NULL),userSteppingAction(NULL),
currentRun(NULL),currentEvent(NULL),n_perviousEventsToBeStored(0),
geometryInitialized(false),physicsInitialized(false),cutoffInitialized(false),
geometryNeedsToBeClosed(true),initializedAtLeastOnce(false),
runAborted(false),pauseAtBeginOfEvent(false),pauseAtEndOfEvent(false),
geometryToBeOptimized(true),verboseLevel(0),DCtable(NULL),runIDCounter(0)
geometryToBeOptimized(true),verboseLevel(0),DCtable(NULL),runIDCounter(0),
storeRandomNumberStatus(0)
{
if(fRunManager)
{ G4Exception("G4RunManager constructed twice."); }
@@ -58,9 +67,15 @@ G4RunManager::G4RunManager()
eventManager = new G4EventManager();
timer = new G4Timer();
runMessenger = new G4RunMessenger(this);
previousEvents = new RWTPtrOrderedVector<G4Event>;
previousEvents = new G4RWTPtrOrderedVector<G4Event>;
G4ParticleTable::GetParticleTable()->CreateMessenger();
G4ProcessTable::GetProcessTable()->CreateMessenger();
G4cout
<< "**********************************************" << endl
<< " Geant4 version $Name: geant4-01-00 $" << endl
<< " (07-Dec-99)" << endl
<< " Copyright : Geant4 Collaboration" << endl
<< "**********************************************" << endl;
}
G4RunManager::~G4RunManager()
@@ -188,6 +203,9 @@ void G4RunManager::RunInitialization()
{ previousEvents->insert((G4Event*)NULL); }
runAborted = false;
if(storeRandomNumberStatus==1 || storeRandomNumberStatus==-1) StoreRandomNumberStatus();
if(verboseLevel>0) G4cout << "Start Run processing." << endl;
}
@@ -212,6 +230,7 @@ void G4RunManager::DoEventLoop(G4int n_event,const char* macroFile,G4int n_selec
for( i_event=0; i_event<n_event; i_event++ )
{
stateManager->SetNewState(EventProc);
if(pauseAtBeginOfEvent) stateManager->Pause("BeginOfEvent");
currentEvent = GenerateEvent(i_event);
@@ -248,7 +267,11 @@ G4Event* G4RunManager::GenerateEvent(G4int i_event)
G4Exception
("G4RunManager::BeamOn - G4VUserPrimaryGeneratorAction is not defined.");
}
G4Event* anEvent = new G4Event(i_event);
if(storeRandomNumberStatus==2 || storeRandomNumberStatus==-2) StoreRandomNumberStatus(anEvent->GetEventID());
userPrimaryGeneratorAction->GeneratePrimaries(anEvent);
return anEvent;
}
@@ -376,7 +399,33 @@ void G4RunManager::DefineWorldVolume(G4VPhysicalVolume* worldVol)
geometryNeedsToBeClosed = true;
}
void G4RunManager::StoreRandomNumberStatus(G4int eventID)
{
G4String fileN = "RandEngine";
if(storeRandomNumberStatus>0 && currentRun != NULL)
{
char st[20];
ostrstream os(st,20);
os << currentRun->GetRunID() << '\0';
fileN += "R";
fileN += st;
}
if(storeRandomNumberStatus==2 && eventID>=0)
{
char st[20];
ostrstream os(st,20);
os << eventID << '\0';
fileN += "E";
fileN += st;
}
fileN += ".stat";
HepRandom::saveEngineStatus(fileN);
}
void G4RunManager::RestoreRandomNumberStatus(G4String fileN)
{
HepRandom::restoreEngineStatus(fileN);
}
+42 -3
View File
@@ -1,18 +1,19 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4RunMessenger.cc,v 1.1 1999/01/07 16:14:18 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4RunMessenger.cc,v 1.4.8.1 1999/12/07 20:52:59 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "G4RunMessenger.hh"
#include "G4RunManager.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithoutParameter.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithABool.hh"
#include "G4UIcommand.hh"
@@ -105,6 +106,36 @@ G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
cutCmd->SetGuidance(" if cutoff value(s) have been modified after the");
cutCmd->SetGuidance(" first initialization (or BeamOn).");
cutCmd->AvailableForStates(PreInit,Idle);
storeRandCmd = new G4UIcmdWithAnInteger("/run/storeRandomNumberStatus",this);
storeRandCmd->SetGuidance("Store the status of the random number engine to a file.");
storeRandCmd->SetGuidance("See CLHEP manual for detail.");
storeRandCmd->SetGuidance("Frequency : 0 - not stored");
storeRandCmd->SetGuidance(" 1 - begining of each run");
storeRandCmd->SetGuidance(" -1 - begining of each run (file overwritten)");
storeRandCmd->SetGuidance(" 2 - begining of each event before generating primaries");
storeRandCmd->SetGuidance(" -2 - begining of each event before generating primaries (file overwritten)");
storeRandCmd->SetGuidance("Stored status can be restored by ");
storeRandCmd->SetGuidance(" /run/restoreRandomNumberStatus command.");
storeRandCmd->SetGuidance("In case Frequency is negative, a output file (file name RandEngine.stat)");
storeRandCmd->SetGuidance(" is overwitten every time.");
storeRandCmd->SetGuidance("In case Frequency is 1, file names are RandEngineRxxx.stat,");
storeRandCmd->SetGuidance(" where xxx is the run number.");
storeRandCmd->SetGuidance("In case Frequency is 2, file names are RandEngineRxxxEyyy.stat,");
storeRandCmd->SetGuidance(" where xxx is the run number and yyy is the event number.");
storeRandCmd->AvailableForStates(PreInit,Idle);
storeRandCmd->SetParameterName("frequency",true);
storeRandCmd->SetDefaultValue(1);
storeRandCmd->SetRange("frequency >=-2 && frequency <=2");
restoreRandCmd = new G4UIcmdWithAString("/run/restoreRandomNumberStatus",this);
restoreRandCmd->SetGuidance("Restore the status of the random number engine from a file.");
restoreRandCmd->SetGuidance("See CLHEP manual for detail.");
restoreRandCmd->SetGuidance("The engine status must be stored beforehand.");
restoreRandCmd->SetParameterName("fileName",true);
restoreRandCmd->SetDefaultValue("RandEngine.stat");
restoreRandCmd->AvailableForStates(PreInit,Idle,GeomClosed);
}
G4RunMessenger::~G4RunMessenger()
@@ -118,6 +149,8 @@ G4RunMessenger::~G4RunMessenger()
delete initCmd;
delete geomCmd;
delete cutCmd;
delete storeRandCmd;
delete restoreRandCmd;
delete runDirectory;
}
@@ -151,6 +184,10 @@ void G4RunMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
{ runManager->GeometryHasBeenModified(); }
else if( command==cutCmd )
{ runManager->CutOffHasBeenModified(); }
else if( command==storeRandCmd )
{ runManager->SetRandomNumberStore(storeRandCmd->GetNewIntValue(newValue)); }
else if( command==restoreRandCmd )
{ runManager->RestoreRandomNumberStatus(newValue); }
}
G4String G4RunMessenger::GetCurrentValue(G4UIcommand * command)
@@ -159,6 +196,8 @@ G4String G4RunMessenger::GetCurrentValue(G4UIcommand * command)
if( command==verboseCmd )
{ cv = verboseCmd->ConvertToString(runManager->GetVerboseLevel()); }
else if( command==storeRandCmd )
{ cv = storeRandCmd->ConvertToString(runManager->GetRandomNumberStore()); }
return cv;
}
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4UserPhysicsListMessenger.cc,v 1.2 1999/04/14 10:45:58 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4UserPhysicsListMessenger.cc,v 1.2.8.1 1999/12/07 20:52:59 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//---------------------------------------------------------------
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4UserRunAction.cc,v 1.2 1999/04/09 02:28:10 asaim Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4UserRunAction.cc,v 1.2.8.1 1999/12/07 20:53:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "G4UserRunAction.hh"
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VPersistencyManager.cc,v 1.1 1999/01/07 16:14:19 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VPersistencyManager.cc,v 1.1.10.1 1999/12/07 20:53:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "G4VPersistencyManager.hh"
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VUserDetectorConstruction.cc,v 1.1 1999/01/07 16:14:19 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VUserDetectorConstruction.cc,v 1.1.10.1 1999/12/07 20:53:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "G4VUserDetectorConstruction.hh"
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VUserPhysicsList.cc,v 1.7 1999/05/21 04:25:47 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VUserPhysicsList.cc,v 1.7.8.1 1999/12/07 20:53:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ------------------------------------------------------------
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VUserPrimaryGeneratorAction.cc,v 1.1 1999/01/07 16:14:19 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VUserPrimaryGeneratorAction.cc,v 1.1.10.1 1999/12/07 20:53:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "G4VUserPrimaryGeneratorAction.hh"