Import Geant4 9.1.0 source tree
This commit is contained in:
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: exampleN02.cc,v 1.12 2006/06/29 17:47:25 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// $Id: exampleN02.cc,v 1.14 2007/07/02 13:09:30 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -68,13 +68,6 @@ int main(int argc,char** argv)
|
||||
//
|
||||
G4VUserPhysicsList* physics = new ExN02PhysicsList;
|
||||
runManager->SetUserInitialization(physics);
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
// Visualization, if you choose to have it!
|
||||
//
|
||||
G4VisManager* visManager = new G4VisExecutive;
|
||||
visManager->Initialize();
|
||||
#endif
|
||||
|
||||
// User Action classes
|
||||
//
|
||||
@@ -98,35 +91,39 @@ int main(int argc,char** argv)
|
||||
//
|
||||
G4UImanager * UI = G4UImanager::GetUIpointer();
|
||||
|
||||
if(argc==1) // Define (G)UI terminal for interactive mode
|
||||
{
|
||||
// G4UIterminal is a (dumb) terminal
|
||||
//
|
||||
G4UIsession * session = 0;
|
||||
if (argc!=1) // batch mode
|
||||
{
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UI->ApplyCommand(command+fileName);
|
||||
}
|
||||
|
||||
else // interactive mode : define visualization and UI terminal
|
||||
{
|
||||
#ifdef G4VIS_USE
|
||||
G4VisManager* visManager = new G4VisExecutive;
|
||||
visManager->Initialize();
|
||||
#endif
|
||||
|
||||
G4UIsession * session = 0;
|
||||
#ifdef G4UI_USE_TCSH
|
||||
session = new G4UIterminal(new G4UItcsh);
|
||||
#else
|
||||
session = new G4UIterminal();
|
||||
#endif
|
||||
UI->ApplyCommand("/control/execute vis.mac");
|
||||
session->SessionStart();
|
||||
delete session;
|
||||
}
|
||||
else // Batch mode
|
||||
{
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UI->ApplyCommand(command+fileName);
|
||||
}
|
||||
UI->ApplyCommand("/control/execute vis.mac");
|
||||
session->SessionStart();
|
||||
delete session;
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
delete visManager;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Free the store: user actions, physics_list and detector_description are
|
||||
// owned and deleted by the run manager, so they should not
|
||||
// be deleted in the main() program !
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
delete visManager;
|
||||
#endif
|
||||
|
||||
delete runManager;
|
||||
delete verbosity;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user