Import Geant4 11.3.0.beta source tree
This commit is contained in:
@@ -42,36 +42,38 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "ActionInitialization.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "G4RunManagerFactory.hh"
|
||||
#include "G4GenericPhysicsList.hh"
|
||||
#include "G4VModularPhysicsList.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4VisExecutive.hh"
|
||||
#include "G4RunManagerFactory.hh"
|
||||
#include "G4UIExecutive.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4VModularPhysicsList.hh"
|
||||
#include "G4VisExecutive.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
namespace {
|
||||
void PrintUsage() {
|
||||
G4cerr << " Usage: " << G4endl;
|
||||
G4cerr << " factory [-m macro ] [-p physListMacro ] [-u UIsession] [-t nThreads]" << G4endl;
|
||||
G4cerr << " note: -t option is available only for multi-threaded mode." << G4endl;
|
||||
G4cerr << G4endl;
|
||||
}
|
||||
namespace
|
||||
{
|
||||
void PrintUsage()
|
||||
{
|
||||
G4cerr << " Usage: " << G4endl;
|
||||
G4cerr << " factory [-m macro ] [-p physListMacro ] [-u UIsession] [-t nThreads]" << G4endl;
|
||||
G4cerr << " note: -t option is available only for multi-threaded mode." << G4endl;
|
||||
G4cerr << G4endl;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
int main(int argc,char** argv)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
// Evaluate arguments
|
||||
//
|
||||
if ( argc > 9 ) {
|
||||
if (argc > 9) {
|
||||
PrintUsage();
|
||||
return 1;
|
||||
}
|
||||
@@ -83,13 +85,16 @@ int main(int argc,char** argv)
|
||||
#ifdef G4MULTITHREADED
|
||||
G4int nofThreads = 0;
|
||||
#endif
|
||||
for ( G4int i=1; i<argc; i=i+2 ) {
|
||||
if ( G4String(argv[i]) == "-m" ) macro = argv[i+1];
|
||||
else if ( G4String(argv[i]) == "-u" ) session = argv[i+1];
|
||||
else if ( G4String(argv[i]) == "-p" ) physListMacro = argv[i+1];
|
||||
for (G4int i = 1; i < argc; i = i + 2) {
|
||||
if (G4String(argv[i]) == "-m")
|
||||
macro = argv[i + 1];
|
||||
else if (G4String(argv[i]) == "-u")
|
||||
session = argv[i + 1];
|
||||
else if (G4String(argv[i]) == "-p")
|
||||
physListMacro = argv[i + 1];
|
||||
#ifdef G4MULTITHREADED
|
||||
else if ( G4String(argv[i]) == "-t" ) {
|
||||
nofThreads = G4UIcommand::ConvertToInt(argv[i+1]);
|
||||
else if (G4String(argv[i]) == "-t") {
|
||||
nofThreads = G4UIcommand::ConvertToInt(argv[i + 1]);
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
@@ -101,7 +106,7 @@ int main(int argc,char** argv)
|
||||
// Detect interactive mode (if no arguments) and define UI session
|
||||
//
|
||||
G4UIExecutive* ui = nullptr;
|
||||
if ( ! macro.size() ) {
|
||||
if (!macro.size()) {
|
||||
ui = new G4UIExecutive(argc, argv, session);
|
||||
}
|
||||
|
||||
@@ -111,7 +116,7 @@ int main(int argc,char** argv)
|
||||
// Construct the run manager
|
||||
auto* runManager = G4RunManagerFactory::CreateRunManager();
|
||||
#ifdef G4MULTITHREADED
|
||||
if ( nofThreads > 0 ) {
|
||||
if (nofThreads > 0) {
|
||||
runManager->SetNumberOfThreads(nofThreads);
|
||||
}
|
||||
#endif
|
||||
@@ -121,14 +126,14 @@ int main(int argc,char** argv)
|
||||
|
||||
// Physics List
|
||||
G4VModularPhysicsList* physList = nullptr;
|
||||
if ( physListMacro.size() ) {
|
||||
if (physListMacro.size()) {
|
||||
// via macro
|
||||
physList = new G4GenericPhysicsList();
|
||||
UImanager->ApplyCommand("/control/execute "+physListMacro);
|
||||
UImanager->ApplyCommand("/control/execute " + physListMacro);
|
||||
}
|
||||
else {
|
||||
// from vector of physics cobstructor names
|
||||
auto myConstructors = new std::vector<G4String>;
|
||||
auto myConstructors = new std::vector<G4String>;
|
||||
|
||||
myConstructors->push_back("G4EmStandardPhysics");
|
||||
myConstructors->push_back("G4EmExtraPhysics");
|
||||
@@ -155,10 +160,10 @@ int main(int argc,char** argv)
|
||||
// G4VisManager* visManager = new G4VisExecutive("Quiet");
|
||||
visManager->Initialize();
|
||||
|
||||
if ( macro.size() ) {
|
||||
if (macro.size()) {
|
||||
// batch mode
|
||||
G4String command = "/control/execute ";
|
||||
UImanager->ApplyCommand(command+macro);
|
||||
UImanager->ApplyCommand(command + macro);
|
||||
}
|
||||
else {
|
||||
// interactive mode : define UI session
|
||||
|
||||
Reference in New Issue
Block a user