44 #ifdef G4MULTITHREADED 45 #include "G4MTRunManager.hh" 47 #include "G4RunManager.hh" 50 #include "G4UImanager.hh" 51 #include "G4UIterminal.hh" 52 #include "G4UItcsh.hh" 55 #include "G4VisExecutive.hh" 58 #include "G4UIExecutive.hh" 61 #include "GammaKnifeDetectorConstruction.hh" 62 #include "GammaKnifePhysicsList.hh" 63 #include "GammaKnifePrimaryGeneratorAction.hh" 64 #include "GammaKnifeRunAction.hh" 65 #include "GammaKnifeActionInitialization.hh" 67 #include "Randomize.hh" 68 #include "G4RunManager.hh" 69 #include "G4UImessenger.hh" 70 #include "G4ScoringManager.hh" 72 #include "GammaKnifeController.hh" 77 int main(
int argc ,
char ** argv)
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");
int main(int argc, char **argv)