Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Ultra.cc File Reference
Include dependency graph for Ultra.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 56 of file Ultra.cc.

56  {
57 
58 //choose the Random engine from CLHEP
59 //(lets use C++ implementation of Jame's RANLUX generator)
60 
61  G4Random::setTheEngine(new CLHEP::RanluxEngine);
62 
63 #ifdef G4MULTITHREADED
64  G4MTRunManager* runManager = new G4MTRunManager;
65  //runManager->SetNumberOfThreads(2);
66 #else
67  G4RunManager* runManager = new G4RunManager;
68 #endif
69 
70  // UserInitialization classes - mandatory
72  UltraPhysicsList* list = new UltraPhysicsList();
73  runManager->SetUserInitialization(detector);
74  runManager->SetUserInitialization(list);
75 
76  // UserAction classes - optional
78 
79  // Detect interactive mode (if no arguments) and define UI session
80  G4UIExecutive* ui = 0;
81  if ( argc == 1 ) {
82  ui = new G4UIExecutive(argc, argv);
83  }
84 
85  // Initialise visualization
86  G4VisManager* visManager = new G4VisExecutive;
87  visManager->Initialize();
88 
89  // Get the Pointer to the UI Manager
91 
92  // User interactions
93  // Define (G)UI for interactive mode
94  if(argc==1)
95  {
96  UImanager->ApplyCommand("/control/execute Visualisation.mac");
97  ui->SessionStart();
98  delete ui;
99  }
100  else // Batch mode
101  {
102  G4String command = "/control/execute ";
103  G4String fileName = argv[1];
104  UImanager->ApplyCommand(command+fileName);
105  }
106 
107  delete visManager;
108  delete runManager;
109 
110  return 0;
111 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
void Initialize()
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447

Here is the call graph for this function: