Main program of the GB06 example.
More...
#include "G4RunManager.hh"
#include "GB06ActionInitialization.hh"
#include "G4UImanager.hh"
#include "GB06DetectorConstruction.hh"
#include "GB06ParallelWorldForSlices.hh"
#include "GB06PrimaryGeneratorAction.hh"
#include "FTFP_BERT.hh"
#include "G4GenericBiasingPhysics.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Main program of the GB06 example.
Definition in file exampleGB06.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 72 of file exampleGB06.cc.
References PrintUsage().
83 if ( argc == 2 ) macro = argv[1];
86 for ( G4int i=1; i<argc; i=i+2 )
88 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
89 else if (
G4String(argv[i]) ==
"-b" ) onOffBiasing = argv[i+1];
98 if ( onOffBiasing ==
"" ) onOffBiasing =
"on";
101 #ifdef G4MULTITHREADED 102 G4MTRunManager * runManager =
new G4MTRunManager;
103 G4cout <<
" ********** Run Manager constructed in MT mode ************ " 106 runManager->SetNumberOfThreads(4);
108 G4RunManager * runManager =
new G4RunManager;
109 G4cout <<
" ********** Run Manager constructed in sequential mode ************ " 117 GB06DetectorConstruction* detector =
new GB06DetectorConstruction();
119 GB06ParallelWorldForSlices* parallelWorld =
120 new GB06ParallelWorldForSlices(
"parallelWorldForSlices");
122 detector->RegisterParallelWorld( parallelWorld );
123 runManager->SetUserInitialization(detector);
126 FTFP_BERT* physicsList =
new FTFP_BERT;
128 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
129 biasingPhysics->BeVerbose();
130 if ( onOffBiasing ==
"on" )
135 biasingPhysics->NonPhysicsBias(
"neutron");
137 biasingPhysics->AddParallelGeometry(
"neutron",
"parallelWorldForSlices");
138 physicsList->RegisterPhysics(biasingPhysics);
139 G4cout <<
" ********************************************************* " 141 G4cout <<
" ********** processes are wrapped for biasing ************ " 143 G4cout <<
" ********************************************************* " 148 G4cout <<
" ************************************************* " << G4endl;
149 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
150 G4cout <<
" ************************************************* " << G4endl;
152 runManager->SetUserInitialization(physicsList);
155 runManager->SetUserInitialization(
new GB06ActionInitialization);
158 runManager->Initialize();
163 G4VisManager* visManager =
new G4VisExecutive;
165 visManager->Initialize();
169 G4UImanager* UImanager = G4UImanager::GetUIpointer();
173 G4String command =
"/control/execute ";
174 UImanager->ApplyCommand(command+macro);
179 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);
181 UImanager->ApplyCommand(
"/control/execute vis.mac");