Import Geant4 8.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:07:44 +02:00
parent fe73f43734
commit 75c7fd177d
764 changed files with 45230 additions and 95238 deletions
+16 -8
View File
@@ -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";
+23 -2
View File
@@ -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;
}
+13 -3
View File
@@ -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);
}