33 #ifdef G4MULTITHREADED 34 #include "G4MTRunManager.hh" 36 #include "G4RunManager.hh" 38 #include "GB02ActionInitialization.hh" 40 #include "G4UImanager.hh" 42 #include "GB02DetectorConstruction.hh" 43 #include "GB02PrimaryGeneratorAction.hh" 45 #include "FTFP_BERT.hh" 46 #include "G4GenericBiasingPhysics.hh" 48 #include "G4VisExecutive.hh" 49 #include "G4UIExecutive.hh" 55 G4cerr <<
" Usage: " << G4endl;
56 G4cerr <<
" ./exampleGB02 [-m macro ] " 57 <<
" [-b biasing {'on','off'}]" 58 <<
"\n or\n ./exampleGB02 [macro.mac]" 65 int main(
int argc,
char** argv)
76 if ( argc == 2 ) macro = argv[1];
79 for ( G4int i=1; i<argc; i=i+2 )
81 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
82 else if (
G4String(argv[i]) ==
"-b" ) onOffBiasing = argv[i+1];
91 if ( onOffBiasing ==
"" ) onOffBiasing =
"on";
94 G4UIExecutive* ui =
nullptr;
96 ui =
new G4UIExecutive(argc, argv);
100 #ifdef G4MULTITHREADED 101 G4MTRunManager * runManager =
new G4MTRunManager;
102 G4cout <<
" ********** Run Manager constructed in MT mode ************ " << G4endl;
104 runManager->SetNumberOfThreads(4);
106 G4RunManager * runManager =
new G4RunManager;
107 G4cout <<
" ********** Run Manager constructed in sequential mode ************ " << G4endl;
111 GB02DetectorConstruction* detector =
new GB02DetectorConstruction();
112 runManager->SetUserInitialization(detector);
114 FTFP_BERT* physicsList =
new FTFP_BERT;
116 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
117 if ( onOffBiasing ==
"on" )
119 biasingPhysics->Bias(
"gamma");
120 biasingPhysics->Bias(
"neutron");
121 physicsList->RegisterPhysics(biasingPhysics);
122 G4cout <<
" ********************************************************* " << G4endl;
123 G4cout <<
" ********** processes are wrapped for biasing ************ " << G4endl;
124 G4cout <<
" ********************************************************* " << G4endl;
128 G4cout <<
" ************************************************* " << G4endl;
129 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
130 G4cout <<
" ************************************************* " << G4endl;
132 runManager->SetUserInitialization(physicsList);
134 runManager->SetUserInitialization(
new GB02ActionInitialization);
137 runManager->Initialize();
140 G4VisManager* visManager =
new G4VisExecutive;
142 visManager->Initialize();
145 G4UImanager* UImanager = G4UImanager::GetUIpointer();
149 G4String command =
"/control/execute ";
150 UImanager->ApplyCommand(command+macro);
int main(int argc, char **argv)