Import Geant4 4.1.0 source tree
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: exampleN04.cc,v 1.3 2001/07/11 09:58:24 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// $Id: exampleN04.cc,v 1.6 2002/06/19 10:44:13 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -38,47 +38,72 @@
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIterminal.hh"
|
||||
#include "G4UItcsh.hh"
|
||||
|
||||
#include "ExN04DetectorConstruction.hh"
|
||||
#include "ExN04PhysicsList.hh"
|
||||
#include "ExN04PrimaryGeneratorAction.hh"
|
||||
#include "ExN04RunAction.hh"
|
||||
#include "ExN04EventAction.hh"
|
||||
#include "ExN04StackingAction.hh"
|
||||
#include "ExN04TrackingAction.hh"
|
||||
#include "ExN04SteppingAction.hh"
|
||||
#include "ExN04SteppingVerbose.hh"
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
#include "ExN04VisManager.hh"
|
||||
#endif
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
G4VSteppingVerbose::SetInstance(new ExN04SteppingVerbose);
|
||||
|
||||
G4RunManager* runManager = new G4RunManager;
|
||||
|
||||
runManager->SetUserInitialization(new ExN04DetectorConstruction);
|
||||
runManager->SetUserInitialization(new ExN04PhysicsList);
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
// Visualization, if you choose to have it!
|
||||
G4VisManager* visManager = new ExN04VisManager;
|
||||
visManager->Initialize();
|
||||
#endif
|
||||
|
||||
runManager->Initialize();
|
||||
|
||||
runManager->SetUserAction(new ExN04PrimaryGeneratorAction);
|
||||
runManager->SetUserAction(new ExN04RunAction);
|
||||
runManager->SetUserAction(new ExN04EventAction);
|
||||
runManager->SetUserAction(new ExN04StackingAction);
|
||||
runManager->SetUserAction(new ExN04TrackingAction);
|
||||
runManager->SetUserAction(new ExN04SteppingAction);
|
||||
|
||||
//get the pointer to the User Interface manager
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
|
||||
if(argc==1)
|
||||
{
|
||||
// G4UIterminal is a (dumb) terminal.
|
||||
G4UIsession* session = new G4UIterminal;
|
||||
#ifdef G4UI_USE_TCSH
|
||||
G4UIsession* session = new G4UIterminal(new G4UItcsh);
|
||||
#else
|
||||
G4UIsession* session = new G4UIterminal();
|
||||
#endif
|
||||
UImanager->ApplyCommand("/control/execute vis.mac");
|
||||
session->SessionStart();
|
||||
delete session;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
}
|
||||
|
||||
delete runManager;
|
||||
#ifdef G4VIS_USE
|
||||
delete visManager;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user