59 #include "G4RunManager.hh" 60 #include "G4UImanager.hh" 62 #include "G4VModularPhysicsList.hh" 63 #include "HadrontherapyEventAction.hh" 64 #include "HadrontherapyPhysicsList.hh" 65 #include "HadrontherapyDetectorSD.hh" 66 #include "HadrontherapyPrimaryGeneratorAction.hh" 67 #include "HadrontherapyRunAction.hh" 68 #include "HadrontherapyMatrix.hh" 69 #include "Randomize.hh" 71 #include "G4UImessenger.hh" 73 #include "HadrontherapySteppingAction.hh" 74 #include "HadrontherapyAnalysisManager.hh" 75 #include "HadrontherapyGeometryController.hh" 76 #include "HadrontherapyGeometryMessenger.hh" 77 #include "HadrontherapyInteractionParameters.hh" 78 #include "HadrontherapyLet.hh" 80 #include "G4ScoringManager.hh" 81 #include "G4ParallelWorldPhysics.hh" 85 #ifdef G4MULTITHREADED 86 #include "G4MTRunManager.hh" 88 #include "G4RunManager.hh" 91 #include "HadrontherapyActionInitialization.hh" 94 #include "G4VisExecutive.hh" 98 #include "G4UIExecutive.hh" 102 int main(
int argc ,
char ** argv)
105 CLHEP::HepRandom::setTheEngine(
new CLHEP::RanecuEngine());
113 #ifdef G4MULTITHREADED 115 G4MTRunManager* runManager =
new G4MTRunManager;
118 G4RunManager* runManager =
new G4RunManager;
125 HadrontherapyGeometryController *geometryController =
new HadrontherapyGeometryController();
128 HadrontherapyGeometryMessenger *geometryMessenger =
new HadrontherapyGeometryMessenger(geometryController);
130 G4ScoringManager *scoringManager = G4ScoringManager::GetScoringManager();
131 scoringManager->SetVerboseLevel(1);
135 geometryController->SetGeometry(
"default");
138 G4ScoringManager::GetScoringManager();
141 G4PhysListFactory factory;
142 G4VModularPhysicsList* phys = 0;
146 char* path = getenv(
"PHYSLIST");
147 if (path) { physName =
G4String(path); }
149 if(physName !=
"" && factory.IsReferencePhysList(physName))
151 phys = factory.GetReferencePhysList(physName);
155 G4cout <<
"Going to register G4ParallelWorldPhysics" << G4endl;
156 phys->RegisterPhysics(
new G4ParallelWorldPhysics(
"DetectorROGeometry"));
160 G4cout <<
"Using HadrontherapyPhysicsList()" << G4endl;
161 phys =
new HadrontherapyPhysicsList();
164 runManager->SetUserInitialization(phys);
167 runManager->SetUserInitialization(
new HadrontherapyActionInitialization);
172 HadrontherapyInteractionParameters* pInteraction =
new HadrontherapyInteractionParameters(
true);
175 HadrontherapyAnalysisManager* analysis = HadrontherapyAnalysisManager::GetInstance();
177 #ifdef G4ANALYSIS_USE_ROOT 183 G4VisManager* visManager =
new G4VisExecutive;
188 G4UImanager* UImanager = G4UImanager::GetUIpointer();
193 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);
194 G4cout <<
" UI session starts ..." << G4endl;
195 UImanager -> ApplyCommand(
"/control/execute macro/defaultMacro.mac");
196 ui -> SessionStart();
202 G4String command =
"/control/execute ";
204 UImanager -> ApplyCommand(command+fileName);
209 if ( HadrontherapyMatrix * pMatrix = HadrontherapyMatrix::GetInstance() )
211 pMatrix -> TotalEnergyDeposit();
212 pMatrix -> StoreDoseFluenceAscii();
213 #ifdef G4ANALYSIS_USE_ROOT 215 pMatrix -> StoreDoseFluenceRoot();
219 if (HadrontherapyLet *let = HadrontherapyLet::GetInstance())
220 if(let -> doCalculation)
223 let -> StoreLetAscii();
224 #ifdef G4ANALYSIS_USE_ROOT 226 let -> StoreLetRoot();
231 #ifdef G4ANALYSIS_USE_ROOT 232 if (analysis -> IsTheTFile()) analysis -> flush();
240 delete geometryMessenger;
241 delete geometryController;
int main(int argc, char **argv)