33 #ifdef G4MULTITHREADED 34 #include "G4MTRunManager.hh" 36 #include "G4RunManager.hh" 38 #include "GB04ActionInitialization.hh" 40 #include "G4UImanager.hh" 42 #include "GB04DetectorConstruction.hh" 43 #include "GB04PrimaryGeneratorAction.hh" 45 #include "FTFP_BERT.hh" 46 #include "G4GenericBiasingPhysics.hh" 48 #include "G4VisExecutive.hh" 49 #include "G4UIExecutive.hh" 55 G4cerr <<
" Usage: " << G4endl;
56 G4cerr <<
" ./exampleGB04 [-m macro ] " 57 <<
" [-b biasing {'on','off'}]" 58 <<
"\n or\n ./exampleGB04 [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 ************ " 105 runManager->SetNumberOfThreads(4);
107 G4RunManager * runManager =
new G4RunManager;
108 G4cout <<
" ********** Run Manager constructed in sequential mode ************ " 113 GB04DetectorConstruction* detector =
new GB04DetectorConstruction();
114 runManager->SetUserInitialization(detector);
116 FTFP_BERT* physicsList =
new FTFP_BERT;
118 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
119 if ( onOffBiasing ==
"on" )
122 std::vector< G4String > processToBias;
123 processToBias.push_back(
"eBrem");
126 biasingPhysics->PhysicsBias(
"e-", processToBias);
127 biasingPhysics->PhysicsBias(
"e+", processToBias);
128 physicsList->RegisterPhysics(biasingPhysics);
129 G4cout <<
" ********************************************************* " 131 G4cout <<
" ********** processes are wrapped for biasing ************ " 133 G4cout <<
" ********************************************************* " 138 G4cout <<
" ************************************************* " << G4endl;
139 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
140 G4cout <<
" ************************************************* " << G4endl;
142 runManager->SetUserInitialization(physicsList);
144 runManager->SetUserInitialization(
new GB04ActionInitialization);
147 runManager->Initialize();
150 G4VisManager* visManager =
new G4VisExecutive;
152 visManager->Initialize();
155 G4UImanager* UImanager = G4UImanager::GetUIpointer();
159 G4String command =
"/control/execute ";
160 UImanager->ApplyCommand(command+macro);
int main(int argc, char **argv)