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" 47 #include "G4VisExecutive.hh" 48 #include "G4UIExecutive.hh" 55 G4cerr <<
" Usage: " << G4endl;
56 G4cerr <<
" ./exampleGB05 [-m macro ] " 57 <<
" [-b biasing {'on','off'}]" 58 <<
"\n or\n ./exampleGB05 [macro.mac]" 66 int main(
int argc,
char** argv)
77 if ( argc == 2 ) macro = argv[1];
80 for ( G4int i=1; i<argc; i=i+2 )
82 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
83 else if (
G4String(argv[i]) ==
"-b" ) onOffBiasing = argv[i+1];
92 if ( onOffBiasing ==
"" ) onOffBiasing =
"on";
95 G4UIExecutive* ui =
nullptr;
97 ui =
new G4UIExecutive(argc, argv);
101 #ifdef G4MULTITHREADED 102 G4MTRunManager * runManager =
new G4MTRunManager;
103 G4cout <<
" ********** Run Manager constructed in MT mode ************ " 106 runManager->SetNumberOfThreads(4);
108 G4RunManager * runManager =
new G4RunManager;
109 G4cout <<
" ********** Run Manager constructed in sequential mode ************ " 115 GB05DetectorConstruction* detector =
new GB05DetectorConstruction();
116 runManager->SetUserInitialization(detector);
118 FTFP_BERT* physicsList =
new FTFP_BERT;
120 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
121 biasingPhysics->BeVerbose();
122 if ( onOffBiasing ==
"on" )
124 biasingPhysics->Bias(
"neutron");
125 physicsList->RegisterPhysics(biasingPhysics);
126 G4cout <<
" ********************************************************* " 128 G4cout <<
" ********** processes are wrapped for biasing ************ " 130 G4cout <<
" ********************************************************* " 135 G4cout <<
" ************************************************* " << G4endl;
136 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
137 G4cout <<
" ************************************************* " << G4endl;
139 runManager->SetUserInitialization(physicsList);
141 runManager->SetUserInitialization(
new GB05ActionInitialization);
144 runManager->Initialize();
147 G4VisManager* visManager =
new G4VisExecutive;
149 visManager->Initialize();
152 G4UImanager* UImanager = G4UImanager::GetUIpointer();
156 G4String command =
"/control/execute ";
157 UImanager->ApplyCommand(command+macro);
161 UImanager->ApplyCommand(
"/control/execute vis.mac");
int main(int argc, char **argv)