46 #ifdef G4MULTITHREADED 47 #include "G4MTRunManager.hh" 49 #include "G4RunManager.hh" 52 #include "G4UImanager.hh" 53 #include "G4UIterminal.hh" 54 #include "G4UItcsh.hh" 56 #include "G4VisExecutive.hh" 58 #include "G4UIExecutive.hh" 60 #include "GammaKnifeDetectorConstruction.hh" 61 #include "GammaKnifePhysicsList.hh" 62 #include "GammaKnifePrimaryGeneratorAction.hh" 63 #include "GammaKnifeRunAction.hh" 64 #include "GammaKnifeActionInitialization.hh" 66 #include "Randomize.hh" 67 #include "G4RunManager.hh" 68 #include "G4UImessenger.hh" 69 #include "G4ScoringManager.hh" 71 #include "GammaKnifeController.hh" 72 #include "G4PhysListFactory.hh" 76 int main(
int argc ,
char ** argv)
79 G4Random::setTheEngine(
new CLHEP::RanecuEngine);
81 G4Random::setTheSeed(seconds);
83 #ifdef G4MULTITHREADED 84 G4MTRunManager * runManager =
new G4MTRunManager;
86 G4RunManager * runManager =
new G4RunManager;
89 G4ScoringManager::GetScoringManager();
92 GammaKnifeDetectorConstruction* detector =
new GammaKnifeDetectorConstruction();
93 runManager -> SetUserInitialization(detector);
96 G4PhysListFactory factory;
97 G4VModularPhysicsList* phys = 0;
101 char* path = std::getenv(
"PHYSLIST");
102 if (path) { physName =
G4String(path); }
104 if(physName !=
"" && factory.IsReferencePhysList(physName))
106 phys = factory.GetReferencePhysList(physName);
109 if(!phys) { phys =
new GammaKnifePhysicsList(); }
111 runManager->SetUserInitialization(phys);
114 GammaKnifeActionInitialization* actionInitialization=
new GammaKnifeActionInitialization();
115 runManager->SetUserInitialization(actionInitialization);
117 GammaKnifeController* controller =
new GammaKnifeController( detector );
118 controller->ReadFile(
"MachineAngle.in");
122 runManager->Initialize();
125 G4VisManager* visManager =
new G4VisExecutive;
129 G4UImanager* UImanager = G4UImanager::GetUIpointer();
133 G4String command =
"/control/execute ";
135 UImanager->ApplyCommand(command+fileName);
140 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);
142 UImanager->ApplyCommand(
"/control/execute defaultMacro.mac");
144 UImanager->ApplyCommand(
"/control/execute batch.mac");
second seconds
Alias for common language habits.
int main(int argc, char **argv)