Main program of example GB05.
More...
#include "G4RunManager.hh"
#include "GB05ActionInitialization.hh"
#include "G4UImanager.hh"
#include "GB05DetectorConstruction.hh"
#include "GB05PrimaryGeneratorAction.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 example GB05.
Definition in file exampleGB05.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 71 of file exampleGB05.cc.
References PrintUsage().
82 if ( argc == 2 ) macro = argv[1];
85 for ( G4int i=1; i<argc; i=i+2 )
87 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
88 else if (
G4String(argv[i]) ==
"-b" ) onOffBiasing = argv[i+1];
97 if ( onOffBiasing ==
"" ) onOffBiasing =
"on";
100 #ifdef G4MULTITHREADED 101 G4MTRunManager * runManager =
new G4MTRunManager;
102 G4cout <<
" ********** Run Manager constructed in MT mode ************ " 105 runManager->SetNumberOfThreads(4);
107 G4RunManager * runManager =
new G4RunManager;
108 G4cout <<
" ********** Run Manager constructed in sequential mode ************ " 114 GB05DetectorConstruction* detector =
new GB05DetectorConstruction();
115 runManager->SetUserInitialization(detector);
117 FTFP_BERT* physicsList =
new FTFP_BERT;
119 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
120 biasingPhysics->BeVerbose();
121 if ( onOffBiasing ==
"on" )
123 biasingPhysics->Bias(
"neutron");
124 physicsList->RegisterPhysics(biasingPhysics);
125 G4cout <<
" ********************************************************* " 127 G4cout <<
" ********** processes are wrapped for biasing ************ " 129 G4cout <<
" ********************************************************* " 134 G4cout <<
" ************************************************* " << G4endl;
135 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
136 G4cout <<
" ************************************************* " << G4endl;
138 runManager->SetUserInitialization(physicsList);
140 runManager->SetUserInitialization(
new GB05ActionInitialization);
143 runManager->Initialize();
148 G4VisManager* visManager =
new G4VisExecutive;
150 visManager->Initialize();
154 G4UImanager* UImanager = G4UImanager::GetUIpointer();
158 G4String command =
"/control/execute ";
159 UImanager->ApplyCommand(command+macro);
164 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);
166 UImanager->ApplyCommand(
"/control/execute vis.mac");