Main program of the GB06 example.
More...
#include "G4Types.hh"
#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"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.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 68 of file exampleGB06.cc.
References PrintUsage().
79 if ( argc == 2 ) macro = argv[1];
82 for ( G4int i=1; i<argc; i=i+2 )
84 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
85 else if (
G4String(argv[i]) ==
"-b" ) onOffBiasing = argv[i+1];
94 if ( onOffBiasing ==
"" ) onOffBiasing =
"on";
97 G4UIExecutive* ui =
nullptr;
99 ui =
new G4UIExecutive(argc, argv);
103 #ifdef G4MULTITHREADED 104 G4MTRunManager * runManager =
new G4MTRunManager;
105 G4cout <<
" ********** Run Manager constructed in MT mode ************ " 108 runManager->SetNumberOfThreads(4);
110 G4RunManager * runManager =
new G4RunManager;
111 G4cout <<
" ********** Run Manager constructed in sequential mode ************ " 119 GB06DetectorConstruction* detector =
new GB06DetectorConstruction();
121 GB06ParallelWorldForSlices* parallelWorld =
122 new GB06ParallelWorldForSlices(
"parallelWorldForSlices");
124 detector->RegisterParallelWorld( parallelWorld );
125 runManager->SetUserInitialization(detector);
128 FTFP_BERT* physicsList =
new FTFP_BERT;
130 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
131 biasingPhysics->BeVerbose();
132 if ( onOffBiasing ==
"on" )
137 biasingPhysics->NonPhysicsBias(
"neutron");
139 biasingPhysics->AddParallelGeometry(
"neutron",
"parallelWorldForSlices");
140 physicsList->RegisterPhysics(biasingPhysics);
141 G4cout <<
" ********************************************************* " 143 G4cout <<
" ********** processes are wrapped for biasing ************ " 145 G4cout <<
" ********************************************************* " 150 G4cout <<
" ************************************************* " << G4endl;
151 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
152 G4cout <<
" ************************************************* " << G4endl;
154 runManager->SetUserInitialization(physicsList);
157 runManager->SetUserInitialization(
new GB06ActionInitialization);
160 runManager->Initialize();
163 G4VisManager* visManager =
new G4VisExecutive;
165 visManager->Initialize();
168 G4UImanager* UImanager = G4UImanager::GetUIpointer();
172 G4String command =
"/control/execute ";
173 UImanager->ApplyCommand(command+macro);
177 UImanager->ApplyCommand(
"/control/execute vis.mac");