Main program of example GB05.
More...
#include "G4Types.hh"
#include "G4RunManager.hh"
#include "GB05ActionInitialization.hh"
#include "G4UImanager.hh"
#include "GB05DetectorConstruction.hh"
#include "GB05PrimaryGeneratorAction.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 example GB05.
Definition in file exampleGB05.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 66 of file exampleGB05.cc.
References PrintUsage().
77 if ( argc == 2 ) macro = argv[1];
80 for ( G4int i=1; i<argc; i=i+2 )
82 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
83 else if (
G4String(argv[i]) ==
"-b" ) onOffBiasing = argv[i+1];
92 if ( onOffBiasing ==
"" ) onOffBiasing =
"on";
95 G4UIExecutive* ui =
nullptr;
97 ui =
new G4UIExecutive(argc, argv);
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 ************ " 115 GB05DetectorConstruction* detector =
new GB05DetectorConstruction();
116 runManager->SetUserInitialization(detector);
118 FTFP_BERT* physicsList =
new FTFP_BERT;
120 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
121 biasingPhysics->BeVerbose();
122 if ( onOffBiasing ==
"on" )
124 biasingPhysics->Bias(
"neutron");
125 physicsList->RegisterPhysics(biasingPhysics);
126 G4cout <<
" ********************************************************* " 128 G4cout <<
" ********** processes are wrapped for biasing ************ " 130 G4cout <<
" ********************************************************* " 135 G4cout <<
" ************************************************* " << G4endl;
136 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
137 G4cout <<
" ************************************************* " << G4endl;
139 runManager->SetUserInitialization(physicsList);
141 runManager->SetUserInitialization(
new GB05ActionInitialization);
144 runManager->Initialize();
147 G4VisManager* visManager =
new G4VisExecutive;
149 visManager->Initialize();
152 G4UImanager* UImanager = G4UImanager::GetUIpointer();
156 G4String command =
"/control/execute ";
157 UImanager->ApplyCommand(command+macro);
161 UImanager->ApplyCommand(
"/control/execute vis.mac");