Import Geant4 10.5.0 source tree
This commit is contained in:
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4AdjointPrimaryGeneratorAction.cc 102435 2017-01-27 08:28:15Z gcosmo $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Class Name: G4AdjointPrimaryGeneratorAction
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4AdjointSimManager.cc 102435 2017-01-27 08:28:15Z gcosmo $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Class Name: G4AdjointCrossSurfChecker
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4AdjointSimMessenger.cc 98735 2016-08-09 10:54:06Z gcosmo $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Class Name: G4AdjointCrossSurfChecker
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ExceptionHandler.cc 109231 2018-04-05 06:57:57Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MSSteppingAction.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MatScanMessenger.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MaterialScanner.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MultiRunAction.hh 90212 2016-01-27 18:33:12Z adotti $
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsListHelper.cc 106147 2017-09-14 06:38:11Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -207,7 +206,7 @@ void G4PhysicsListHelper::CheckParticleList() const
|
||||
void G4PhysicsListHelper::AddTransportation()
|
||||
{
|
||||
G4int verboseLevelTransport = 0;
|
||||
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >2){
|
||||
G4cout << "G4PhysicsListHelper::AddTransportation() "<< G4endl;
|
||||
@@ -219,17 +218,21 @@ void G4PhysicsListHelper::AddTransportation()
|
||||
|
||||
if ( nParaWorld>0 ||
|
||||
useCoupledTransportation ||
|
||||
G4ScoringManager::GetScoringManagerIfExist()) {
|
||||
#ifdef G4VERBOSE
|
||||
G4ScoringManager::GetScoringManagerIfExist())
|
||||
{
|
||||
auto coupledTransport= new G4CoupledTransportation(verboseLevelTransport);
|
||||
if( theLooperThresholds == 0 ) coupledTransport->SetLowLooperThresholds();
|
||||
if( theLooperThresholds == 2 ) coupledTransport->SetHighLooperThresholds();
|
||||
theTransportationProcess = coupledTransport;
|
||||
|
||||
if (verboseLevel >0) {
|
||||
G4cout << " G4PhysicsListHelper::AddTransportation()"
|
||||
<< "--- G4CoupledTransportation is used "
|
||||
<< G4endl;
|
||||
G4cout << "--- G4CoupledTransportation is used " << G4endl;
|
||||
}
|
||||
#endif
|
||||
theTransportationProcess = new G4CoupledTransportation(verboseLevelTransport);
|
||||
} else {
|
||||
theTransportationProcess = new G4Transportation(verboseLevelTransport);
|
||||
auto simpleTransport = new G4Transportation(verboseLevelTransport);
|
||||
if( theLooperThresholds == 0 ) simpleTransport->SetLowLooperThresholds();
|
||||
if( theLooperThresholds == 2 ) simpleTransport->SetHighLooperThresholds();
|
||||
theTransportationProcess = simpleTransport;
|
||||
}
|
||||
|
||||
// loop over all particles in G4ParticleTable
|
||||
@@ -671,6 +674,16 @@ void G4PhysicsListHelper::ReadInDefaultOrderingParameter()
|
||||
theTable->push_back(tmp);
|
||||
sizeOfTable +=1;
|
||||
|
||||
tmp.processTypeName = "ElectronSuper";
|
||||
tmp.processType = 2;
|
||||
tmp.processSubType = 9;
|
||||
tmp.ordering[0] = -1;
|
||||
tmp.ordering[1] = 1;
|
||||
tmp.ordering[2] = 1;
|
||||
tmp.isDuplicable = false;
|
||||
theTable->push_back(tmp);
|
||||
sizeOfTable +=1;
|
||||
|
||||
tmp.processTypeName = "Msc";
|
||||
tmp.processType = 2;
|
||||
tmp.processSubType = 10;
|
||||
@@ -731,6 +744,16 @@ void G4PhysicsListHelper::ReadInDefaultOrderingParameter()
|
||||
theTable->push_back(tmp);
|
||||
sizeOfTable +=1;
|
||||
|
||||
tmp.processTypeName = "GammaSuper";
|
||||
tmp.processType = 2;
|
||||
tmp.processSubType = 16;
|
||||
tmp.ordering[0] = -1;
|
||||
tmp.ordering[1] = -1;
|
||||
tmp.ordering[2] = 1000;
|
||||
tmp.isDuplicable = false;
|
||||
theTable->push_back(tmp);
|
||||
sizeOfTable +=1;
|
||||
|
||||
tmp.processTypeName = "Cerenkov";
|
||||
tmp.processType = 2;
|
||||
tmp.processSubType = 21;
|
||||
|
||||
@@ -24,16 +24,20 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Run.cc 70225 2013-05-27 10:10:15Z gcosmo $
|
||||
//
|
||||
|
||||
#include "G4Run.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4StatAnalysis.hh"
|
||||
|
||||
G4Run::G4Run()
|
||||
:runID(0),numberOfEvent(0),numberOfEventToBeProcessed(0),HCtable(0),DCtable(0)
|
||||
{ eventVector = new std::vector<const G4Event*>; }
|
||||
{
|
||||
eventVector = new std::vector<const G4Event*>;
|
||||
// this is for FOM in G4StatAnalysis
|
||||
G4StatAnalysis::ResetCpuClock();
|
||||
}
|
||||
|
||||
G4Run::~G4Run()
|
||||
{
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManager.cc 110726 2018-06-11 06:05:16Z gcosmo $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -56,6 +55,7 @@
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4VScoreNtupleWriter.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
#include "G4ParallelWorldProcessStore.hh"
|
||||
@@ -94,7 +94,8 @@ G4RunManager::G4RunManager()
|
||||
numberOfEventToBeProcessed(0),storeRandomNumberStatus(false),
|
||||
storeRandomNumberStatusToG4Event(0),rngStatusEventsFlag(false),
|
||||
currentWorld(0),nParallelWorlds(0),msgText(" "),n_select_msg(-1),
|
||||
numberOfEventProcessed(0),selectMacro(""),fakeRun(false)
|
||||
numberOfEventProcessed(0),selectMacro(""),fakeRun(false),
|
||||
isScoreNtupleWriter(false)
|
||||
{
|
||||
if(fRunManager)
|
||||
{
|
||||
@@ -134,7 +135,8 @@ G4RunManager::G4RunManager( RMType rmType )
|
||||
numberOfEventToBeProcessed(0),storeRandomNumberStatus(false),
|
||||
storeRandomNumberStatusToG4Event(0),rngStatusEventsFlag(false),
|
||||
currentWorld(0),nParallelWorlds(0),msgText(" "),n_select_msg(-1),
|
||||
numberOfEventProcessed(0),selectMacro(""),fakeRun(false)
|
||||
numberOfEventProcessed(0),selectMacro(""),fakeRun(false),
|
||||
isScoreNtupleWriter(false)
|
||||
{
|
||||
//This version of the constructor should never be called in sequential mode!
|
||||
#ifndef G4MULTITHREADED
|
||||
@@ -338,7 +340,13 @@ void G4RunManager::RunInitialization()
|
||||
G4SDManager* fSDM = G4SDManager::GetSDMpointerIfExist();
|
||||
if(fSDM)
|
||||
{ currentRun->SetHCtable(fSDM->GetHCtable()); }
|
||||
|
||||
|
||||
if ( G4VScoreNtupleWriter::Instance() ) {
|
||||
auto hce = fSDM->PrepareNewEvent();
|
||||
isScoreNtupleWriter = G4VScoreNtupleWriter::Instance()->Book(hce);
|
||||
delete hce;
|
||||
}
|
||||
|
||||
std::ostringstream oss;
|
||||
G4Random::saveFullState(oss);
|
||||
randomNumberStatusForThisRun = oss.str();
|
||||
@@ -351,6 +359,9 @@ void G4RunManager::RunInitialization()
|
||||
{ G4cout << "### Run " << currentRun->GetRunID() << " starts." << G4endl; }
|
||||
if(userRunAction) userRunAction->BeginOfRunAction(currentRun);
|
||||
|
||||
if (isScoreNtupleWriter)
|
||||
{ G4VScoreNtupleWriter::Instance()->OpenFile(); }
|
||||
|
||||
if(storeRandomNumberStatus) {
|
||||
G4String fileN = "currentRun";
|
||||
if ( rngStatusEventsFlag ) {
|
||||
@@ -492,6 +503,9 @@ void G4RunManager::RunTermination()
|
||||
if(userRunAction) userRunAction->EndOfRunAction(currentRun);
|
||||
G4VPersistencyManager* fPersM = G4VPersistencyManager::GetPersistencyManager();
|
||||
if(fPersM) fPersM->Store(currentRun);
|
||||
// write & close analysis output
|
||||
if (isScoreNtupleWriter)
|
||||
{ G4VScoreNtupleWriter::Instance()->Write(); }
|
||||
runIDCounter++;
|
||||
}
|
||||
|
||||
@@ -805,6 +819,12 @@ void G4RunManager::ConstructScoringWorlds()
|
||||
|
||||
void G4RunManager::UpdateScoring()
|
||||
{
|
||||
if (isScoreNtupleWriter)
|
||||
{
|
||||
G4VScoreNtupleWriter::Instance()
|
||||
->Fill(currentEvent->GetHCofThisEvent(), currentEvent->GetEventID());
|
||||
}
|
||||
|
||||
G4ScoringManager* ScM = G4ScoringManager::GetScoringManagerIfExist();
|
||||
if(!ScM) return;
|
||||
G4int nPar = ScM->GetNumberOfMesh();
|
||||
@@ -929,6 +949,7 @@ void G4RunManager::GeometryHasBeenModified(G4bool prop)
|
||||
#include "G4GeometryManager.hh"
|
||||
#include "G4PhysicalVolumeStore.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4AssemblyStore.hh"
|
||||
#include "G4SolidStore.hh"
|
||||
#include "G4RegionStore.hh"
|
||||
|
||||
@@ -938,10 +959,11 @@ void G4RunManager::ReinitializeGeometry(G4bool destroyFirst, G4bool prop)
|
||||
{
|
||||
if(verboseLevel>0)
|
||||
{
|
||||
G4cout<<"#### G4PhysicalVolumeStore, G4LogicalVolumeStore and G4SolidStore\n"
|
||||
<<"#### are wiped out."<<G4endl;
|
||||
G4cout << "#### Assemblies, Volumes and Solids Stores are wiped out."
|
||||
<< G4endl;
|
||||
}
|
||||
G4GeometryManager::GetInstance()->OpenGeometry();
|
||||
G4AssemblyStore::GetInstance()->Clean();
|
||||
G4PhysicalVolumeStore::GetInstance()->Clean();
|
||||
G4LogicalVolumeStore::GetInstance()->Clean();
|
||||
G4SolidStore::GetInstance()->Clean();
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManagerKernel.cc 110726 2018-06-11 06:05:16Z gcosmo $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunMessenger.cc 95634 2016-02-17 08:05:21Z gcosmo $
|
||||
//
|
||||
|
||||
#include "G4RunMessenger.hh"
|
||||
@@ -194,7 +193,7 @@ G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
|
||||
optCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
brkBoECmd = new G4UIcmdWithABool("/run/breakAtBeginOfEvent",this);
|
||||
brkBoECmd->SetGuidance("Set a break point at the begining of every event.");
|
||||
brkBoECmd->SetGuidance("Set a break point at the beginning of every event.");
|
||||
brkBoECmd->SetParameterName("flag",true);
|
||||
brkBoECmd->SetDefaultValue(true);
|
||||
|
||||
@@ -268,8 +267,8 @@ G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
|
||||
|
||||
savingFlagCmd = new G4UIcmdWithABool("/random/setSavingFlag",this);
|
||||
savingFlagCmd->SetGuidance("The randomNumberStatus will be saved at :");
|
||||
savingFlagCmd->SetGuidance("begining of run (currentRun.rndm) and "
|
||||
"begining of event (currentEvent.rndm) ");
|
||||
savingFlagCmd->SetGuidance("beginning of run (currentRun.rndm) and "
|
||||
"beginning of event (currentEvent.rndm) ");
|
||||
savingFlagCmd->SetParameterName("flag",true);
|
||||
savingFlagCmd->SetDefaultValue(true);
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UserPhysicsListMessenger.cc 108133 2018-01-09 13:25:44Z gcosmo $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UserRunAction.cc 68997 2013-04-15 09:21:24Z gcosmo $
|
||||
//
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VModularPhysicsList.cc 103803 2017-04-27 14:03:05Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VPersistencyManager.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
//
|
||||
|
||||
#include "G4VPersistencyManager.hh"
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
// GEANT4 tag $Name:$
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserDetectorConstruction.cc 104521 2017-06-02 07:17:28Z gcosmo $
|
||||
//
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserParallelWorld.cc 69917 2013-05-17 13:28:02Z gcosmo $
|
||||
//
|
||||
|
||||
#include "G4VUserParallelWorld.hh"
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserPhysicsList.cc 110264 2018-05-17 14:29:16Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserPrimaryGeneratorAction.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
//
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4VScoreNtupleWriter.hh"
|
||||
#include "G4VScoringMesh.hh"
|
||||
#include "G4Timer.hh"
|
||||
#include "G4TiMemory.hh"
|
||||
@@ -175,6 +176,13 @@ void G4WorkerRunManager::RunInitialization()
|
||||
if(fSDM)
|
||||
{ currentRun->SetHCtable(fSDM->GetHCtable()); }
|
||||
|
||||
if ( G4VScoreNtupleWriter::Instance() )
|
||||
{
|
||||
auto hce = fSDM->PrepareNewEvent();
|
||||
isScoreNtupleWriter = G4VScoreNtupleWriter::Instance()->Book(hce);
|
||||
delete hce;
|
||||
}
|
||||
|
||||
std::ostringstream oss;
|
||||
G4Random::saveFullState(oss);
|
||||
randomNumberStatusForThisRun = oss.str();
|
||||
@@ -190,6 +198,10 @@ void G4WorkerRunManager::RunInitialization()
|
||||
}
|
||||
if(userRunAction) userRunAction->BeginOfRunAction(currentRun);
|
||||
|
||||
if (isScoreNtupleWriter) {
|
||||
G4VScoreNtupleWriter::Instance()->OpenFile();
|
||||
}
|
||||
|
||||
if(storeRandomNumberStatus) {
|
||||
G4String fileN = "currentRun";
|
||||
if ( rngStatusEventsFlag ) {
|
||||
@@ -643,7 +655,7 @@ void G4WorkerRunManager::DoWork()
|
||||
else
|
||||
{
|
||||
G4ExceptionDescription d;
|
||||
d<<"Cannot continue, this worker has been requested an unknwon action: "
|
||||
d<<"Cannot continue, this worker has been requested an unknown action: "
|
||||
<<static_cast<std::underlying_type<G4MTRunManager::WorkerActionRequest>::type>(nextAction);
|
||||
G4Exception("G4WorkerRunManager::DoWork","Run0104",FatalException,d);
|
||||
}
|
||||
|
||||
@@ -28,9 +28,7 @@
|
||||
#include "G4MTRunManager.hh"
|
||||
|
||||
#include "G4GeometryWorkspace.hh"
|
||||
#include "G4GeometryWorkspacePool.hh"
|
||||
#include "G4SolidsWorkspace.hh"
|
||||
#include "G4SolidsWorkspacePool.hh"
|
||||
#include "G4ParticlesWorkspace.hh"
|
||||
#include "G4PhysicsListWorkspace.hh"
|
||||
|
||||
@@ -63,22 +61,21 @@ G4int G4WorkerThread::GetNumberThreads() const
|
||||
|
||||
void G4WorkerThread::BuildGeometryAndPhysicsVector()
|
||||
{
|
||||
// Initialise all split classes in the geometry
|
||||
// Initialise all split classes
|
||||
// with copy of data from master thread
|
||||
|
||||
G4GeometryWorkspacePool::GetInstance()->CreateAndUseWorkspace();
|
||||
G4SolidsWorkspacePool::GetInstance()->CreateAndUseWorkspace();
|
||||
G4GeometryWorkspace::GetPool()->CreateAndUseWorkspace();
|
||||
G4SolidsWorkspace::GetPool()->CreateAndUseWorkspace();
|
||||
G4ParticlesWorkspace::GetPool()->CreateAndUseWorkspace();
|
||||
G4PhysicsListWorkspace::GetPool()->CreateAndUseWorkspace();
|
||||
}
|
||||
|
||||
void G4WorkerThread::DestroyGeometryAndPhysicsVector()
|
||||
{
|
||||
// Initialise all split classes in the geometry
|
||||
// with copy of data from master thread
|
||||
// Clear all split classes
|
||||
|
||||
G4GeometryWorkspacePool::GetInstance()->CleanUpAndDestroyAllWorkspaces();
|
||||
G4SolidsWorkspacePool::GetInstance()->CleanUpAndDestroyAllWorkspaces();
|
||||
G4GeometryWorkspace::GetPool()->CleanUpAndDestroyAllWorkspaces();
|
||||
G4SolidsWorkspace::GetPool()->CleanUpAndDestroyAllWorkspaces();
|
||||
G4ParticlesWorkspace::GetPool()->CleanUpAndDestroyAllWorkspaces();
|
||||
G4PhysicsListWorkspace::GetPool()->CleanUpAndDestroyAllWorkspaces();
|
||||
}
|
||||
@@ -158,10 +155,10 @@ void G4WorkerThread::UpdateGeometryAndPhysicsVectorFromMaster()
|
||||
// Step-1: Clean the workspace
|
||||
//===========================
|
||||
G4GeometryWorkspace* geomWorkspace =
|
||||
G4GeometryWorkspacePool::GetInstance()->GetWorkspace();
|
||||
G4GeometryWorkspace::GetPool()->GetWorkspace();
|
||||
geomWorkspace->DestroyWorkspace();
|
||||
G4SolidsWorkspace* solidWorkspace =
|
||||
G4SolidsWorkspacePool::GetInstance()->GetWorkspace();
|
||||
G4SolidsWorkspace::GetPool()->GetWorkspace();
|
||||
solidWorkspace->DestroyWorkspace();
|
||||
|
||||
//===========================
|
||||
|
||||
Reference in New Issue
Block a user