Main program of the optical/wls example.
More...
#include <unistd.h>
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "WLSPhysicsList.hh"
#include "WLSDetectorConstruction.hh"
#include "WLSActionInitialization.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 67 of file wls.cc.
References seed.
69 #ifdef G4MULTITHREADED 70 G4MTRunManager * runManager =
new G4MTRunManager;
73 if (argc > 2) seed = atoi(argv[argc-1]);
77 G4Random::setTheEngine(
new CLHEP::RanecuEngine);
78 G4Random::setTheSeed(seed);
80 G4RunManager * runManager =
new G4RunManager;
87 while ((c=getopt(argc,argv,
"p")) != -1)
93 G4cout <<
"Physics List used is " << physName << G4endl;
97 "Option -%c requires an operand\n", optopt);
101 "Unrecognised option: -%c\n", optopt);
109 WLSDetectorConstruction* detector =
new WLSDetectorConstruction();
110 runManager->SetUserInitialization(detector);
112 runManager->SetUserInitialization(
new WLSPhysicsList(physName));
114 runManager->SetUserInitialization(
new WLSActionInitialization(detector));
119 G4VisManager* visManager =
new G4VisExecutive;
122 visManager->Initialize();
127 G4UImanager * UImanager = G4UImanager::GetUIpointer();
131 if (argc > 2) { optmax = optmax-1; }
135 G4String command =
"/control/execute ";
136 for ( ; optind < optmax; optind++)
138 G4String macroFilename = argv[optind];
139 UImanager->ApplyCommand(command+macroFilename);
142 #else // Simple UI for Windows runs, no possibility of additional arguments 145 G4String command =
"/control/execute ";
147 UImanager->ApplyCommand(command+fileName);
153 G4UIExecutive * ui =
new G4UIExecutive(argc,argv);
155 UImanager->ApplyCommand(
"/control/execute init.in");
158 UImanager->ApplyCommand(
"/control/execute gui.mac");