33 #ifdef G4MULTITHREADED 34 #include "G4MTRunManager.hh" 36 #include "G4RunManager.hh" 38 #include "GB06ActionInitialization.hh" 40 #include "G4UImanager.hh" 42 #include "GB06DetectorConstruction.hh" 43 #include "GB06ParallelWorldForSlices.hh" 44 #include "GB06PrimaryGeneratorAction.hh" 46 #include "FTFP_BERT.hh" 47 #include "G4GenericBiasingPhysics.hh" 49 #include "G4VisExecutive.hh" 50 #include "G4UIExecutive.hh" 57 G4cerr <<
" Usage: " << G4endl;
58 G4cerr <<
" ./exampleGB06 [-m macro ] " 59 <<
" [-b biasing {'on','off'}]" 60 <<
"\n or\n ./exampleGB06 [macro.mac]" 68 int main(
int argc,
char** argv)
79 if ( argc == 2 ) macro = argv[1];
82 for ( G4int i=1; i<argc; i=i+2 )
84 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
85 else if (
G4String(argv[i]) ==
"-b" ) onOffBiasing = argv[i+1];
94 if ( onOffBiasing ==
"" ) onOffBiasing =
"on";
97 G4UIExecutive* ui =
nullptr;
99 ui =
new G4UIExecutive(argc, argv);
103 #ifdef G4MULTITHREADED 104 G4MTRunManager * runManager =
new G4MTRunManager;
105 G4cout <<
" ********** Run Manager constructed in MT mode ************ " 108 runManager->SetNumberOfThreads(4);
110 G4RunManager * runManager =
new G4RunManager;
111 G4cout <<
" ********** Run Manager constructed in sequential mode ************ " 119 GB06DetectorConstruction* detector =
new GB06DetectorConstruction();
121 GB06ParallelWorldForSlices* parallelWorld =
122 new GB06ParallelWorldForSlices(
"parallelWorldForSlices");
124 detector->RegisterParallelWorld( parallelWorld );
125 runManager->SetUserInitialization(detector);
128 FTFP_BERT* physicsList =
new FTFP_BERT;
130 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
131 biasingPhysics->BeVerbose();
132 if ( onOffBiasing ==
"on" )
137 biasingPhysics->NonPhysicsBias(
"neutron");
139 biasingPhysics->AddParallelGeometry(
"neutron",
"parallelWorldForSlices");
140 physicsList->RegisterPhysics(biasingPhysics);
141 G4cout <<
" ********************************************************* " 143 G4cout <<
" ********** processes are wrapped for biasing ************ " 145 G4cout <<
" ********************************************************* " 150 G4cout <<
" ************************************************* " << G4endl;
151 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
152 G4cout <<
" ************************************************* " << G4endl;
154 runManager->SetUserInitialization(physicsList);
157 runManager->SetUserInitialization(
new GB06ActionInitialization);
160 runManager->Initialize();
163 G4VisManager* visManager =
new G4VisExecutive;
165 visManager->Initialize();
168 G4UImanager* UImanager = G4UImanager::GetUIpointer();
172 G4String command =
"/control/execute ";
173 UImanager->ApplyCommand(command+macro);
177 UImanager->ApplyCommand(
"/control/execute vis.mac");
int main(int argc, char **argv)