32 #ifdef G4MULTITHREADED 33 #include "G4MTRunManager.hh" 35 #include "G4RunManager.hh" 37 #include "GB05ActionInitialization.hh" 39 #include "G4UImanager.hh" 41 #include "GB05DetectorConstruction.hh" 42 #include "GB05PrimaryGeneratorAction.hh" 44 #include "FTFP_BERT.hh" 45 #include "G4GenericBiasingPhysics.hh" 48 #include "G4VisExecutive.hh" 52 #include "G4UIExecutive.hh" 60 G4cerr <<
" Usage: " << G4endl;
61 G4cerr <<
" ./exampleGB05 [-m macro ] " 62 <<
" [-b biasing {'on','off'}]" 63 <<
"\n or\n ./exampleGB05 [macro.mac]" 71 int main(
int argc,
char** argv)
82 if ( argc == 2 ) macro = argv[1];
85 for ( G4int i=1; i<argc; i=i+2 )
87 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
88 else if (
G4String(argv[i]) ==
"-b" ) onOffBiasing = argv[i+1];
97 if ( onOffBiasing ==
"" ) onOffBiasing =
"on";
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 ************ " 114 GB05DetectorConstruction* detector =
new GB05DetectorConstruction();
115 runManager->SetUserInitialization(detector);
117 FTFP_BERT* physicsList =
new FTFP_BERT;
119 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
120 biasingPhysics->BeVerbose();
121 if ( onOffBiasing ==
"on" )
123 biasingPhysics->Bias(
"neutron");
124 physicsList->RegisterPhysics(biasingPhysics);
125 G4cout <<
" ********************************************************* " 127 G4cout <<
" ********** processes are wrapped for biasing ************ " 129 G4cout <<
" ********************************************************* " 134 G4cout <<
" ************************************************* " << G4endl;
135 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
136 G4cout <<
" ************************************************* " << G4endl;
138 runManager->SetUserInitialization(physicsList);
140 runManager->SetUserInitialization(
new GB05ActionInitialization);
143 runManager->Initialize();
148 G4VisManager* visManager =
new G4VisExecutive;
150 visManager->Initialize();
154 G4UImanager* UImanager = G4UImanager::GetUIpointer();
158 G4String command =
"/control/execute ";
159 UImanager->ApplyCommand(command+macro);
164 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);
166 UImanager->ApplyCommand(
"/control/execute vis.mac");
int main(int argc, char **argv)