Import Geant4 10.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2018-12-07 15:15:39 +01:00
parent 6aa23be517
commit db49709b53
11370 changed files with 187480 additions and 160142 deletions
-1
View File
@@ -7,7 +7,6 @@
#
# Generated on : 24/9/2010
#
# $Id: CMakeLists.txt 68802 2013-04-05 13:54:41Z gcosmo $
#
#------------------------------------------------------------------------------
-1
View File
@@ -1,4 +1,3 @@
# $Id: GNUmakefile 99173 2016-09-07 09:36:59Z gcosmo $
# ----------------------------------------------------------
# GNUmakefile for run library. Gabriele Cosmo, 3/4/1997.
# ----------------------------------------------------------
+44 -1
View File
@@ -1,4 +1,3 @@
$Id: History 110726 2018-06-11 06:05:16Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +16,50 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
November 9th, 2018, J. Apostolakis (run-V10-04-22)
- G4PhysicsListHelper - new methods to set low or high 'looper' thresholds
in Transportation classes (simple & coupled.)
NOTE: requires co-working tag transport-V10-04-13
November 9th, 2018, G. Cosmo (run-V10-04-21)
- G4RunMessenger, G4WorkerRunManager: fixed printout typos.
November 7th, 2018, I. Hrivnacova (run-V10-04-20)
- Removed a debug printing introduced with G4VScoreNtupleWriter.
October 30th, 2018, I. Hrivnacova (run-V10-04-17,18,19)
- Removed the dependence on analysis:
using the G4VScoreNtupleWriter interface class instead
of the concrete class
October 27th, 2018, I. Hrivnacova (run-V10-04-16)
- Fixed GNUmakefile: added analysis/management include
October 25th, 2018, I. Hrivnacova (run-V10-04-15)
- Fixed dependencies in sources.cmake
October 25th, 2018, J.Madsen (run-V10-04-14)
- Minor update to G4Run constructor to invoke G4StatAnalysis::ResetCpuClock().
this enables the calculation of the FOM for G4StatAnalysis without requiring
each instance to hold it's own timer.
October 25th, 2018, I. Hrivnacova (run-V10-04-13)
- Adding calls to new G4ScoreNtupleWriter, if activated.
This utility class implements automated storing of hits collections
of G4THitsMap<G4double> type (used by primitive scorers) vith Geant4
analysis tools.
October 10th, 2018, G.Cosmo (run-V10-04-12)
- Added clearing of G4AssemblyStore in G4RunManager::ReinitializeGeometry().
August 18th, 2018, V.Ivanchenko (run-V10-04-11)
- G4PhysicsListHelper - added two new EM physics process types
July 12th, 2018, G. Cosmo (run-V10-04-10)
- G4WorkerThread: use G4GeometryWorkspace and G4SolidsWorkspace the same
way as the other workspaces, through the templated worskspace pool class.
- Coworks with tags in geometry and visualization/management.
June 8th, 2018, J. Madsen (run-V10-04-09)
- Fixed compilation warnings related to TIMEMORY_AUTO_TIMER macros on Windows
-1
View File
@@ -1,4 +1,3 @@
// $Id: README.TXT 66892 2013-01-17 10:57:59Z gunter $
GEANT4
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4AdjointPrimaryGeneratorAction.hh 98735 2016-08-09 10:54:06Z gcosmo $
//
/////////////////////////////////////////////////////////////////////////////////
// Class Name: G4AdjointPrimaryGeneratorAction
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4AdjointSimManager.hh 102435 2017-01-27 08:28:15Z gcosmo $
//
/////////////////////////////////////////////////////////////////////////////////
// Class Name: G4AdjointSimManager.hh
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4AdjointSimMessenger.hh 98735 2016-08-09 10:54:06Z gcosmo $
//
/////////////////////////////////////////////////////////////////////////////////
// Class Name: G4AdjointSimMessenger.hh
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4ExceptionHandler.hh 109231 2018-04-05 06:57:57Z gcosmo $
//
//
// ------------------------------------------------------------
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4MSSteppingAction.hh 66892 2013-01-17 10:57:59Z gunter $
//
//
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4MatScanMessenger.hh 66892 2013-01-17 10:57:59Z gunter $
//
//
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4MaterialScanner.hh 66892 2013-01-17 10:57:59Z gunter $
//
//
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4MultiRunAction.hh 90212 2016-01-27 18:33:12Z adotti $
//
//---------------------------------------------------------------
//
+7 -1
View File
@@ -70,7 +70,12 @@ class G4PhysicsListHelper
// Set flag for using CoupledTransportation
void UseCoupledTransportation(G4bool vl=true);
// Change the thresholds for killing looping tracks of the
// transportation (simple or coupled.)
void UseHighLooperThresholds() { theLooperThresholds= 2;}
void UseLowLooperThresholds() { theLooperThresholds= 0;}
/////////////////////////////////////////////////////////////////
public:
// check consistencies of list of particles
@@ -104,6 +109,7 @@ class G4PhysicsListHelper
G4ParticleTable::G4PTblDicIterator* aParticleIterator;
G4bool useCoupledTransportation;
G4int theLooperThresholds= 1; // 0 = Low, 1 = default, 2 = high
G4VProcess* theTransportationProcess;
G4int verboseLevel;
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4Run.hh 68798 2013-04-05 13:28:19Z gcosmo $
//
#ifndef G4Run_h
+1 -1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4RunManager.hh 95232 2016-02-01 14:31:22Z gcosmo $
//
//
@@ -325,6 +324,7 @@ public: // with description
G4int numberOfEventProcessed;
G4String selectMacro;
G4bool fakeRun;
G4bool isScoreNtupleWriter;
public:
virtual void rndmSaveThisRun();
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4RunManagerKernel.hh 83384 2014-08-21 14:24:13Z gcosmo $
//
//
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4RunMessenger.hh 95634 2016-02-17 08:05:21Z gcosmo $
//
//
// GEANT 4 class header file
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4UserPhysicsListMessenger.hh 66892 2013-01-17 10:57:59Z gunter $
//
//
//---------------------------------------------------------------
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4UserRunAction.hh 95232 2016-02-01 14:31:22Z gcosmo $
//
#ifndef G4UserRunAction_h
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4VModularPhysicsList.hh 103803 2017-04-27 14:03:05Z gcosmo $
//
//
// ------------------------------------------------------------
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4VPersistencyManager.hh 66892 2013-01-17 10:57:59Z gunter $
//
#ifndef G4VPersistencyManager_h
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4VPhysicsConstructor.hh 103953 2017-05-04 11:27:35Z gcosmo $
//
//
// ------------------------------------------------------------
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: $
//
//
// ------------------------------------------------------------
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4VUserActionInitialization.hh 68830 2013-04-06 04:17:11Z asaim $
//
#ifndef G4VUserActionInitialization_h
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4VUserDetectorConstruction.hh 70423 2013-05-30 09:09:21Z gcosmo $
//
#ifndef G4VUserDetectorConstruction_h
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4VUserParallelWorld.hh 69917 2013-05-17 13:28:02Z gcosmo $
//
#ifndef G4VUserParallelWorld_h
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4VUserPhysicsList.hh 103803 2017-04-27 14:03:05Z gcosmo $
//
//
// ------------------------------------------------------------
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4VUserPrimaryGeneratorAction.hh 66892 2013-01-17 10:57:59Z gunter $
//
#ifndef G4VUserPrimaryGeneratorAction_h
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: $
//
//
// Defines for Windows DLLs import/export
+1 -2
View File
@@ -11,7 +11,6 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake 110673 2018-06-07 10:28:33Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -165,7 +164,7 @@ GEANT4_DEFINE_MODULE(NAME G4run
G4tracking
G4transportation
G4volumes
G4specsolids
G4specsolids
GLOBAL_DEPENDENCIES
G4digits_hits
G4event
@@ -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
-1
View File
@@ -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
-1
View File
@@ -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
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4ExceptionHandler.cc 109231 2018-04-05 06:57:57Z gcosmo $
//
//
// ------------------------------------------------------------
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4MSSteppingAction.cc 66892 2013-01-17 10:57:59Z gunter $
//
//
//
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4MatScanMessenger.cc 66892 2013-01-17 10:57:59Z gunter $
//
//
//
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4MaterialScanner.cc 66892 2013-01-17 10:57:59Z gunter $
//
//
//
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4MultiRunAction.hh 90212 2016-01-27 18:33:12Z adotti $
//
//---------------------------------------------------------------
//
+33 -10
View File
@@ -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;
+6 -2
View File
@@ -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()
{
+28 -6
View File
@@ -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();
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4RunManagerKernel.cc 110726 2018-06-11 06:05:16Z gcosmo $
//
//
+3 -4
View File
@@ -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 $
//
//
//---------------------------------------------------------------
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4UserRunAction.cc 68997 2013-04-15 09:21:24Z gcosmo $
//
#include "G4UserRunAction.hh"
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4VModularPhysicsList.cc 103803 2017-04-27 14:03:05Z gcosmo $
//
//
// ------------------------------------------------------------
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4VPersistencyManager.cc 66892 2013-01-17 10:57:59Z gunter $
//
#include "G4VPersistencyManager.hh"
-2
View File
@@ -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"
-1
View File
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4VUserParallelWorld.cc 69917 2013-05-17 13:28:02Z gcosmo $
//
#include "G4VUserParallelWorld.hh"
-1
View File
@@ -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"
+13 -1
View File
@@ -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);
}
+8 -11
View File
@@ -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();
//===========================