Import Geant4 10.7.0 source tree
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
//
|
||||
// Author: V.Ivanchenko 20 June 2008
|
||||
//
|
||||
// Modified:
|
||||
// Modified:
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
//
|
||||
@@ -47,12 +47,7 @@
|
||||
#include "ActionInitialization.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
#include "G4MTRunManager.hh"
|
||||
#else
|
||||
#include "G4RunManager.hh"
|
||||
#endif
|
||||
|
||||
#include "G4RunManagerFactory.hh"
|
||||
#include "G4PhysListFactory.hh"
|
||||
#include "G4VModularPhysicsList.hh"
|
||||
#include "G4UImanager.hh"
|
||||
@@ -73,7 +68,7 @@ namespace {
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
int main(int argc,char** argv)
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
// Evaluate arguments
|
||||
//
|
||||
@@ -81,7 +76,7 @@ int main(int argc,char** argv)
|
||||
PrintUsage();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
G4String macro;
|
||||
G4String session;
|
||||
G4String physListName;
|
||||
@@ -102,8 +97,8 @@ int main(int argc,char** argv)
|
||||
PrintUsage();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Detect interactive mode (if no arguments) and define UI session
|
||||
//
|
||||
G4UIExecutive* ui = 0;
|
||||
@@ -115,31 +110,29 @@ int main(int argc,char** argv)
|
||||
G4Random::setTheEngine(new CLHEP::RanecuEngine());
|
||||
|
||||
// Construct the run manager
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MTRunManager * runManager = new G4MTRunManager();
|
||||
auto* runManager = G4RunManagerFactory::CreateRunManager();
|
||||
#ifdef G4MULTITHREADED
|
||||
if ( nofThreads > 0 ) {
|
||||
runManager->SetNumberOfThreads(nofThreads);
|
||||
}
|
||||
#else
|
||||
G4RunManager * runManager = new G4RunManager();
|
||||
#endif
|
||||
|
||||
// Physics list factory
|
||||
G4PhysListFactory factory;
|
||||
G4VModularPhysicsList* physList = nullptr;
|
||||
|
||||
// Get physics list name
|
||||
// Get physics list name
|
||||
if ( ! physListName.size() ) {
|
||||
// Physics List is defined via environment variable PHYSLIST
|
||||
char* physListNameEnv = std::getenv("PHYSLIST");
|
||||
if ( physListNameEnv ) {
|
||||
physListName = G4String(physListNameEnv);
|
||||
if ( physListNameEnv ) {
|
||||
physListName = G4String(physListNameEnv);
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the name is known to the factory
|
||||
if ( physListName.size() && (! factory.IsReferencePhysList(physListName) ) ) {
|
||||
G4cerr << "Physics list " << physListName
|
||||
G4cerr << "Physics list " << physListName
|
||||
<< " is not available in PhysListFactory." << G4endl;
|
||||
physListName.clear();
|
||||
}
|
||||
@@ -175,16 +168,16 @@ int main(int argc,char** argv)
|
||||
}
|
||||
else {
|
||||
// interactive mode : define UI session
|
||||
UImanager->ApplyCommand("/control/execute init_vis.mac");
|
||||
UImanager->ApplyCommand("/control/execute init_vis.mac");
|
||||
ui->SessionStart();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
// Job termination
|
||||
// Free the store: user actions, physics_list and detector_description are
|
||||
// owned and deleted by the run manager, so they should not be deleted
|
||||
// owned and deleted by the run manager, so they should not be deleted
|
||||
// in the main() program !
|
||||
|
||||
|
||||
delete visManager;
|
||||
delete runManager;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user