Main program of the GB01 example.
More...
#include "G4Types.hh"
#include "G4RunManager.hh"
#include "GB01ActionInitialization.hh"
#include "G4UImanager.hh"
#include "GB01DetectorConstruction.hh"
#include "GB01PrimaryGeneratorAction.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 GB01 example.
Definition in file exampleGB01.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 65 of file exampleGB01.cc.
References PrintUsage().
76 if ( argc == 2 ) macro = argv[1];
79 for ( G4int i=1; i<argc; i=i+2 )
81 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
82 else if (
G4String(argv[i]) ==
"-b" ) onOffBiasing = argv[i+1];
91 if ( onOffBiasing ==
"" ) onOffBiasing =
"on";
94 G4UIExecutive* ui =
nullptr;
96 ui =
new G4UIExecutive(argc, argv);
100 #ifdef G4MULTITHREADED 101 G4MTRunManager * runManager =
new G4MTRunManager;
102 G4cout <<
" ********** Run Manager constructed in MT mode ************ " << G4endl;
104 runManager->SetNumberOfThreads(4);
106 G4RunManager * runManager =
new G4RunManager;
107 G4cout <<
" ********** Run Manager constructed in sequential mode ************ " << G4endl;
111 GB01DetectorConstruction* detector =
new GB01DetectorConstruction();
112 runManager->SetUserInitialization(detector);
114 FTFP_BERT* physicsList =
new FTFP_BERT;
116 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
117 if ( onOffBiasing ==
"on" )
119 biasingPhysics->Bias(
"gamma");
120 biasingPhysics->Bias(
"neutron");
121 biasingPhysics->Bias(
"kaon0L");
122 biasingPhysics->Bias(
"kaon0S");
123 physicsList->RegisterPhysics(biasingPhysics);
124 G4cout <<
" ********************************************************* " << G4endl;
125 G4cout <<
" ********** processes are wrapped for biasing ************ " << G4endl;
126 G4cout <<
" ********************************************************* " << G4endl;
130 G4cout <<
" ************************************************* " << G4endl;
131 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
132 G4cout <<
" ************************************************* " << G4endl;
134 runManager->SetUserInitialization(physicsList);
136 runManager->SetUserInitialization(
new GB01ActionInitialization);
139 runManager->Initialize();
142 G4VisManager* visManager =
new G4VisExecutive;
144 visManager->Initialize();
147 G4UImanager* UImanager = G4UImanager::GetUIpointer();
151 G4String command =
"/control/execute ";
152 UImanager->ApplyCommand(command+macro);