32 #ifdef G4MULTITHREADED 33 #include "G4MTRunManager.hh" 35 #include "G4RunManager.hh" 37 #include "GB04ActionInitialization.hh" 39 #include "G4UImanager.hh" 41 #include "GB04DetectorConstruction.hh" 42 #include "GB04PrimaryGeneratorAction.hh" 44 #include "FTFP_BERT.hh" 45 #include "G4GenericBiasingPhysics.hh" 48 #include "G4VisExecutive.hh" 52 #include "G4UIExecutive.hh" 59 G4cerr <<
" Usage: " << G4endl;
60 G4cerr <<
" ./exampleGB04 [-m macro ] " 61 <<
" [-b biasing {'on','off'}]" 62 <<
"\n or\n ./exampleGB04 [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 ************ " 103 runManager->SetNumberOfThreads(4);
105 G4RunManager * runManager =
new G4RunManager;
106 G4cout <<
" ********** Run Manager constructed in sequential mode ************ " 112 GB04DetectorConstruction* detector =
new GB04DetectorConstruction();
113 runManager->SetUserInitialization(detector);
115 FTFP_BERT* physicsList =
new FTFP_BERT;
117 G4GenericBiasingPhysics* biasingPhysics =
new G4GenericBiasingPhysics();
118 if ( onOffBiasing ==
"on" )
121 std::vector< G4String > processToBias;
122 processToBias.push_back(
"eBrem");
125 biasingPhysics->PhysicsBias(
"e-", processToBias);
126 biasingPhysics->PhysicsBias(
"e+", processToBias);
127 physicsList->RegisterPhysics(biasingPhysics);
128 G4cout <<
" ********************************************************* " 130 G4cout <<
" ********** processes are wrapped for biasing ************ " 132 G4cout <<
" ********************************************************* " 137 G4cout <<
" ************************************************* " << G4endl;
138 G4cout <<
" ********** processes are not wrapped ************ " << G4endl;
139 G4cout <<
" ************************************************* " << G4endl;
141 runManager->SetUserInitialization(physicsList);
143 runManager->SetUserInitialization(
new GB04ActionInitialization);
146 runManager->Initialize();
151 G4VisManager* visManager =
new G4VisExecutive;
153 visManager->Initialize();
157 G4UImanager* UImanager = G4UImanager::GetUIpointer();
161 G4String command =
"/control/execute ";
162 UImanager->ApplyCommand(command+macro);
167 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);
int main(int argc, char **argv)