32 #ifdef G4MULTITHREADED 33 #include "G4MTRunManager.hh" 35 #include "G4RunManager.hh" 37 #include "GB02ActionInitialization.hh" 39 #include "G4UImanager.hh" 41 #include "GB02DetectorConstruction.hh" 42 #include "GB02PrimaryGeneratorAction.hh" 44 #include "FTFP_BERT.hh" 45 #include "G4GenericBiasingPhysics.hh" 48 #include "G4VisExecutive.hh" 52 #include "G4UIExecutive.hh" 59 G4cerr <<
" Usage: " << G4endl;
60 G4cerr <<
" ./exampleGB02 [-m macro ] " 61 <<
" [-b biasing {'on','off'}]" 62 <<
"\n or\n ./exampleGB02 [macro.mac]" 69 int main(
int argc,
char** argv)
80 if ( argc == 2 ) macro = argv[1];
83 for ( G4int i=1; i<argc; i=i+2 )
85 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
86 else if (
G4String(argv[i]) ==
"-b" ) onOffBiasing = argv[i+1];
95 if ( onOffBiasing ==
"" ) onOffBiasing =
"on";
98 #ifdef G4MULTITHREADED 99 G4MTRunManager * runManager =
new G4MTRunManager;
100 G4cout <<
" ********** Run Manager constructed in MT mode ************ " << G4endl;
102 runManager->SetNumberOfThreads(4);
104 G4RunManager * runManager =
new G4RunManager;
105 G4cout <<
" ********** Run Manager constructed in sequential mode ************ " << G4endl;
109 GB02DetectorConstruction* detector =
new GB02DetectorConstruction();
110 runManager->SetUserInitialization(detector);
112 FTFP_BERT* physicsList =
new FTFP_BERT;
114 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
115 if ( onOffBiasing ==
"on" )
117 biasingPhysics->Bias(
"gamma");
118 biasingPhysics->Bias(
"neutron");
119 physicsList->RegisterPhysics(biasingPhysics);
120 G4cout <<
" ********************************************************* " << G4endl;
121 G4cout <<
" ********** processes are wrapped for biasing ************ " << G4endl;
122 G4cout <<
" ********************************************************* " << G4endl;
126 G4cout <<
" ************************************************* " << G4endl;
127 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
128 G4cout <<
" ************************************************* " << G4endl;
130 runManager->SetUserInitialization(physicsList);
132 runManager->SetUserInitialization(
new GB02ActionInitialization);
135 runManager->Initialize();
140 G4VisManager* visManager =
new G4VisExecutive;
142 visManager->Initialize();
146 G4UImanager* UImanager = G4UImanager::GetUIpointer();
150 G4String command =
"/control/execute ";
151 UImanager->ApplyCommand(command+macro);
156 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);
int main(int argc, char **argv)