Main program of the GB04 example.
More...
#include "G4RunManager.hh"
#include "GB04ActionInitialization.hh"
#include "G4UImanager.hh"
#include "GB04DetectorConstruction.hh"
#include "GB04PrimaryGeneratorAction.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 GB04 example.
Definition in file exampleGB04.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 69 of file exampleGB04.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 ************ " 103 runManager->SetNumberOfThreads(4);
105 G4RunManager * runManager =
new G4RunManager;
106 G4cout <<
" ********** Run Manager constructed in sequential mode ************ " 112 GB04DetectorConstruction* detector =
new GB04DetectorConstruction();
113 runManager->SetUserInitialization(detector);
115 FTFP_BERT* physicsList =
new FTFP_BERT;
117 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
118 if ( onOffBiasing ==
"on" )
121 std::vector< G4String > processToBias;
122 processToBias.push_back(
"eBrem");
125 biasingPhysics->PhysicsBias(
"e-", processToBias);
126 biasingPhysics->PhysicsBias(
"e+", processToBias);
127 physicsList->RegisterPhysics(biasingPhysics);
128 G4cout <<
" ********************************************************* " 130 G4cout <<
" ********** processes are wrapped for biasing ************ " 132 G4cout <<
" ********************************************************* " 137 G4cout <<
" ************************************************* " << G4endl;
138 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
139 G4cout <<
" ************************************************* " << G4endl;
141 runManager->SetUserInitialization(physicsList);
143 runManager->SetUserInitialization(
new GB04ActionInitialization);
146 runManager->Initialize();
151 G4VisManager* visManager =
new G4VisExecutive;
153 visManager->Initialize();
157 G4UImanager* UImanager = G4UImanager::GetUIpointer();
161 G4String command =
"/control/execute ";
162 UImanager->ApplyCommand(command+macro);
167 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);