Import Geant4 8.3.0 source tree
This commit is contained in:
+14
-1
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.154 2006/12/01 17:10:21 gcosmo Exp $
|
||||
$Id: History,v 1.157 2007/03/08 23:54:04 asaim Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,19 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
March 8th, 2007, Makoto Asai (run-V08-02-02)
|
||||
- Consolidation of previous tag with a new G4RunManager flag and corresponding UI command.
|
||||
|
||||
March 5th, 2007, Makoto Asai (run-V08-02-01)
|
||||
- Prevent from unnecessary creation of G4String objects in G4Event, which were
|
||||
default for random number status.
|
||||
|
||||
January 19th, 2007, Makoto Asai (run-V08-02-00)
|
||||
- Fix to make G4RunManager::NumberOfEventToBeStored() work properly
|
||||
(addressing to bug#925)
|
||||
- Add protection against missing particle types before BuildPhysicsTable
|
||||
is invoked (addressing to bug#923)
|
||||
|
||||
December 1st, 2006, Makoto Asai (run-V08-01-06)
|
||||
- Fixed memory leak at initialisation in G4MatScanMessenger.
|
||||
- Modified CheckRegions() method not to use inefficient and obsolete
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Run.hh,v 1.14 2006/11/23 00:06:46 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4Run.hh,v 1.16 2007/03/07 03:00:14 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
|
||||
#ifndef G4Run_h
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManager.hh,v 1.43 2006/11/23 00:06:46 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4RunManager.hh,v 1.47 2007/03/08 23:54:04 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -245,6 +245,7 @@ class G4RunManager
|
||||
G4int numberOfEventToBeProcessed;
|
||||
|
||||
G4bool storeRandomNumberStatus;
|
||||
G4int storeRandomNumberStatusToG4Event;
|
||||
G4String randomNumberStatusDir;
|
||||
G4String randomNumberStatusForThisRun;
|
||||
G4String randomNumberStatusForThisEvent;
|
||||
@@ -253,6 +254,7 @@ class G4RunManager
|
||||
|
||||
G4int nParallelWorlds;
|
||||
|
||||
|
||||
public:
|
||||
virtual void rndmSaveThisRun();
|
||||
virtual void rndmSaveThisEvent();
|
||||
@@ -322,6 +324,18 @@ class G4RunManager
|
||||
inline void SetPrimaryTransformer(G4PrimaryTransformer* pt)
|
||||
{ kernel->SetPrimaryTransformer(pt); }
|
||||
|
||||
inline void StoreRandomNumberStatusToG4Event(G4int vl)
|
||||
// if vl = 1 : status before primary particle generation is stored
|
||||
// if vl = 2 : status before event processing (after primary particle generation) is stored
|
||||
// if vl = 3 : both are stored
|
||||
// if vl = 0 : none is stored (default)
|
||||
{
|
||||
storeRandomNumberStatusToG4Event = vl;
|
||||
eventManager->StoreRandomNumberStatusToG4Event(vl);
|
||||
}
|
||||
inline G4int GetFlagRandomNumberStatusToG4Event() const
|
||||
{ return storeRandomNumberStatusToG4Event; }
|
||||
|
||||
public:
|
||||
inline void SetRandomNumberStore(G4bool flag)
|
||||
{ storeRandomNumberStatus = flag; }
|
||||
@@ -338,7 +352,11 @@ class G4RunManager
|
||||
inline const G4String& GetRandomNumberStatusForThisRun() const
|
||||
{ return randomNumberStatusForThisRun; }
|
||||
inline const G4String& GetRandomNumberStatusForThisEvent() const
|
||||
{ return randomNumberStatusForThisEvent; }
|
||||
{
|
||||
if(storeRandomNumberStatusToG4Event==0 || storeRandomNumberStatusToG4Event==2)
|
||||
{ G4Exception("Random number status is not available for this event."); }
|
||||
return randomNumberStatusForThisEvent;
|
||||
}
|
||||
|
||||
public: // with description
|
||||
inline void GeometryHasBeenModified()
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunMessenger.hh,v 1.14 2006/06/29 21:13:22 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4RunMessenger.hh,v 1.15 2007/03/08 23:54:04 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
//
|
||||
// GEANT 4 class header file
|
||||
@@ -96,7 +96,8 @@ class G4RunMessenger: public G4UImessenger
|
||||
G4UIcmdWithoutParameter * geomCmd;
|
||||
G4UIcmdWithoutParameter * physCmd;
|
||||
G4UIcmdWithoutParameter * cutCmd;
|
||||
|
||||
G4UIcmdWithAnInteger * randEvtCmd;
|
||||
|
||||
G4UIdirectory * randomDirectory;
|
||||
G4UIcmdWithAString * randDirCmd;
|
||||
G4UIcmdWithABool * savingFlagCmd;
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManager.cc,v 1.93 2006/12/13 15:49:34 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4RunManager.cc,v 1.99 2007/03/08 23:54:04 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -71,8 +71,9 @@ G4RunManager::G4RunManager()
|
||||
runAborted(false),initializedAtLeastOnce(false),
|
||||
geometryToBeOptimized(true),runIDCounter(0),verboseLevel(0),DCtable(0),
|
||||
currentRun(0),currentEvent(0),n_perviousEventsToBeStored(0),
|
||||
numberOfEventToBeProcessed(0),storeRandomNumberStatus(false),currentWorld(0),
|
||||
nParallelWorlds(0)
|
||||
numberOfEventToBeProcessed(0),storeRandomNumberStatus(false),
|
||||
storeRandomNumberStatusToG4Event(0),
|
||||
currentWorld(0),nParallelWorlds(0)
|
||||
{
|
||||
if(fRunManager)
|
||||
{ G4Exception("G4RunManager constructed twice."); }
|
||||
@@ -199,6 +200,10 @@ void G4RunManager::RunInitialization()
|
||||
HepRandom::saveEngineStatus(fileN);
|
||||
}
|
||||
|
||||
previousEvents->clear();
|
||||
for(G4int i_prev=0;i_prev<n_perviousEventsToBeStored;i_prev++)
|
||||
{ previousEvents->push_back((G4Event*)0); }
|
||||
|
||||
if(userRunAction) userRunAction->BeginOfRunAction(currentRun);
|
||||
|
||||
runAborted = false;
|
||||
@@ -257,10 +262,13 @@ G4Event* G4RunManager::GenerateEvent(G4int i_event)
|
||||
|
||||
G4Event* anEvent = new G4Event(i_event);
|
||||
|
||||
std::ostringstream oss;
|
||||
HepRandom::saveFullState(oss);
|
||||
randomNumberStatusForThisEvent = oss.str();
|
||||
anEvent->SetRandomNumberStatus(randomNumberStatusForThisEvent);
|
||||
if(storeRandomNumberStatusToG4Event==1 || storeRandomNumberStatusToG4Event==3)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
HepRandom::saveFullState(oss);
|
||||
randomNumberStatusForThisEvent = oss.str();
|
||||
anEvent->SetRandomNumberStatus(randomNumberStatusForThisEvent);
|
||||
}
|
||||
|
||||
if(storeRandomNumberStatus) {
|
||||
G4String fileN = randomNumberStatusDir + "currentEvent.rndm";
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunMessenger.cc,v 1.23 2006/06/29 21:13:54 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4RunMessenger.cc,v 1.24 2007/03/08 23:54:04 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
|
||||
#include "G4RunMessenger.hh"
|
||||
@@ -185,11 +185,25 @@ G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
|
||||
restoreRandCmd->SetDefaultValue("currentRun.rndm");
|
||||
restoreRandCmd->AvailableForStates(G4State_PreInit,G4State_Idle,G4State_GeomClosed);
|
||||
|
||||
randEvtCmd = new G4UIcmdWithAnInteger("/run/storeRndmStatToEvent",this);
|
||||
randEvtCmd->SetGuidance("Flag to store rndm status to G4Event object.");
|
||||
randEvtCmd->SetGuidance(" flag = 0 : not store (default)");
|
||||
randEvtCmd->SetGuidance(" flag = 1 : status before primary particle generation is stored");
|
||||
randEvtCmd->SetGuidance(" flag = 2 : status before event processing (after primary particle generation) is stored");
|
||||
randEvtCmd->SetGuidance(" flag = 3 : both are stored");
|
||||
randEvtCmd->SetGuidance("Note: Some performance overhead may be seen by storing rndm status, in particular");
|
||||
randEvtCmd->SetGuidance("for the case of simplest geometry and small number of tracks per event.");
|
||||
randEvtCmd->SetParameterName("flag",true);
|
||||
randEvtCmd->SetDefaultValue(0);
|
||||
randEvtCmd->SetRange("flag>=0 && flag<3");
|
||||
randEvtCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
//old commands for the rndm engine status handling
|
||||
//
|
||||
randDirOld = new G4UIcmdWithAString("/run/randomNumberStatusDirectory",this);
|
||||
randDirOld->SetGuidance("Define the directory name of the rndm status files.");
|
||||
randDirOld->SetGuidance("Directory must be creates before storing the files.");
|
||||
randDirOld->SetGuidance("OBSOLETE --- Please use commands in /random/ directory");
|
||||
randDirOld->SetParameterName("fileName",true);
|
||||
randDirOld->SetDefaultValue("./");
|
||||
randDirOld->AvailableForStates(G4State_PreInit,G4State_Idle,G4State_GeomClosed);
|
||||
@@ -198,6 +212,7 @@ G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
|
||||
storeRandOld->SetGuidance("The randomNumberStatus will be saved at :");
|
||||
storeRandOld->SetGuidance("begining of run (currentRun.rndm) and "
|
||||
"begining of event (currentEvent.rndm) ");
|
||||
storeRandOld->SetGuidance("OBSOLETE --- Please use commands in /random/ directory");
|
||||
storeRandOld->SetParameterName("flag",true);
|
||||
storeRandOld->SetDefaultValue(1);
|
||||
|
||||
@@ -207,6 +222,7 @@ G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
|
||||
restoreRandOld->SetGuidance("The engine status must be stored beforehand.");
|
||||
restoreRandOld->SetGuidance("Directory of the status file should be set by"
|
||||
" /random/setDirectoryName.");
|
||||
restoreRandOld->SetGuidance("OBSOLETE --- Please use commands in /random/ directory");
|
||||
restoreRandOld->SetParameterName("fileName",true);
|
||||
restoreRandOld->SetDefaultValue("currentRun.rndm");
|
||||
restoreRandOld->AvailableForStates(G4State_PreInit,G4State_Idle,G4State_GeomClosed);
|
||||
@@ -230,6 +246,7 @@ G4RunMessenger::~G4RunMessenger()
|
||||
delete geomCmd;
|
||||
delete physCmd;
|
||||
delete cutCmd;
|
||||
delete randEvtCmd;
|
||||
delete randDirOld; delete storeRandOld; delete restoreRandOld;
|
||||
delete runDirectory;
|
||||
|
||||
@@ -297,6 +314,8 @@ void G4RunMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
{ runManager->rndmSaveThisEvent(); }
|
||||
else if( command==restoreRandCmd )
|
||||
{ runManager->RestoreRandomNumberStatus(newValue); }
|
||||
else if( command==randEvtCmd )
|
||||
{ runManager->StoreRandomNumberStatusToG4Event(randEvtCmd->GetNewIntValue(newValue)); }
|
||||
|
||||
else if( command==randDirOld )
|
||||
{G4cout << "warning: deprecated command. Use /random/setDirectoryName"
|
||||
@@ -323,6 +342,8 @@ G4String G4RunMessenger::GetCurrentValue(G4UIcommand * command)
|
||||
{ cv = verboseCmd->ConvertToString(runManager->GetVerboseLevel()); }
|
||||
else if( command==randDirCmd )
|
||||
{ cv = runManager->GetRandomNumberStoreDir(); }
|
||||
else if( command==randEvtCmd )
|
||||
{ cv = randEvtCmd->ConvertToString(runManager->GetFlagRandomNumberStatusToG4Event()); }
|
||||
|
||||
return cv;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserPhysicsList.cc,v 1.55 2006/12/13 15:49:40 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VUserPhysicsList.cc,v 1.56 2007/01/18 02:16:31 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -42,6 +42,7 @@
|
||||
// Removed ConstructAllParticles() 15 Apr 1999 by H.Kurashige
|
||||
// Modified for CUTS per REGION 10 Oct 2002 by H.Kurashige
|
||||
// Check if particle IsShortLived 18 Jun 2003 by V.Ivanchenko
|
||||
// Modify PreparePhysicsList 18 Jan 2006 by H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#include "globals.hh"
|
||||
@@ -480,7 +481,16 @@ void G4VUserPhysicsList::PreparePhysicsTable(G4ParticleDefinition* particle)
|
||||
// Prepare the physics tables for every process for this particle type
|
||||
// if particle is not ShortLived
|
||||
if(!particle->IsShortLived()) {
|
||||
G4ProcessVector* pVector = particle->GetProcessManager()->GetProcessList();
|
||||
G4ProcessManager* pManager = particle->GetProcessManager();
|
||||
if (!pManager) {
|
||||
G4cerr << "G4VUserPhysicsList::PreparePhysicsTable : No Process Manager for "
|
||||
<< particle->GetParticleName() <<G4endl;
|
||||
G4cerr << particle->GetParticleName() << " should be created in your PhysicsList" <<G4endl;
|
||||
G4Exception("G4VUserPhysicsList::PreparePhysicsTable","No process manager",
|
||||
RunMustBeAborted, particle->GetParticleName() );
|
||||
}
|
||||
|
||||
G4ProcessVector* pVector = pManager->GetProcessList();
|
||||
for (G4int j=0; j < pVector->size(); ++j) {
|
||||
(*pVector)[j]->PreparePhysicsTable(*particle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user