Import Geant4 9.1.0 source tree
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ExceptionHandler.cc,v 1.4 2006/06/29 21:13:40 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4MSSteppingAction.cc,v 1.2 2006/06/29 21:13:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4MatScanMessenger.cc,v 1.5 2006/12/01 02:00:55 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4MaterialScanner.cc,v 1.3 2006/06/29 21:13:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Run.cc,v 1.11 2006/11/23 00:06:49 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#include "G4Run.hh"
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManager.cc,v 1.103 2007/06/20 17:00:23 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// $Id: G4RunManager.cc,v 1.108 2007/11/09 13:57:39 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -135,6 +135,7 @@ void G4RunManager::BeamOn(G4int n_event,const char* macroFile,G4int n_select)
|
||||
if(cond)
|
||||
{
|
||||
numberOfEventToBeProcessed = n_event;
|
||||
ConstructScoringWorlds();
|
||||
RunInitialization();
|
||||
if(n_event>0) DoEventLoop(n_event,macroFile,n_select);
|
||||
RunTermination();
|
||||
@@ -194,11 +195,6 @@ void G4RunManager::RunInitialization()
|
||||
HepRandom::saveFullState(oss);
|
||||
randomNumberStatusForThisRun = oss.str();
|
||||
currentRun->SetRandomNumberStatus(randomNumberStatusForThisRun);
|
||||
|
||||
if(storeRandomNumberStatus) {
|
||||
G4String fileN = randomNumberStatusDir + "currentRun.rndm";
|
||||
HepRandom::saveEngineStatus(fileN);
|
||||
}
|
||||
|
||||
previousEvents->clear();
|
||||
for(G4int i_prev=0;i_prev<n_perviousEventsToBeStored;i_prev++)
|
||||
@@ -206,6 +202,11 @@ void G4RunManager::RunInitialization()
|
||||
|
||||
if(userRunAction) userRunAction->BeginOfRunAction(currentRun);
|
||||
|
||||
if(storeRandomNumberStatus) {
|
||||
G4String fileN = randomNumberStatusDir + "currentRun.rndm";
|
||||
HepRandom::saveEngineStatus(fileN);
|
||||
}
|
||||
|
||||
runAborted = false;
|
||||
|
||||
if(verboseLevel>0) G4cout << "Start Run processing." << G4endl;
|
||||
@@ -233,6 +234,7 @@ void G4RunManager::DoEventLoop(G4int n_event,const char* macroFile,G4int n_selec
|
||||
currentEvent = GenerateEvent(i_event);
|
||||
eventManager->ProcessOneEvent(currentEvent);
|
||||
AnalyzeEvent(currentEvent);
|
||||
UpdateScoring();
|
||||
if(i_event<n_select) G4UImanager::GetUIpointer()->ApplyCommand(msg);
|
||||
StackPreviousEvent(currentEvent);
|
||||
currentEvent = 0;
|
||||
@@ -477,4 +479,71 @@ void G4RunManager::DumpRegion(G4Region* region) const
|
||||
kernel->DumpRegion(region);
|
||||
}
|
||||
|
||||
#include "G4ScoringManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4VScoringMesh.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4ParallelWorldScoringProcess.hh"
|
||||
#include "G4HCofThisEvent.hh"
|
||||
#include "G4VHitsCollection.hh"
|
||||
|
||||
void G4RunManager::ConstructScoringWorlds()
|
||||
{
|
||||
G4ScoringManager* ScM = G4ScoringManager::GetScoringManagerIfExist();
|
||||
if(!ScM) return;
|
||||
G4int nPar = ScM->GetNumberOfMesh();
|
||||
if(nPar<1) return;
|
||||
|
||||
G4ParticleTable::G4PTblDicIterator* theParticleIterator
|
||||
= G4ParticleTable::GetParticleTable()->GetIterator();
|
||||
for(G4int iw=0;iw<nPar;iw++)
|
||||
{
|
||||
G4VScoringMesh* mesh = ScM->GetMesh(iw);
|
||||
G4VPhysicalVolume* pWorld
|
||||
= G4TransportationManager::GetTransportationManager()
|
||||
->IsWorldExisting(ScM->GetWorldName(iw));
|
||||
if(!pWorld)
|
||||
{
|
||||
pWorld = G4TransportationManager::GetTransportationManager()
|
||||
->GetParallelWorld(ScM->GetWorldName(iw));
|
||||
pWorld->SetName(ScM->GetWorldName(iw));
|
||||
|
||||
G4ParallelWorldScoringProcess* theParallelWorldScoringProcess
|
||||
= new G4ParallelWorldScoringProcess(ScM->GetWorldName(iw));
|
||||
theParallelWorldScoringProcess->SetParallelWorld(ScM->GetWorldName(iw));
|
||||
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
pmanager->AddProcess(theParallelWorldScoringProcess);
|
||||
pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxAtRest);
|
||||
pmanager->SetProcessOrderingToSecond(theParallelWorldScoringProcess, idxAlongStep);
|
||||
pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxPostStep);
|
||||
}
|
||||
}
|
||||
mesh->Construct(pWorld);
|
||||
}
|
||||
GeometryHasBeenModified();
|
||||
}
|
||||
|
||||
void G4RunManager::UpdateScoring()
|
||||
{
|
||||
G4ScoringManager* ScM = G4ScoringManager::GetScoringManagerIfExist();
|
||||
if(!ScM) return;
|
||||
G4int nPar = ScM->GetNumberOfMesh();
|
||||
if(nPar<1) return;
|
||||
|
||||
G4HCofThisEvent* HCE = currentEvent->GetHCofThisEvent();
|
||||
if(!HCE) return;
|
||||
G4int nColl = HCE->GetCapacity();
|
||||
for(G4int i=0;i<nColl;i++)
|
||||
{
|
||||
G4VHitsCollection* HC = HCE->GetHC(i);
|
||||
if(HC) ScM->Accumulate(HC);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManagerKernel.cc,v 1.41 2007/05/30 00:42:09 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunMessenger.cc,v 1.24 2007/03/08 23:54:04 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// $Id: G4RunMessenger.cc,v 1.31 2007/11/16 22:37:43 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#include "G4RunMessenger.hh"
|
||||
@@ -41,6 +41,8 @@
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4MaterialScanner.hh"
|
||||
#include "G4Tokenizer.hh"
|
||||
#include "Randomize.hh"
|
||||
#include <sstream>
|
||||
|
||||
G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
|
||||
@@ -149,13 +151,28 @@ G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
|
||||
cutCmd = new G4UIcmdWithoutParameter("/run/cutoffModified",this);
|
||||
cutCmd->SetGuidance("/run/cutoffModified becomes obsolete.");
|
||||
cutCmd->SetGuidance("It is safe to remove invoking this command.");
|
||||
|
||||
constScoreCmd = new G4UIcmdWithoutParameter("/run/constructScoringWorlds",this);
|
||||
constScoreCmd->SetGuidance("Constrct scoring parallel world(s) if defined.");
|
||||
constScoreCmd->SetGuidance("This command is not mandatory, but automatically called when a run starts.");
|
||||
constScoreCmd->SetGuidance("But the user may use this to visualize the scoring world(s) before a run to start.");
|
||||
constScoreCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
materialScanner = new G4MaterialScanner();
|
||||
|
||||
randomDirectory = new G4UIdirectory("/random/");
|
||||
randomDirectory->SetGuidance("Random number status control commands.");
|
||||
|
||||
seedCmd = new G4UIcmdWithAString("/random/setSeeds",this);
|
||||
seedCmd->SetGuidance("Initialize the random number generator with integer seed stream.");
|
||||
seedCmd->SetGuidance("Number of integers should be more than 1.");
|
||||
seedCmd->SetGuidance("Actual number of integers to be used depends on the individual random number engine.");
|
||||
seedCmd->SetParameterName("IntArray",false);
|
||||
seedCmd->AvailableForStates(G4State_PreInit,G4State_Idle,G4State_GeomClosed);
|
||||
|
||||
randDirCmd = new G4UIcmdWithAString("/random/setDirectoryName",this);
|
||||
randDirCmd->SetGuidance("Define the directory name of the rndm status files.");
|
||||
randDirCmd->SetGuidance("Directory must be creates before storing the files.");
|
||||
randDirCmd->SetGuidance("Directory will be created if it does not exist.");
|
||||
randDirCmd->SetParameterName("fileName",true);
|
||||
randDirCmd->SetDefaultValue("./");
|
||||
randDirCmd->AvailableForStates(G4State_PreInit,G4State_Idle,G4State_GeomClosed);
|
||||
@@ -226,8 +243,6 @@ G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
|
||||
restoreRandOld->SetParameterName("fileName",true);
|
||||
restoreRandOld->SetDefaultValue("currentRun.rndm");
|
||||
restoreRandOld->AvailableForStates(G4State_PreInit,G4State_Idle,G4State_GeomClosed);
|
||||
|
||||
materialScanner = new G4MaterialScanner();
|
||||
}
|
||||
|
||||
G4RunMessenger::~G4RunMessenger()
|
||||
@@ -248,9 +263,11 @@ G4RunMessenger::~G4RunMessenger()
|
||||
delete cutCmd;
|
||||
delete randEvtCmd;
|
||||
delete randDirOld; delete storeRandOld; delete restoreRandOld;
|
||||
delete constScoreCmd;
|
||||
delete runDirectory;
|
||||
|
||||
delete randDirCmd;
|
||||
delete seedCmd;
|
||||
delete savingFlagCmd;
|
||||
delete saveThisRunCmd;
|
||||
delete saveThisEventCmd;
|
||||
@@ -303,7 +320,23 @@ void G4RunMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
{ runManager->PhysicsHasBeenModified(); }
|
||||
else if( command==cutCmd )
|
||||
{ runManager->CutOffHasBeenModified(); }
|
||||
|
||||
|
||||
else if( command==seedCmd )
|
||||
{
|
||||
G4Tokenizer next(newValue);
|
||||
G4int idx=0;
|
||||
long seeds[100];
|
||||
G4String vl;
|
||||
while(!(vl=next()).isNull())
|
||||
{ seeds[idx] = (long)(StoI(vl)); idx++; }
|
||||
if(idx<2)
|
||||
{ G4cerr << "/random/setSeeds should have at least two integers. Command ignored." << G4endl; }
|
||||
else
|
||||
{
|
||||
seeds[idx] = 0;
|
||||
CLHEP::HepRandom::setTheSeeds(seeds);
|
||||
}
|
||||
}
|
||||
else if( command==randDirCmd )
|
||||
{ runManager->SetRandomNumberStoreDir(newValue); }
|
||||
else if( command==savingFlagCmd )
|
||||
@@ -320,18 +353,24 @@ void G4RunMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
else if( command==randDirOld )
|
||||
{G4cout << "warning: deprecated command. Use /random/setDirectoryName"
|
||||
<< G4endl;
|
||||
runManager->SetRandomNumberStoreDir(newValue); }
|
||||
// runManager->SetRandomNumberStoreDir(newValue);
|
||||
}
|
||||
else if( command==storeRandOld )
|
||||
{G4cout << "warning: deprecated command. Use /random/setSavingFlag"
|
||||
<< G4endl;
|
||||
G4int frequency = storeRandOld->GetNewIntValue(newValue);
|
||||
G4bool flag = false;
|
||||
if(frequency != 0) flag = true;
|
||||
runManager->SetRandomNumberStore(flag); }
|
||||
// G4int frequency = storeRandOld->GetNewIntValue(newValue);
|
||||
// G4bool flag = false;
|
||||
// if(frequency != 0) flag = true;
|
||||
// runManager->SetRandomNumberStore(flag);
|
||||
}
|
||||
else if( command==restoreRandOld )
|
||||
{G4cout << "warning: deprecated command. Use /random/resetEngineFrom"
|
||||
<< G4endl;
|
||||
runManager->RestoreRandomNumberStatus(newValue); }
|
||||
// runManager->RestoreRandomNumberStatus(newValue);
|
||||
}
|
||||
else if( command==constScoreCmd )
|
||||
{ runManager->ConstructScoringWorlds(); }
|
||||
|
||||
}
|
||||
|
||||
G4String G4RunMessenger::GetCurrentValue(G4UIcommand * command)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UserPhysicsListMessenger.cc,v 1.28 2007/05/30 10:34:54 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UserRunAction.cc,v 1.8 2006/06/29 21:13:58 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VModularPhysicsList.cc,v 1.4 2007/06/15 07:26:55 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VPersistencyManager.cc,v 1.5 2006/06/29 21:14:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#include "G4VPersistencyManager.hh"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserDetectorConstruction.cc,v 1.8 2007/05/03 17:59:18 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserParallelWorld.cc,v 1.2 2006/12/13 15:49:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#include "G4VUserParallelWorld.hh"
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserPhysicsList.cc,v 1.61 2007/05/30 10:16:28 ahoward Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// $Id: G4VUserPhysicsList.cc,v 1.62 2007/09/23 17:33:00 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -223,6 +223,7 @@ void G4VUserPhysicsList::RemoveProcessManager()
|
||||
#include "G4Transportation.hh"
|
||||
#include "G4CoupledTransportation.hh"
|
||||
#include "G4RunManagerKernel.hh"
|
||||
#include "G4ScoringManager.hh"
|
||||
|
||||
void G4VUserPhysicsList::AddTransportation()
|
||||
{
|
||||
@@ -230,7 +231,7 @@ void G4VUserPhysicsList::AddTransportation()
|
||||
G4VProcess* theTransportationProcess = 0;
|
||||
G4int nParaWorld = G4RunManagerKernel::GetRunManagerKernel()->GetNumberOfParallelWorld();
|
||||
|
||||
if(nParaWorld || useCoupledTransportation)
|
||||
if(nParaWorld || useCoupledTransportation || G4ScoringManager::GetScoringManagerIfExist())
|
||||
{
|
||||
theTransportationProcess = new G4CoupledTransportation(verboseLevelTransport);
|
||||
G4cout << "#############################################################################" << G4endl
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserPrimaryGeneratorAction.cc,v 1.5 2006/06/29 21:14:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
|
||||
Reference in New Issue
Block a user