80 G4Random::setTheEngine(
new CLHEP::RanecuEngine);
81 G4int seconds = time(NULL);
82 G4Random::setTheSeed(seconds);
84 #ifdef G4MULTITHREADED 85 G4MTRunManager * runManager =
new G4MTRunManager;
87 G4RunManager * runManager =
new G4RunManager;
90 G4ScoringManager::GetScoringManager();
93 GammaKnifeDetectorConstruction* detector =
new GammaKnifeDetectorConstruction();
94 runManager -> SetUserInitialization(detector);
97 G4PhysListFactory factory;
98 G4VModularPhysicsList* phys = 0;
102 char* path = getenv(
"PHYSLIST");
103 if (path) { physName =
G4String(path); }
105 if(physName !=
"" && factory.IsReferencePhysList(physName))
107 phys = factory.GetReferencePhysList(physName);
110 if(!phys) { phys =
new GammaKnifePhysicsList(); }
112 runManager->SetUserInitialization(phys);
115 GammaKnifeActionInitialization* actionInitialization=
new GammaKnifeActionInitialization();
116 runManager->SetUserInitialization(actionInitialization);
118 GammaKnifeController* controller =
new GammaKnifeController( detector );
119 controller->ReadFile(
"MachineAngle.in");
123 runManager->Initialize();
127 G4VisManager* visManager =
new G4VisExecutive;
132 G4UImanager* UImanager = G4UImanager::GetUIpointer();
136 G4String command =
"/control/execute ";
138 UImanager->ApplyCommand(command+fileName);
143 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);
145 UImanager->ApplyCommand(
"/control/execute defaultMacro.mac");
147 UImanager->ApplyCommand(
"/control/execute batch.mac");