Main program of the GB04 example.
More...
#include "G4Types.hh"
#include "G4RunManager.hh"
#include "GB04ActionInitialization.hh"
#include "G4UImanager.hh"
#include "GB04DetectorConstruction.hh"
#include "GB04PrimaryGeneratorAction.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 GB04 example.
Definition in file exampleGB04.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 65 of file exampleGB04.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 ************ " 105 runManager->SetNumberOfThreads(4);
107 G4RunManager * runManager =
new G4RunManager;
108 G4cout <<
" ********** Run Manager constructed in sequential mode ************ " 113 GB04DetectorConstruction* detector =
new GB04DetectorConstruction();
114 runManager->SetUserInitialization(detector);
116 FTFP_BERT* physicsList =
new FTFP_BERT;
118 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
119 if ( onOffBiasing ==
"on" )
122 std::vector< G4String > processToBias;
123 processToBias.push_back(
"eBrem");
126 biasingPhysics->PhysicsBias(
"e-", processToBias);
127 biasingPhysics->PhysicsBias(
"e+", processToBias);
128 physicsList->RegisterPhysics(biasingPhysics);
129 G4cout <<
" ********************************************************* " 131 G4cout <<
" ********** processes are wrapped for biasing ************ " 133 G4cout <<
" ********************************************************* " 138 G4cout <<
" ************************************************* " << G4endl;
139 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
140 G4cout <<
" ************************************************* " << G4endl;
142 runManager->SetUserInitialization(physicsList);
144 runManager->SetUserInitialization(
new GB04ActionInitialization);
147 runManager->Initialize();
150 G4VisManager* visManager =
new G4VisExecutive;
152 visManager->Initialize();
155 G4UImanager* UImanager = G4UImanager::GetUIpointer();
159 G4String command =
"/control/execute ";
160 UImanager->ApplyCommand(command+macro);