Main program of the optical/wls example.
More...
#include <unistd.h>
#include "G4Types.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "FTFP_BERT.hh"
#include "G4OpticalPhysics.hh"
#include "G4EmStandardPhysics_option4.hh"
#include "WLSDetectorConstruction.hh"
#include "WLSActionInitialization.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Main program of the optical/wls example.
Definition in file wls.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 64 of file wls.cc.
References seed.
67 G4UIExecutive* ui =
nullptr;
69 ui =
new G4UIExecutive(argc, argv);
72 #ifdef G4MULTITHREADED 73 G4MTRunManager * runManager =
new G4MTRunManager;
76 if (argc > 2) seed = atoi(argv[argc-1]);
80 G4Random::setTheEngine(
new CLHEP::RanecuEngine);
81 G4Random::setTheSeed(seed);
83 G4RunManager * runManager =
new G4RunManager;
89 WLSDetectorConstruction* detector =
new WLSDetectorConstruction();
90 runManager->SetUserInitialization(detector);
93 G4VModularPhysicsList* physicsList =
new FTFP_BERT;
94 physicsList->ReplacePhysics(
new G4EmStandardPhysics_option4());
95 G4OpticalPhysics* opticalPhysics =
new G4OpticalPhysics();
96 physicsList->RegisterPhysics(opticalPhysics);
97 runManager->SetUserInitialization(physicsList);
100 runManager->SetUserInitialization(
new WLSActionInitialization(detector));
103 G4VisManager* visManager =
new G4VisExecutive;
104 visManager->Initialize();
108 G4UImanager * UImanager = G4UImanager::GetUIpointer();
112 if (argc > 2) { optmax = optmax-1; }
116 G4String command =
"/control/execute ";
117 for ( ; optind < optmax; optind++)
119 G4String macroFilename = argv[optind];
120 UImanager->ApplyCommand(command+macroFilename);
123 #else // Simple UI for Windows runs, no possibility of additional arguments 126 G4String command =
"/control/execute ";
128 UImanager->ApplyCommand(command+fileName);
133 UImanager->ApplyCommand(
"/control/execute init.in");
135 UImanager->ApplyCommand(
"/control/execute gui.mac");