55 #include "G4RunManager.hh" 56 #include "G4UImanager.hh" 58 #include "G4VModularPhysicsList.hh" 59 #include "IORTEventAction.hh" 60 #include "IORTPhysicsList.hh" 61 #include "IORTDetectorSD.hh" 62 #include "IORTPrimaryGeneratorAction.hh" 63 #include "IORTRunAction.hh" 64 #include "IORTMatrix.hh" 65 #include "Randomize.hh" 66 #include "G4RunManager.hh" 67 #include "G4UImessenger.hh" 69 #include "IORTSteppingAction.hh" 70 #include "IORTAnalysisManager.hh" 71 #include "IORTGeometryController.hh" 72 #include "IORTGeometryMessenger.hh" 73 #include "IORTInteractionParameters.hh" 74 #include "G4ScoringManager.hh" 78 #include "G4VisExecutive.hh" 82 #include "G4UIExecutive.hh" 88 int main(
int argc ,
char ** argv)
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;
int main(int argc, char **argv)