20 #include "G4RunManager.hh" 21 #include "G4UImanager.hh" 22 #include "G4UIterminal.hh" 23 #include "G4UItcsh.hh" 27 #include "G4UIRoot.hh" 34 #include "Randomize.hh" 41 #include "G4UIExecutive.hh" 53 int main(
int argc,
char** argv)
56 CLHEP::HepRandom::setTheEngine(
new CLHEP::RanecuEngine);
58 CLHEP::HepRandom::setTheSeed(seed);
65 G4RunManager* runManager =
new G4RunManager;
69 runManager->SetUserInitialization(detector);
76 G4UIsession* session=0;
79 #if defined (G4UI_USE_ROOT) 81 session =
new G4UIRoot(argc,argv);
82 #elif defined (G4UI_USE_XM) 84 session =
new G4UIXm(argc,argv);
85 #elif defined(G4UI_USE_TCSH) 86 session =
new G4UIterminal(
new G4UItcsh);
88 session =
new G4UIterminal();
91 session =
new G4UIQt(argc,argv);
97 visManager->Initialize();
104 runManager->SetUserAction(eventaction);
112 G4UImanager* UI = G4UImanager::GetUIpointer();
117 UI->ApplyCommand(
"/control/execute gui.mac");
118 session->SessionStart();
119 if ( (G4UImanager::GetUIpointer()) &&
120 (session ==(G4UImanager::GetUIpointer())->GetSession()) )
125 G4String command =
"/control/execute ";
126 G4String fileName = argv[1];
127 UI->ApplyCommand(command+fileName);
135 G4cout <<
"RunManager deleting... "<< G4endl;
int main(int argc, char **argv)