Import Geant4 5.1.0 source tree
This commit is contained in:
+69
-1
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.70 2002/12/12 08:35:54 gcosmo Exp $
|
||||
$Id: History,v 1.90 2003/04/29 08:29:15 gcosmo Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,74 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Apr 29, 2003, M.Asai (run-V05-00-17)
|
||||
- G4UserPhysicsListMessenger.cc: changed implementation in
|
||||
SetNewValue() for command 'setCutRCmd' to allow porting on
|
||||
gcc-3.2 and WIN32-VC. Use istrstream instead of G4Tokenizer.
|
||||
|
||||
Apr 25, 2003, G.Cosmo (run-V05-00-16)
|
||||
- G4VUserPhysicsList.cc: fixed typo in definition of ResetCuts().
|
||||
|
||||
Apr 24, 2003, M.Asai (run-V05-00-15)
|
||||
- Invoke BuildPhysicsTable for dynamically created ions.
|
||||
|
||||
Apr 23, 2003, M.Asai (run-V05-00-14)
|
||||
- Add a data member to G4Run.
|
||||
|
||||
Apr 23, 2003, G.Cosmo (run-V05-00-13)
|
||||
- Changed date for release 5.1 in G4RunManager.
|
||||
|
||||
Apr 16, 2003, M.Asai (run-V05-00-12)
|
||||
- Remove features in tag run-05-00-09 but include later tags.
|
||||
|
||||
Apr 14, 2003, M.Asai (run-V05-00-11)
|
||||
- Recover /run/particle/dumpCutValues command.
|
||||
|
||||
Apr 11, 2003, M.Asai (run-V05-00-10)
|
||||
- Recover /run/particle/applyCuts command.
|
||||
|
||||
Apr 03, 2003, M.Asai (run-V05-00-09)
|
||||
- G4RunManager::DefineWorldVolume() now invokes ResetNavigator().
|
||||
|
||||
Mar 17, 2003, M.Asai (run-V05-00-08)
|
||||
- Recover obsolete commands of /run/particle.
|
||||
|
||||
Mar 14, 2003, H.Kurashige (run-V05-00-07)
|
||||
- Revert G4VUserPhysicsList::ResetCuts
|
||||
|
||||
Mar 11, 2003, M.Asai (run-V05-00-06)
|
||||
- Added commands for SetCuts.
|
||||
- Implemented store/retreive physics list.
|
||||
- Removed BuildPhysicsTable from Initialize and moved to BeamOn
|
||||
|
||||
Mar 10, 2003, M.Asai (run-V05-00-05)
|
||||
- Added GenerateRun method in G4UserRunAction.
|
||||
|
||||
Feb 19, 2003, G.Cosmo (run-V05-00-04)
|
||||
- Moved warning for usage of SetCutValueForOthers() from G4cerr to G4cout.
|
||||
|
||||
Jan 31, 2003, M.Asai (run-V05-00-03)
|
||||
- Fixed initialisation of world-volume pointer in DefineWorldVolume(), to
|
||||
make it not-ambiguous.
|
||||
|
||||
Jan 30, 2003, M.Asai (run-V05-00-02)
|
||||
- Removed call to RemoveRootLogicalVolume() in method DefineWorldVolume().
|
||||
Now root regions are deregistered directly from the logical volume store,
|
||||
when the destructor of a logical volume is invoked.
|
||||
|
||||
Jan 14, 2003, M.Asai (run-V05-00-01)
|
||||
- Fix problems in run-V05-00-00 tag
|
||||
|
||||
Dec 16, 2002, G.Cosmo (run-V05-00-00)
|
||||
- Merged branch "geant4-04-01-ref-02-cuts-branch" to HEAD.
|
||||
Included development for 'cuts-by-region':
|
||||
o In G4VUserPhysicsList, removed the following methods:
|
||||
ReCalcCutValue(), SetCutValueForOthers(), SetCutValueForOtherThan(),
|
||||
ReCalcCutValueForOthers(), StoreMaterialInfo(), StoreCutValues(),
|
||||
RetrieveCutValues(), CheckForRetrievePhysicsTable(), CheckMaterialInfo().
|
||||
Added method BuildPhysicsTable().
|
||||
o Modified G4RunManger to properly handle new cuts scheme based on regions.
|
||||
|
||||
Dec 12, 2002, G.Cosmo (run-V04-01-07)
|
||||
- Updated date to G4RunManager.cc for release 5.0.
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ExceptionHandler.hh,v 1.1 2002/08/19 18:33:29 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Run.hh,v 1.4 2001/07/11 10:08:32 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4Run.hh,v 1.7 2003/04/23 17:54:17 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#ifndef G4Run_h
|
||||
@@ -53,9 +53,16 @@ class G4Run
|
||||
protected:
|
||||
G4int runID;
|
||||
G4int numberOfEvent;
|
||||
G4int numberOfEventToBeProcessed;
|
||||
G4HCtable* HCtable;
|
||||
G4DCtable* DCtable;
|
||||
|
||||
public: // with description
|
||||
virtual void RecordEvent(const G4Event*)
|
||||
{ numberOfEvent++; }
|
||||
// Method to be overwritten by the user for recording events in this run.
|
||||
// In such a case, it is the user's responsibility to increment numberOfEvent.
|
||||
|
||||
public: // with description
|
||||
inline G4int GetRunID() const
|
||||
{ return runID; }
|
||||
@@ -64,6 +71,8 @@ class G4Run
|
||||
{ return numberOfEvent; }
|
||||
// Returns number of events processed in this run. The number is
|
||||
// incremented at the end of each event processing.
|
||||
inline G4int GetNumberOfEventToBeProcessed() const
|
||||
{ return numberOfEventToBeProcessed; }
|
||||
inline const G4HCtable* GetHCtable() const
|
||||
{ return HCtable; }
|
||||
// List of names of hits collection
|
||||
@@ -73,8 +82,8 @@ class G4Run
|
||||
public:
|
||||
inline void SetRunID(G4int id)
|
||||
{ runID = id; }
|
||||
inline virtual void RecordEvent(G4Event*)
|
||||
{ numberOfEvent++; }
|
||||
inline void SetNumberOfEventToBeProcessed(G4int n_ev)
|
||||
{ numberOfEventToBeProcessed = n_ev; }
|
||||
inline void SetHCtable(G4HCtable* HCtbl)
|
||||
{ HCtable = HCtbl; }
|
||||
inline void SetDCtable(G4DCtable* DCtbl)
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManager.hh,v 1.26 2002/11/27 17:55:07 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4RunManager.hh,v 1.32 2003/04/23 17:54:27 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -76,6 +76,7 @@ class G4UserTrackingAction;
|
||||
class G4UserSteppingAction;
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
class G4Region;
|
||||
class G4Timer;
|
||||
class G4RunMessenger;
|
||||
class G4DCtable;
|
||||
@@ -177,6 +178,9 @@ class G4RunManager
|
||||
// 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.
|
||||
|
||||
virtual void BuildPhysicsTables();
|
||||
// This method is invoked from RunInitialization() to create physics tables.
|
||||
|
||||
virtual G4Event* GenerateEvent(G4int i_event);
|
||||
virtual void AnalyzeEvent(G4Event* anEvent);
|
||||
// These two protected methods are invoked from DoEventLoop() method at the begining
|
||||
@@ -188,6 +192,20 @@ class G4RunManager
|
||||
// AnalyzeEvent() stores an event to a data base if a concrete G4VPersistentManager
|
||||
// class is defined.
|
||||
|
||||
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(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.
|
||||
|
||||
protected:
|
||||
void StackPreviousEvent(G4Event* anEvent);
|
||||
|
||||
@@ -225,11 +243,15 @@ class G4RunManager
|
||||
G4Event* currentEvent;
|
||||
G4std::vector<G4Event*>* previousEvents;
|
||||
G4int n_perviousEventsToBeStored;
|
||||
G4int numberOfEventToBeProcessed;
|
||||
|
||||
G4bool storeRandomNumberStatus;
|
||||
G4String randomNumberStatusDir;
|
||||
G4String versionString;
|
||||
|
||||
G4VPhysicalVolume* currentWorld;
|
||||
G4Region* defaultRegion;
|
||||
|
||||
public:
|
||||
virtual void rndmSaveThisRun();
|
||||
virtual void rndmSaveThisEvent();
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunMessenger.hh,v 1.9 2002/08/08 17:29:26 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4RunMessenger.hh,v 1.11 2003/03/11 05:00:47 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// GEANT 4 class header file
|
||||
@@ -35,6 +35,8 @@
|
||||
// Commands :
|
||||
// BeamOn * Start a Run.
|
||||
// Verbose * Set the Verbose level of G4RunManager.
|
||||
// dumpRegion * Dump information of a region.
|
||||
// dumpCouples * Dump information of material-cuts-couples.
|
||||
// optimizeGeometry * Set the optimization flag of closing geometry.
|
||||
// breakAtBeginOfEvent * Set a break point at the begining of every event.
|
||||
// breakAtEndOfEvent * Set a break point at the end of every event.
|
||||
@@ -79,6 +81,8 @@ class G4RunMessenger: public G4UImessenger
|
||||
G4UIdirectory * runDirectory;
|
||||
G4UIcommand * beamOnCmd;
|
||||
G4UIcmdWithAnInteger * verboseCmd;
|
||||
G4UIcmdWithAString * dumpRegCmd;
|
||||
G4UIcmdWithoutParameter * dumpCoupleCmd;
|
||||
G4UIcmdWithABool * optCmd;
|
||||
G4UIcmdWithABool * brkBoECmd;
|
||||
G4UIcmdWithABool * brkEoECmd;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UserPhysicsListMessenger.hh,v 1.10 2001/08/03 06:02:55 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4UserPhysicsListMessenger.hh,v 1.15 2003/04/14 20:07:25 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -39,14 +39,12 @@
|
||||
// Commands :
|
||||
// SetCuts * Set default cut value
|
||||
// dumpList * Dump List of particles in G4VUserPhysicsList.
|
||||
// dumpCutValue * Dump cut value information
|
||||
// verbose * Set the Verbose level of G4VUserPhysicsList.
|
||||
// addProcessManager * add process manager
|
||||
// buildPhysicsTable * build physics table
|
||||
// storePhysicsTable * store physics table into files
|
||||
// retreivePhysicsTable * retreive physics table from files
|
||||
// setStoredInAscii * Switch on/off ascii mode in store/retreive Physics Table
|
||||
// applyCuts * Set flag for ApplyCuts
|
||||
// ------------------------------------------------------------
|
||||
// History
|
||||
// first version 09 Jan. 1998 by H.Kurashige
|
||||
@@ -68,6 +66,7 @@ class G4UIcmdWithoutParameter;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcommand;
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
@@ -91,16 +90,18 @@ public: // with description
|
||||
|
||||
private: //commands
|
||||
G4UIdirectory * theDirectory;
|
||||
G4UIcmdWithADoubleAndUnit * setPCutCmd;
|
||||
G4UIcmdWithADoubleAndUnit * setCutCmd;
|
||||
G4UIcommand * setCutRCmd;
|
||||
G4UIcmdWithAnInteger * verboseCmd;
|
||||
G4UIcmdWithoutParameter * dumpListCmd;
|
||||
G4UIcmdWithAString * dumpCutValuesCmd;
|
||||
G4UIcmdWithAString * addProcManCmd;
|
||||
G4UIcmdWithAString * buildPTCmd;
|
||||
G4UIcmdWithAString * storeCmd;
|
||||
G4UIcmdWithAString * retrieveCmd;
|
||||
G4UIcmdWithAnInteger * asciiCmd;
|
||||
G4UIcommand * applyCutsCmd;
|
||||
G4UIcommand * applyCutsCmd;
|
||||
G4UIcmdWithAString * dumpCutValuesCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UserRunAction.hh,v 1.5 2001/07/11 10:08:32 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4UserRunAction.hh,v 1.7 2003/04/04 16:45:30 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#ifndef G4UserRunAction_h
|
||||
@@ -38,6 +38,10 @@ class G4Run;
|
||||
// any of the contents of G4Run object.
|
||||
// virtual void BeginOfRunAction(const G4Run* aRun);
|
||||
// virtual void EndOfRunAction(const G4Run* aRun);
|
||||
// The user can override the following method to instanciate his/her own
|
||||
// concrete Run class. G4Run has a virtual method RecordEvent, so that
|
||||
// the user can store any information useful to him/her with event statistics.
|
||||
// virtual G4Run* GenerateRun();
|
||||
// The user's concrete class derived from this class must be set to
|
||||
// G4RunManager via G4RunManager::SetUserAction() method.
|
||||
//
|
||||
@@ -49,6 +53,7 @@ class G4UserRunAction
|
||||
virtual ~G4UserRunAction();
|
||||
|
||||
public:
|
||||
virtual G4Run* GenerateRun();
|
||||
virtual void BeginOfRunAction(const G4Run* aRun);
|
||||
virtual void EndOfRunAction(const G4Run* aRun);
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VModularPhysicsList.hh,v 1.4 2002/05/29 12:11:08 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VPersistencyManager.hh,v 1.4 2001/07/11 10:08:32 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#ifndef G4VPersistencyManager_h
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VPhysicsConstructor.hh,v 1.3 2001/11/06 06:08:04 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserDetectorConstruction.hh,v 1.4 2001/07/11 10:08:33 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#ifndef G4VUserDetectorConstruction_h
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserPhysicsList.hh,v 1.14 2001/10/16 08:35:50 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4VUserPhysicsList.hh,v 1.23 2003/04/11 11:36:21 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -65,6 +65,18 @@
|
||||
// added RetrieveCutValues and related
|
||||
// added Set/ResetStoredInAscii() to switch on ascii mode
|
||||
// for Retrieve/StorePhysicsTable
|
||||
// modified for CUTS per REGION 10, Oct 2002 by H.Kurashige
|
||||
// removed following methods
|
||||
// void ReCalcCutValue()
|
||||
// void SetCutValueForOthers()
|
||||
// void SetCutValueForOtherThan()
|
||||
// void ReCalcCutValueForOthers()
|
||||
// virtual G4bool StoreMaterialInfo()
|
||||
// virtual G4bool StoreCutValues()
|
||||
// virtual G4bool RetrieveCutValues()
|
||||
// virtual G4bool CheckForRetrievePhysicsTable()
|
||||
// virtual G4bool CheckMaterialInfo()
|
||||
// added void BuildPhysicsTable()
|
||||
// ------------------------------------------------------------
|
||||
#ifndef G4VUserPhysicsList_h
|
||||
#define G4VUserPhysicsList_h 1
|
||||
@@ -73,6 +85,7 @@
|
||||
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
|
||||
class G4UserPhysicsListMessenger;
|
||||
class G4VProcess;
|
||||
@@ -121,13 +134,15 @@ class G4VUserPhysicsList
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
public: // with description
|
||||
// Invoke BuildPhysicsTable for all processes for specified particle
|
||||
// Invoke BuildPhysicsTable for all processes for all particles
|
||||
// In case of "Retrieve" flag is ON, PhysicsTable will be
|
||||
// retrieved from files
|
||||
void BuildPhysicsTable();
|
||||
|
||||
// do BuildPhysicsTable for specified particle type
|
||||
void BuildPhysicsTable(G4ParticleDefinition* );
|
||||
|
||||
|
||||
// Store PhysicsTable together with both material and cut value
|
||||
// Store PhysicsTable together with both material and cut value
|
||||
// information in files under the specified directory.
|
||||
// (return true if files are sucessfully created)
|
||||
G4bool StorePhysicsTable(const G4String& directory = ".");
|
||||
@@ -157,10 +172,31 @@ class G4VUserPhysicsList
|
||||
void DumpList() const;
|
||||
|
||||
public: // with description
|
||||
// Print out information of cut values
|
||||
void DumpCutValuesTable() const;
|
||||
void DumpCutValues(const G4String &particle_name = "ALL") const;
|
||||
void DumpCutValues(G4ParticleDefinition* ) const;
|
||||
// Request to print out information of cut values
|
||||
// Printing will be performed when all tables are made
|
||||
void DumpCutValuesTable(G4int nParticles=3);
|
||||
|
||||
// The following method actually trigger the print-out requested
|
||||
// by the above method. This method must be invoked by RunManager
|
||||
// at the proper moment.
|
||||
void DumpCutValuesTableIfRequested();
|
||||
|
||||
void DumpCutValues(const G4String &particle_name = "ALL")
|
||||
{
|
||||
G4cerr << "WARNING !" << G4endl;
|
||||
G4cerr << " DumpCutValues() became obsolete." << G4endl;
|
||||
G4cerr << " Please use DumpCutValuesTable() instead." << G4endl;
|
||||
G4cerr << " This dummy method implementation will be removed soon." << G4endl;
|
||||
DumpCutValuesTable();
|
||||
}
|
||||
void DumpCutValues(G4ParticleDefinition* )
|
||||
{
|
||||
G4cerr << "WARNING !" << G4endl;
|
||||
G4cerr << " DumpCutValues() became obsolete." << G4endl;
|
||||
G4cerr << " Please use DumpCutValuesTable() instead." << G4endl;
|
||||
G4cerr << " This dummy method implementation will be removed soon." << G4endl;
|
||||
DumpCutValuesTable();
|
||||
}
|
||||
|
||||
public: // with description
|
||||
void SetVerboseLevel(G4int value);
|
||||
@@ -171,52 +207,32 @@ class G4VUserPhysicsList
|
||||
// 2: More
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
protected: // with description
|
||||
// "SetCutsWithDefault" method sets a cut value with the default
|
||||
// cut values for all particle types in the particle table
|
||||
public: // with description
|
||||
// "SetCutsWithDefault" method sets the default cut value
|
||||
// for all particles for the default region.
|
||||
void SetCutsWithDefault();
|
||||
|
||||
|
||||
// Following are utility methods for SetCuts/reCalcCuts
|
||||
// Following are utility methods for SetCuts
|
||||
|
||||
// Reset cut values in energy for all particle types
|
||||
// By calling this methods, the run manager will invoke
|
||||
// SetCuts() just before event loop
|
||||
void ResetCuts();
|
||||
// SetCutValue sets a cut value for a particle type for the default region
|
||||
void SetCutValue(G4double aCut, const G4String& pname);
|
||||
|
||||
// SetCutValue sets a cut value for a particle type
|
||||
void SetCutValue(G4double aCut, const G4String& name);
|
||||
void ReCalcCutValue(const G4String& name);
|
||||
// SetCutValue sets a cut value for a particle type for a region
|
||||
void SetCutValue(G4double aCut, const G4String& pname, const G4String& rname);
|
||||
|
||||
// "setCutsForOthers" method sets a cut value to all particle types
|
||||
// which have not be called SetCuts() methods yet.
|
||||
// (i.e. particles which have no definit cut values)
|
||||
void SetCutValueForOthers(G4double cutValue);
|
||||
|
||||
// "setCutsForOtherThan" sets a cut value to all particle types
|
||||
// other than particle types specified in arguments
|
||||
void SetCutValueForOtherThan(G4double cutValue,
|
||||
G4ParticleDefinition* first,
|
||||
G4ParticleDefinition* second = 0,
|
||||
G4ParticleDefinition* third = 0,
|
||||
G4ParticleDefinition* fourth = 0,
|
||||
G4ParticleDefinition* fifth = 0,
|
||||
G4ParticleDefinition* sixth = 0,
|
||||
G4ParticleDefinition* seventh = 0,
|
||||
G4ParticleDefinition* eighth = 0,
|
||||
G4ParticleDefinition* nineth = 0,
|
||||
G4ParticleDefinition* tenth = 0 );
|
||||
|
||||
// "reCalcCutsForOthers" method re-calculates a cut value
|
||||
// to all particle types which have not be called SetCuts() methods yet.
|
||||
void ReCalcCutValueForOthers();
|
||||
|
||||
// Invoke SetCuts for specified particle
|
||||
// Invoke SetCuts for specified particle for a region
|
||||
// If the pointer to the region is NULL, the default region is used
|
||||
// In case of "Retrieve" flag is ON,
|
||||
// Cut values will be retrieved from files
|
||||
void SetParticleCuts( G4double cut, G4ParticleDefinition* );
|
||||
void SetParticleCuts(G4double cut,G4ParticleDefinition* particle,G4Region* region=0);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Invoke SetCuts for all particles in a region
|
||||
void SetCutsForRegion(G4double aCut, const G4String& rname);
|
||||
|
||||
// Following are utility methods are obsolete
|
||||
void ResetCuts();
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
public:
|
||||
// Get/SetApplyCuts gets/sets the flag for ApplyCuts
|
||||
void SetApplyCuts(G4bool value, const G4String& name);
|
||||
@@ -227,6 +243,7 @@ class G4VUserPhysicsList
|
||||
// do BuildPhysicsTable for make the integral schema
|
||||
void BuildIntegralPhysicsTable(G4VProcess* ,G4ParticleDefinition* );
|
||||
|
||||
|
||||
protected:
|
||||
// Retrieve PhysicsTable from files for proccess belongng the particle.
|
||||
// Normal BuildPhysics procedure of processes will be invoked,
|
||||
@@ -235,24 +252,6 @@ class G4VUserPhysicsList
|
||||
const G4String& directory,
|
||||
G4bool ascii = false);
|
||||
|
||||
// Store material information in files under the specified directory.
|
||||
virtual G4bool StoreMaterialInfo(const G4String& directory,
|
||||
G4bool ascii = false);
|
||||
// Store cut values information in files under the specified directory.
|
||||
virtual G4bool StoreCutValues(const G4String& directory,
|
||||
G4bool ascii = false);
|
||||
|
||||
// Retrieve cut values information in files under the specified directory.
|
||||
virtual G4bool RetrieveCutValues(const G4String& directory,
|
||||
G4bool ascii = false);
|
||||
|
||||
|
||||
// check stored material and cut values
|
||||
virtual G4bool CheckForRetrievePhysicsTable(const G4String& directory,
|
||||
G4bool ascii = false);
|
||||
// check stored material is consistent with the current detector setup.
|
||||
virtual G4bool CheckMaterialInfo(const G4String& directory,
|
||||
G4bool ascii = false);
|
||||
/////////////////////////////////////////////////////////////////
|
||||
protected:
|
||||
// adds new ProcessManager to all particles in the Particle Table
|
||||
@@ -281,13 +280,16 @@ class G4VUserPhysicsList
|
||||
G4UserPhysicsListMessenger* theMessenger;
|
||||
|
||||
protected:
|
||||
G4int verboseLevel;
|
||||
G4int verboseLevel;
|
||||
|
||||
protected:
|
||||
// this is the default cut value for all particles
|
||||
G4double defaultCutValue;
|
||||
|
||||
protected:
|
||||
// pointer to ProductionCutsTable
|
||||
G4ProductionCutsTable* fCutsTable;
|
||||
|
||||
// flag to determine physics table will be build from file or not
|
||||
G4bool fRetrievePhysicsTable;
|
||||
G4bool fStoredInAscii;
|
||||
@@ -298,19 +300,24 @@ class G4VUserPhysicsList
|
||||
// directory name for physics table files
|
||||
G4String directoryPhysicsTable;
|
||||
|
||||
// number of materials in G4MaterialTable
|
||||
// (this member is used by store/restore physics table)
|
||||
G4int numberOfMaterial;
|
||||
// flag for displaying the range cuts & energy thresholds
|
||||
G4int fDisplayThreshold;
|
||||
|
||||
private:
|
||||
enum { FixedStringLengthForStore = 32 };
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Following method is for backward compatibility and removed soon
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
protected:
|
||||
enum { NumberOfParticlesForStoreCuts = 9};
|
||||
static const G4String particleForStoreCuts[NumberOfParticlesForStoreCuts];
|
||||
G4bool isBuildPhysicsTable[NumberOfParticlesForStoreCuts];
|
||||
G4int isParticleForStoreCuts(const G4ParticleDefinition*) const;
|
||||
void SetCutValueForOthers(G4double cutValue)
|
||||
{
|
||||
G4cerr << "WARNING !" << G4endl;
|
||||
G4cerr << " SetCutValueForOthers became obsolete." << G4endl;
|
||||
G4cerr << " It is harmless to remove this invokation without any side effects." << G4endl;
|
||||
G4cerr << " This dummy method implementation will be removed soon." << G4endl;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -393,9 +400,3 @@ inline
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserPrimaryGeneratorAction.hh,v 1.4 2001/07/11 10:08:33 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#ifndef G4VUserPrimaryGeneratorAction_h
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ExceptionHandler.cc,v 1.2 2002/12/04 21:52:40 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Run.cc,v 1.4 2001/07/13 15:57:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4Run.cc,v 1.5 2003/04/23 17:54:31 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#include "G4Run.hh"
|
||||
@@ -30,7 +30,7 @@
|
||||
G4Allocator<G4Run> aRunAllocator;
|
||||
|
||||
G4Run::G4Run()
|
||||
:runID(0),numberOfEvent(0),HCtable(0),DCtable(0)
|
||||
:runID(0),numberOfEvent(0),numberOfEventToBeProcessed(0),HCtable(0),DCtable(0)
|
||||
{;}
|
||||
|
||||
G4Run::~G4Run()
|
||||
|
||||
+121
-20
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManager.cc,v 1.54 2002/12/12 08:33:51 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4RunManager.cc,v 1.75 2003/04/24 17:42:06 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -43,6 +43,11 @@
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Region.hh"
|
||||
#include "G4RegionStore.hh"
|
||||
#include "G4ProductionCuts.hh"
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
#include "G4ApplicationState.hh"
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4VPersistencyManager.hh"
|
||||
@@ -51,6 +56,7 @@
|
||||
#include "G4ProcessTable.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4ExceptionHandler.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/strstream"
|
||||
@@ -83,7 +89,7 @@ G4RunManager::G4RunManager()
|
||||
geometryNeedsToBeClosed(true),runAborted(false),initializedAtLeastOnce(false),
|
||||
geometryToBeOptimized(true),runIDCounter(0),verboseLevel(0),DCtable(0),
|
||||
currentRun(0),currentEvent(0),n_perviousEventsToBeStored(0),
|
||||
storeRandomNumberStatus(false)
|
||||
numberOfEventToBeProcessed(0),storeRandomNumberStatus(false),currentWorld(0)
|
||||
{
|
||||
defaultExceptionHandler = new G4ExceptionHandler();
|
||||
if(fRunManager)
|
||||
@@ -94,10 +100,12 @@ G4RunManager::G4RunManager()
|
||||
timer = new G4Timer();
|
||||
runMessenger = new G4RunMessenger(this);
|
||||
previousEvents = new G4std::vector<G4Event*>;
|
||||
defaultRegion = new G4Region("DefaultRegionForTheWorld");
|
||||
defaultRegion->SetProductionCuts(G4ProductionCutsTable::GetProductionCutsTable()->GetDefaultProductionCuts());
|
||||
G4ParticleTable::GetParticleTable()->CreateMessenger();
|
||||
G4ProcessTable::GetProcessTable()->CreateMessenger();
|
||||
randomNumberStatusDir = "./";
|
||||
versionString = " Geant4 version $Name: geant4-05-00 $\n (13-Dec-2002)";
|
||||
versionString = " Geant4 version $Name: geant4-05-01 $\n (30-Apr-2003)";
|
||||
G4cout
|
||||
<< "**********************************************" << G4endl
|
||||
<< versionString << G4endl
|
||||
@@ -166,8 +174,9 @@ void G4RunManager::BeamOn(G4int n_event,const char* macroFile,G4int n_select)
|
||||
G4bool cond = ConfirmBeamOnCondition();
|
||||
if(cond)
|
||||
{
|
||||
numberOfEventToBeProcessed = n_event;
|
||||
RunInitialization();
|
||||
DoEventLoop(n_event,macroFile,n_select);
|
||||
if(n_event>0) DoEventLoop(n_event,macroFile,n_select);
|
||||
RunTermination();
|
||||
}
|
||||
}
|
||||
@@ -190,26 +199,33 @@ G4bool G4RunManager::ConfirmBeamOnCondition()
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!(geometryInitialized && physicsInitialized && cutoffInitialized))
|
||||
if(!geometryInitialized || !physicsInitialized || !cutoffInitialized)
|
||||
{
|
||||
if(verboseLevel>0)
|
||||
{
|
||||
G4cout << "Start re-initialization because " << G4endl;
|
||||
if(!geometryInitialized) G4cout << " Geometry" << G4endl;
|
||||
if(!physicsInitialized) G4cout << " Physics processes" << G4endl;
|
||||
if(!cutoffInitialized) G4cout << " Cutoff" << G4endl;
|
||||
if(!cutoffInitialized) G4cout << " SetCuts" << G4endl;
|
||||
G4cout << "has been modified since last Run." << G4endl;
|
||||
}
|
||||
Initialize();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void G4RunManager::RunInitialization()
|
||||
{
|
||||
currentRun = new G4Run();
|
||||
currentRun = 0;
|
||||
if(userRunAction) currentRun = userRunAction->GenerateRun();
|
||||
if(!currentRun) currentRun = new G4Run();
|
||||
|
||||
G4StateManager* stateManager = G4StateManager::GetStateManager();
|
||||
stateManager->SetNewState(G4State_GeomClosed);
|
||||
currentRun->SetRunID(runIDCounter);
|
||||
currentRun->SetNumberOfEventToBeProcessed(numberOfEventToBeProcessed);
|
||||
|
||||
BuildPhysicsTables();
|
||||
|
||||
currentRun->SetDCtable(DCtable);
|
||||
G4SDManager* fSDM = G4SDManager::GetSDMpointerIfExist();
|
||||
@@ -225,8 +241,6 @@ void G4RunManager::RunInitialization()
|
||||
geomManager->CloseGeometry(geometryToBeOptimized, verboseLevel>1);
|
||||
geometryNeedsToBeClosed = false;
|
||||
}
|
||||
G4StateManager* stateManager = G4StateManager::GetStateManager();
|
||||
stateManager->SetNewState(G4State_GeomClosed);
|
||||
|
||||
//previousEvents->clearAndDestroy();
|
||||
for(size_t itr=0;itr<previousEvents->size();itr++)
|
||||
@@ -369,7 +383,7 @@ void G4RunManager::Initialize()
|
||||
if(!physicsInitialized) InitializePhysics();
|
||||
if(!cutoffInitialized) InitializeCutOff();
|
||||
stateManager->SetNewState(G4State_Idle);
|
||||
if(!initializedAtLeastOnce) initializedAtLeastOnce = true;
|
||||
initializedAtLeastOnce = true;
|
||||
}
|
||||
|
||||
void G4RunManager::InitializeGeometry()
|
||||
@@ -405,8 +419,34 @@ void G4RunManager::InitializeCutOff()
|
||||
{
|
||||
if(verboseLevel>1) G4cout << "physicsList->setCut() start." << G4endl;
|
||||
physicsList->SetCuts();
|
||||
cutoffInitialized = true;
|
||||
}
|
||||
cutoffInitialized = true;
|
||||
else
|
||||
{
|
||||
G4Exception("G4VUserPhysicsList is not defined");
|
||||
}
|
||||
}
|
||||
|
||||
void G4RunManager::BuildPhysicsTables()
|
||||
{
|
||||
UpdateRegion();
|
||||
|
||||
// Let G4ProductionCutsTable create new couples
|
||||
G4ProductionCutsTable::GetProductionCutsTable()->UpdateCoupleTable();
|
||||
|
||||
if(G4ProductionCutsTable::GetProductionCutsTable()->IsModified())
|
||||
{
|
||||
physicsList->BuildPhysicsTable();
|
||||
G4ProductionCutsTable::GetProductionCutsTable()->PhysicsTableUpdated();
|
||||
}
|
||||
|
||||
physicsList->DumpCutValuesTableIfRequested();
|
||||
}
|
||||
|
||||
void G4RunManager::UpdateRegion()
|
||||
{
|
||||
// Let G4RegionStore scan materials
|
||||
G4RegionStore::GetInstance()->UpdateMaterialList();
|
||||
}
|
||||
|
||||
void G4RunManager::AbortRun(G4bool softAbort)
|
||||
@@ -447,16 +487,45 @@ void G4RunManager::AbortEvent()
|
||||
|
||||
void G4RunManager::DefineWorldVolume(G4VPhysicalVolume* worldVol)
|
||||
{
|
||||
// check if this is different from previous
|
||||
//////if(currentWorld==worldVol) return;
|
||||
// The world volume MUST NOT have a region defined by the user.
|
||||
if(worldVol->GetLogicalVolume()->GetRegion())
|
||||
{
|
||||
if(worldVol->GetLogicalVolume()->GetRegion()!=defaultRegion)
|
||||
{
|
||||
G4cerr << "The world volume has a user-defined region <"
|
||||
<< worldVol->GetLogicalVolume()->GetRegion()->GetName()
|
||||
<< ">." << G4endl;
|
||||
G4Exception("G4RunManager::DefineWorldVolume",
|
||||
"RUN:WorldHasUserDefinedRegion",
|
||||
FatalException,
|
||||
"World would have a default region assigned by RunManager.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the default region to the world
|
||||
G4LogicalVolume* worldLog = worldVol->GetLogicalVolume();
|
||||
worldLog->SetRegion(defaultRegion);
|
||||
defaultRegion->AddRootLogicalVolume(worldLog);
|
||||
}
|
||||
|
||||
currentWorld = worldVol;
|
||||
//geometryNeedsToBeClosed = true;
|
||||
GeometryHasBeenModified();
|
||||
|
||||
// set the world volume to the Navigator
|
||||
//ResetNavigator();
|
||||
G4TransportationManager::GetTransportationManager()
|
||||
->GetNavigatorForTracking()
|
||||
->SetWorldVolume(worldVol);
|
||||
//ResetNavigator();
|
||||
|
||||
// Let VisManager know it
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if(pVVisManager) pVVisManager->GeometryHasChanged();
|
||||
|
||||
geometryNeedsToBeClosed = true;
|
||||
}
|
||||
|
||||
void G4RunManager::ResetNavigator() const
|
||||
@@ -464,12 +533,7 @@ void G4RunManager::ResetNavigator() const
|
||||
G4StateManager* stateManager = G4StateManager::GetStateManager();
|
||||
G4ApplicationState currentState = stateManager->GetCurrentState();
|
||||
|
||||
if(!initializedAtLeastOnce)
|
||||
{
|
||||
G4cerr << " Geant4 kernel should be initialized" << G4endl;
|
||||
G4cerr << " Navigator is not touched..." << G4endl;
|
||||
return;
|
||||
}
|
||||
if(!initializedAtLeastOnce) return;
|
||||
|
||||
if( currentState != G4State_Idle )
|
||||
{
|
||||
@@ -542,3 +606,40 @@ void G4RunManager::RestoreRandomNumberStatus(G4String fileN)
|
||||
<< fileNameWithDirectory << G4endl;
|
||||
HepRandom::showEngineStatus();
|
||||
}
|
||||
|
||||
void G4RunManager::DumpRegion(G4String rname) const
|
||||
{
|
||||
G4Region* region = G4RegionStore::GetInstance()->GetRegion(rname);
|
||||
if(region) DumpRegion(region);
|
||||
}
|
||||
|
||||
void G4RunManager::DumpRegion(G4Region* region) const
|
||||
{
|
||||
if(!region)
|
||||
{
|
||||
for(size_t i=0;i<G4RegionStore::GetInstance()->size();i++)
|
||||
{ DumpRegion((*(G4RegionStore::GetInstance()))[i]); }
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout << "Region " << region->GetName() << G4endl;
|
||||
G4cout << " Materials : ";
|
||||
G4std::vector<G4Material*>::const_iterator mItr = region->GetMaterialIterator();
|
||||
size_t nMaterial = region->GetNumberOfMaterials();
|
||||
for(size_t iMate=0;iMate<nMaterial;iMate++)
|
||||
{
|
||||
G4cout << (*mItr)->GetName() << " ";
|
||||
mItr++;
|
||||
}
|
||||
G4cout << G4endl;
|
||||
G4ProductionCuts* cuts = region->GetProductionCuts();
|
||||
G4cout << " Production cuts : "
|
||||
<< " gamma " << G4BestUnit(cuts->GetProductionCut("gamma"),"Length")
|
||||
<< " e- " << G4BestUnit(cuts->GetProductionCut("e-"),"Length")
|
||||
<< " e+ " << G4BestUnit(cuts->GetProductionCut("e+"),"Length")
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunMessenger.cc,v 1.12 2002/12/04 21:52:40 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4RunMessenger.cc,v 1.17 2003/04/03 18:43:32 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#include "G4RunMessenger.hh"
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4UIparameter.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/strstream"
|
||||
|
||||
@@ -64,7 +65,7 @@ G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
|
||||
beamOnCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
G4UIparameter* p1 = new G4UIparameter("numberOfEvent",'i',true);
|
||||
p1->SetDefaultValue(1);
|
||||
p1->SetParameterRange("numberOfEvent > 0");
|
||||
p1->SetParameterRange("numberOfEvent >= 0");
|
||||
beamOnCmd->SetParameter(p1);
|
||||
G4UIparameter* p2 = new G4UIparameter("macroFile",'s',true);
|
||||
p2->SetDefaultValue("***NULL***");
|
||||
@@ -83,6 +84,19 @@ G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
|
||||
verboseCmd->SetDefaultValue(0);
|
||||
verboseCmd->SetRange("level >=0 && level <=2");
|
||||
|
||||
dumpRegCmd = new G4UIcmdWithAString("/run/dumpRegion",this);
|
||||
dumpRegCmd->SetGuidance("Dump region information.");
|
||||
dumpRegCmd->SetGuidance("In case name of a region is not given, all regions will be displayed.");
|
||||
dumpRegCmd->SetParameterName("regionName", true);
|
||||
dumpRegCmd->SetDefaultValue("**ALL**");
|
||||
dumpRegCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
dumpCoupleCmd = new G4UIcmdWithoutParameter("/run/dumpCouples",this);
|
||||
dumpCoupleCmd->SetGuidance("Dump material-cuts-couple information.");
|
||||
dumpCoupleCmd->SetGuidance("Note that material-cuts-couple information is updated");
|
||||
dumpCoupleCmd->SetGuidance("after BeamOn has started.");
|
||||
dumpCoupleCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
optCmd = new G4UIcmdWithABool("/run/optimizeGeometry",this);
|
||||
optCmd->SetGuidance("Set the optimization flag for geometry.");
|
||||
optCmd->SetGuidance("If it is set to TRUE, G4GeometryManager will optimize");
|
||||
@@ -196,6 +210,8 @@ G4RunMessenger::~G4RunMessenger()
|
||||
delete beamOnCmd;
|
||||
delete verboseCmd;
|
||||
delete optCmd;
|
||||
delete dumpRegCmd;
|
||||
delete dumpCoupleCmd;
|
||||
delete brkBoECmd;
|
||||
delete brkEoECmd;
|
||||
delete abortCmd;
|
||||
@@ -230,6 +246,18 @@ void G4RunMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
}
|
||||
else if( command==verboseCmd )
|
||||
{ runManager->SetVerboseLevel(verboseCmd->GetNewIntValue(newValue)); }
|
||||
else if( command==dumpRegCmd )
|
||||
{
|
||||
runManager->UpdateRegion();
|
||||
if(newValue=="**ALL**")
|
||||
{ runManager->DumpRegion(); }
|
||||
else
|
||||
{ runManager->DumpRegion(newValue); }
|
||||
}
|
||||
else if( command==dumpCoupleCmd)
|
||||
{
|
||||
G4ProductionCutsTable::GetProductionCutsTable()->DumpCouples();
|
||||
}
|
||||
else if( command==optCmd )
|
||||
{ runManager->SetGeometryToBeOptimized(optCmd->GetNewBoolValue(newValue)); }
|
||||
else if( command==brkBoECmd )
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UserPhysicsListMessenger.cc,v 1.11 2002/12/04 21:52:40 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4UserPhysicsListMessenger.cc,v 1.22 2003/04/28 22:54:37 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -49,6 +49,7 @@
|
||||
|
||||
G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(G4VUserPhysicsList* pParticleList):thePhysicsList(pParticleList)
|
||||
{
|
||||
G4UIparameter* param = 0;
|
||||
// /run/particle directory
|
||||
theDirectory = new G4UIdirectory("/run/particle/");
|
||||
theDirectory->SetGuidance("Commands for G4VUserPhysicsList.");
|
||||
@@ -64,29 +65,43 @@ G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(G4VUserPhysicsList* pPart
|
||||
verboseCmd->SetRange("level >=0 && level <=3");
|
||||
|
||||
// /run/particle/setCut command
|
||||
setCutCmd = new G4UIcmdWithADoubleAndUnit("/run/particle/setCut",this);
|
||||
setPCutCmd = new G4UIcmdWithADoubleAndUnit("/run/particle/setCut",this);
|
||||
setPCutCmd->SetGuidance("Set default cut value ");
|
||||
setPCutCmd->SetGuidance("This command is equivallent to /run/setCut command.");
|
||||
setPCutCmd->SetGuidance("This command is kept for backward compatibility.");
|
||||
setPCutCmd->SetParameterName("cut",false);
|
||||
setPCutCmd->SetDefaultValue(1.0);
|
||||
setPCutCmd->SetRange("cut >0.0");
|
||||
setPCutCmd->SetDefaultUnit("mm");
|
||||
setPCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
// /run/setCut command
|
||||
setCutCmd = new G4UIcmdWithADoubleAndUnit("/run/setCut",this);
|
||||
setCutCmd->SetGuidance("Set default cut value ");
|
||||
setCutCmd->SetParameterName("cut",false);
|
||||
setCutCmd->SetDefaultValue(1.0);
|
||||
setCutCmd->SetRange("cut >0.0");
|
||||
setCutCmd->SetUnitCandidates("m cm mm microm");
|
||||
setCutCmd->SetDefaultUnit("mm");
|
||||
setCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
// /run/setCutForRegion command
|
||||
setCutRCmd = new G4UIcommand("/run/setCutForRegion",this);
|
||||
setCutRCmd->SetGuidance("Set cut value for a region");
|
||||
param = new G4UIparameter("Region",'s',false);
|
||||
setCutRCmd->SetParameter(param);
|
||||
param = new G4UIparameter("cut",'d',false);
|
||||
param->SetParameterRange("cut >0.0");
|
||||
setCutRCmd->SetParameter(param);
|
||||
param = new G4UIparameter("Unit",'s',true);
|
||||
param->SetDefaultValue("mm");
|
||||
param->SetParameterCandidates(setCutRCmd->UnitsList(setCutRCmd->CategoryOf("mm")));
|
||||
setCutRCmd->SetParameter(param);
|
||||
setCutRCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
// /run/particle/DumpList command
|
||||
dumpListCmd = new G4UIcmdWithoutParameter("/run/particle/dumpList",this);
|
||||
dumpListCmd->SetGuidance("Dump List of particles in G4VUserPhysicsList. ");
|
||||
|
||||
|
||||
// /run/particle/DumpCutValues command
|
||||
dumpCutValuesCmd = new G4UIcmdWithAString("/run/particle/dumpCutValues",this);
|
||||
dumpCutValuesCmd->SetGuidance("Dump cut value information ");
|
||||
dumpCutValuesCmd->SetGuidance("Enter particle name ");
|
||||
dumpCutValuesCmd->SetGuidance(" enter all for all particles");
|
||||
dumpCutValuesCmd->SetParameterName("particle", true);
|
||||
dumpCutValuesCmd->SetDefaultValue("table");
|
||||
dumpCutValuesCmd->AvailableForStates(G4State_Idle,G4State_GeomClosed,G4State_EventProc);
|
||||
|
||||
// /run/particle/addProcManager command
|
||||
addProcManCmd = new G4UIcmdWithAString("/run/particle/addProcManager", this);
|
||||
addProcManCmd->SetGuidance("add process manager to specified particle type");
|
||||
@@ -128,39 +143,80 @@ G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(G4VUserPhysicsList* pPart
|
||||
|
||||
//Commnad /run/particle/applyCuts command
|
||||
applyCutsCmd = new G4UIcommand("/run/particle/applyCuts",this);
|
||||
applyCutsCmd->SetGuidance("Set ApplyCuts flag ");
|
||||
applyCutsCmd->SetGuidance(" applyCuts [value] [particle]");
|
||||
applyCutsCmd->SetGuidance(" value : true(default) or false ");
|
||||
applyCutsCmd->SetGuidance(" particle : all(default) or particle name ");
|
||||
G4UIparameter* param = new G4UIparameter("Flag",'s',true);
|
||||
applyCutsCmd->SetGuidance("Set applyCuts flag for a particle.");
|
||||
applyCutsCmd->SetGuidance(" Some EM processes which do not have infrared divergence");
|
||||
applyCutsCmd->SetGuidance("may generate gamma, e- and/or e+ with kinetic energies");
|
||||
applyCutsCmd->SetGuidance("below the production threshold. By setting this flag,");
|
||||
applyCutsCmd->SetGuidance("such secondaries below threshold are eliminated and");
|
||||
applyCutsCmd->SetGuidance("kinetic energies of such secondaries are accumulated");
|
||||
applyCutsCmd->SetGuidance("to the energy deposition of their mother.");
|
||||
applyCutsCmd->SetGuidance(" Note that 'applyCuts' makes sense only for gamma,");
|
||||
applyCutsCmd->SetGuidance("e- and e+. If this command is issued for other particle,");
|
||||
applyCutsCmd->SetGuidance("a warning message is displayed and the command is");
|
||||
applyCutsCmd->SetGuidance("ignored.");
|
||||
applyCutsCmd->SetGuidance(" If particle name is 'all', this command affects on");
|
||||
applyCutsCmd->SetGuidance("gamma, e- and e+.");
|
||||
param = new G4UIparameter("Flag",'s',true);
|
||||
param->SetDefaultValue("true");
|
||||
applyCutsCmd->SetParameter(param);
|
||||
param = new G4UIparameter("Particle",'s',true);
|
||||
param->SetDefaultValue("all");
|
||||
applyCutsCmd->SetParameter(param);
|
||||
applyCutsCmd->AvailableForStates(G4State_PreInit,G4State_Init,G4State_Idle);
|
||||
|
||||
// /run/particle/dumpCutValues command
|
||||
dumpCutValuesCmd = new G4UIcmdWithAString("/run/particle/dumpCutValues",this);
|
||||
dumpCutValuesCmd->SetGuidance("Dump a list of production threshold values in range and energy");
|
||||
dumpCutValuesCmd->SetGuidance("for all registered material-cuts-couples.");
|
||||
dumpCutValuesCmd->SetGuidance("Dumping a list takes place when you issue 'beamOn' and");
|
||||
dumpCutValuesCmd->SetGuidance("actual conversion tables from range to energy are available.");
|
||||
dumpCutValuesCmd->SetGuidance("If you want a list 'immediately', use '/run/dumpRegion' for threshold");
|
||||
dumpCutValuesCmd->SetGuidance("list given in gange only. Also, '/run/dumpCouples' gives you the");
|
||||
dumpCutValuesCmd->SetGuidance("current list if you have already issued 'run/beamOn' at least once.");
|
||||
dumpCutValuesCmd->SetParameterName("particle",true);
|
||||
dumpCutValuesCmd->SetDefaultValue("all");
|
||||
dumpCutValuesCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
}
|
||||
|
||||
G4UserPhysicsListMessenger::~G4UserPhysicsListMessenger()
|
||||
{
|
||||
delete setPCutCmd;
|
||||
delete setCutCmd;
|
||||
delete setCutRCmd;
|
||||
delete verboseCmd;
|
||||
delete dumpListCmd;
|
||||
delete dumpCutValuesCmd;
|
||||
delete addProcManCmd;
|
||||
delete buildPTCmd;
|
||||
delete storeCmd;
|
||||
delete retrieveCmd;
|
||||
delete theDirectory;
|
||||
delete asciiCmd;
|
||||
delete applyCutsCmd;
|
||||
delete dumpCutValuesCmd;
|
||||
delete theDirectory;
|
||||
}
|
||||
|
||||
void G4UserPhysicsListMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
{
|
||||
if( command==setCutCmd ){
|
||||
if( command==setCutCmd || command==setPCutCmd ){
|
||||
G4double newCut = setCutCmd->GetNewDoubleValue(newValue);
|
||||
thePhysicsList->SetDefaultCutValue(newCut);
|
||||
thePhysicsList->SetCutsWithDefault();
|
||||
|
||||
} else if( command==setCutRCmd ){
|
||||
//G4Tokenizer next( newValue );
|
||||
//G4String rName = G4String(next());
|
||||
//G4String cValue = G4String(next())+" "+G4String(next());
|
||||
//G4double newCut = setCutCmd->GetNewDoubleValue(cValue);
|
||||
//thePhysicsList->SetCutsForRegion(newCut,rName);
|
||||
G4std::istrstream is(newValue);
|
||||
char regName[50];
|
||||
G4double cVal;
|
||||
char uniName[10];
|
||||
is >> regName >> cVal >> uniName;
|
||||
G4String regN = regName;
|
||||
G4String uniN = uniName;
|
||||
thePhysicsList->SetCutsForRegion(cVal*(setCutRCmd->ValueOf(uniN)),regN);
|
||||
|
||||
} else if( command==verboseCmd ) {
|
||||
thePhysicsList->SetVerboseLevel(verboseCmd->GetNewIntValue(newValue));
|
||||
@@ -168,13 +224,6 @@ void G4UserPhysicsListMessenger::SetNewValue(G4UIcommand * command,G4String newV
|
||||
} else if( command==dumpListCmd ){
|
||||
thePhysicsList->DumpList();
|
||||
|
||||
} else if( command==dumpCutValuesCmd ){
|
||||
if (newValue == "table") {
|
||||
thePhysicsList->DumpCutValuesTable();
|
||||
} else {
|
||||
thePhysicsList->DumpCutValues(newValue);
|
||||
}
|
||||
|
||||
} else if( command == addProcManCmd ){
|
||||
G4ParticleDefinition* particle = (G4ParticleTable::GetParticleTable())->FindParticle(newValue);
|
||||
if (particle == 0) return;
|
||||
@@ -215,6 +264,8 @@ void G4UserPhysicsListMessenger::SetNewValue(G4UIcommand * command,G4String newV
|
||||
|
||||
thePhysicsList->SetApplyCuts(flag, name);
|
||||
|
||||
} else if( command == dumpCutValuesCmd ) {
|
||||
thePhysicsList->DumpCutValuesTable(1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -225,7 +276,7 @@ G4String G4UserPhysicsListMessenger::GetCurrentValue(G4UIcommand * command)
|
||||
G4String candidates("none");
|
||||
G4ParticleTable::G4PTblDicIterator *piter = (G4ParticleTable::GetParticleTable())->GetIterator();
|
||||
|
||||
if( command==setCutCmd ){
|
||||
if( command==setCutCmd || command==setPCutCmd ){
|
||||
cv = setCutCmd->ConvertToString( thePhysicsList->GetDefaultCutValue(), "mm" );
|
||||
|
||||
} else if( command==verboseCmd ){
|
||||
@@ -268,12 +319,12 @@ G4String G4UserPhysicsListMessenger::GetCurrentValue(G4UIcommand * command)
|
||||
cv = "0";
|
||||
}
|
||||
|
||||
} else if( command == applyCutsCmd ) {
|
||||
if (thePhysicsList->GetApplyCuts("proton")){
|
||||
cv = "true";
|
||||
} else {
|
||||
cv = "false";
|
||||
}
|
||||
// } else if( command == applyCutsCmd ) {
|
||||
// if (thePhysicsList->GetApplyCuts("gamma")){
|
||||
// cv = "true";
|
||||
// } else {
|
||||
// cv = "false";
|
||||
// }
|
||||
}
|
||||
|
||||
return cv;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UserRunAction.cc,v 1.4 2001/07/11 10:08:34 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4UserRunAction.cc,v 1.5 2003/03/10 01:50:21 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
@@ -33,6 +33,9 @@ G4UserRunAction::G4UserRunAction()
|
||||
G4UserRunAction::~G4UserRunAction()
|
||||
{;}
|
||||
|
||||
G4Run* G4UserRunAction::GenerateRun()
|
||||
{ return 0; }
|
||||
|
||||
void G4UserRunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
{;}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VModularPhysicsList.cc,v 1.2 2002/05/29 12:11:08 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VPersistencyManager.cc,v 1.4 2001/07/13 15:57:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#include "G4VPersistencyManager.hh"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserDetectorConstruction.cc,v 1.3 2001/07/11 10:08:34 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
|
||||
+159
-1057
File diff suppressed because it is too large
Load Diff
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserPrimaryGeneratorAction.cc,v 1.3 2001/07/11 10:08:34 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
|
||||
Reference in New Issue
Block a user