91 CLHEP::HepRandom::setTheEngine(
new CLHEP::RanecuEngine());
94 G4int
seed = time(NULL);
95 CLHEP::HepRandom::setTheSeed(seed);
98 G4RunManager* runManager =
new G4RunManager;
102 IORTGeometryController *geometryController =
new IORTGeometryController();
105 IORTGeometryMessenger *geometryMessenger =
new IORTGeometryMessenger(geometryController);
107 G4ScoringManager *scoringManager = G4ScoringManager::GetScoringManager();
108 scoringManager->SetVerboseLevel(1);
112 geometryController->SetGeometry(
"default");
115 G4ScoringManager::GetScoringManager();
118 G4PhysListFactory factory;
119 G4VModularPhysicsList* phys = 0;
123 char* path = getenv(
"PHYSLIST");
124 if (path) { physName =
G4String(path); }
126 if(factory.IsReferencePhysList(physName))
128 phys = factory.GetReferencePhysList(physName);
131 if(!phys) { phys =
new IORTPhysicsList(); }
133 runManager->SetUserInitialization(phys);
138 IORTPrimaryGeneratorAction *pPrimaryGenerator =
new IORTPrimaryGeneratorAction();
139 runManager -> SetUserAction(pPrimaryGenerator);
142 IORTRunAction* pRunAction =
new IORTRunAction();
143 runManager -> SetUserAction(pRunAction);
145 IORTEventAction* pEventAction =
new IORTEventAction();
146 runManager -> SetUserAction(pEventAction);
148 IORTSteppingAction* steppingAction =
new IORTSteppingAction(pRunAction);
149 runManager -> SetUserAction(steppingAction);
152 IORTInteractionParameters* pInteraction =
new IORTInteractionParameters(
true);
155 IORTAnalysisManager* analysis = IORTAnalysisManager::GetInstance();
161 G4VisManager* visManager =
new G4VisExecutive;
165 G4UImanager* UImanager = G4UImanager::GetUIpointer();
168 G4String command =
"/control/execute ";
170 UImanager->ApplyCommand(command+fileName);
177 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);
179 if(factory.IsReferencePhysList(physName))
181 UImanager->ApplyCommand(
"/control/execute defaultMacroWithReferencePhysicsList.mac");
185 UImanager->ApplyCommand(
"/control/execute defaultMacro.mac");
197 if ( IORTMatrix * pMatrix = IORTMatrix::GetInstance() )
199 pMatrix -> TotalEnergyDeposit();
200 pMatrix -> StoreDoseFluenceAscii();
201 pMatrix -> StoreDoseFluenceRoot();
212 delete geometryMessenger;
213 delete geometryController;