32 #ifdef G4MULTITHREADED 33 #include "G4MTRunManager.hh" 35 #include "G4RunManager.hh" 37 #include "GB06ActionInitialization.hh" 39 #include "G4UImanager.hh" 41 #include "GB06DetectorConstruction.hh" 42 #include "GB06ParallelWorldForSlices.hh" 43 #include "GB06PrimaryGeneratorAction.hh" 45 #include "FTFP_BERT.hh" 46 #include "G4GenericBiasingPhysics.hh" 49 #include "G4VisExecutive.hh" 53 #include "G4UIExecutive.hh" 61 G4cerr <<
" Usage: " << G4endl;
62 G4cerr <<
" ./exampleGB06 [-m macro ] " 63 <<
" [-b biasing {'on','off'}]" 64 <<
"\n or\n ./exampleGB06 [macro.mac]" 72 int main(
int argc,
char** argv)
83 if ( argc == 2 ) macro = argv[1];
86 for ( G4int i=1; i<argc; i=i+2 )
88 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
89 else if (
G4String(argv[i]) ==
"-b" ) onOffBiasing = argv[i+1];
98 if ( onOffBiasing ==
"" ) onOffBiasing =
"on";
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 ************ " 117 GB06DetectorConstruction* detector =
new GB06DetectorConstruction();
119 GB06ParallelWorldForSlices* parallelWorld =
120 new GB06ParallelWorldForSlices(
"parallelWorldForSlices");
122 detector->RegisterParallelWorld( parallelWorld );
123 runManager->SetUserInitialization(detector);
126 FTFP_BERT* physicsList =
new FTFP_BERT;
128 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
129 biasingPhysics->BeVerbose();
130 if ( onOffBiasing ==
"on" )
135 biasingPhysics->NonPhysicsBias(
"neutron");
137 biasingPhysics->AddParallelGeometry(
"neutron",
"parallelWorldForSlices");
138 physicsList->RegisterPhysics(biasingPhysics);
139 G4cout <<
" ********************************************************* " 141 G4cout <<
" ********** processes are wrapped for biasing ************ " 143 G4cout <<
" ********************************************************* " 148 G4cout <<
" ************************************************* " << G4endl;
149 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
150 G4cout <<
" ************************************************* " << G4endl;
152 runManager->SetUserInitialization(physicsList);
155 runManager->SetUserInitialization(
new GB06ActionInitialization);
158 runManager->Initialize();
163 G4VisManager* visManager =
new G4VisExecutive;
165 visManager->Initialize();
169 G4UImanager* UImanager = G4UImanager::GetUIpointer();
173 G4String command =
"/control/execute ";
174 UImanager->ApplyCommand(command+macro);
179 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);
181 UImanager->ApplyCommand(
"/control/execute vis.mac");
int main(int argc, char **argv)