Main program of the GB01 example.
More...
#include "G4RunManager.hh"
#include "GB01ActionInitialization.hh"
#include "G4UImanager.hh"
#include "GB01DetectorConstruction.hh"
#include "GB01PrimaryGeneratorAction.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 GB01 example.
Definition in file exampleGB01.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 69 of file exampleGB01.cc.
References PrintUsage().
80 if ( argc == 2 ) macro = argv[1];
83 for ( G4int i=1; i<argc; i=i+2 )
85 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
86 else if (
G4String(argv[i]) ==
"-b" ) onOffBiasing = argv[i+1];
95 if ( onOffBiasing ==
"" ) onOffBiasing =
"on";
98 #ifdef G4MULTITHREADED 99 G4MTRunManager * runManager =
new G4MTRunManager;
100 G4cout <<
" ********** Run Manager constructed in MT mode ************ " << G4endl;
102 runManager->SetNumberOfThreads(4);
104 G4RunManager * runManager =
new G4RunManager;
105 G4cout <<
" ********** Run Manager constructed in sequential mode ************ " << G4endl;
109 GB01DetectorConstruction* detector =
new GB01DetectorConstruction();
110 runManager->SetUserInitialization(detector);
112 FTFP_BERT* physicsList =
new FTFP_BERT;
114 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
115 if ( onOffBiasing ==
"on" )
117 biasingPhysics->Bias(
"gamma");
118 biasingPhysics->Bias(
"neutron");
119 biasingPhysics->Bias(
"kaon0L");
120 biasingPhysics->Bias(
"kaon0S");
121 physicsList->RegisterPhysics(biasingPhysics);
122 G4cout <<
" ********************************************************* " << G4endl;
123 G4cout <<
" ********** processes are wrapped for biasing ************ " << G4endl;
124 G4cout <<
" ********************************************************* " << G4endl;
128 G4cout <<
" ************************************************* " << G4endl;
129 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
130 G4cout <<
" ************************************************* " << G4endl;
132 runManager->SetUserInitialization(physicsList);
134 runManager->SetUserInitialization(
new GB01ActionInitialization);
137 runManager->Initialize();
142 G4VisManager* visManager =
new G4VisExecutive;
144 visManager->Initialize();
148 G4UImanager* UImanager = G4UImanager::GetUIpointer();
152 G4String command =
"/control/execute ";
153 UImanager->ApplyCommand(command+macro);
158 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);