32 #ifdef G4MULTITHREADED 33 #include "G4MTRunManager.hh" 35 #include "G4RunManager.hh" 37 #include "GB01ActionInitialization.hh" 39 #include "G4UImanager.hh" 41 #include "GB01DetectorConstruction.hh" 42 #include "GB01PrimaryGeneratorAction.hh" 44 #include "FTFP_BERT.hh" 45 #include "G4GenericBiasingPhysics.hh" 48 #include "G4VisExecutive.hh" 52 #include "G4UIExecutive.hh" 59 G4cerr <<
" Usage: " << G4endl;
60 G4cerr <<
" ./exampleGB01 [-m macro ] " 61 <<
" [-b biasing {'on','off'}]" 62 <<
"\n or\n ./exampleGB01 [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 GB01DetectorConstruction* detector =
new GB01DetectorConstruction();
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 biasingPhysics->Bias(
"kaon0L");
120 biasingPhysics->Bias(
"kaon0S");
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 GB01ActionInitialization);
137 runManager->Initialize();
142 G4VisManager* visManager =
new G4VisExecutive;
144 visManager->Initialize();
148 G4UImanager* UImanager = G4UImanager::GetUIpointer();
152 G4String command =
"/control/execute ";
153 UImanager->ApplyCommand(command+macro);
158 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);
int main(int argc, char **argv)