Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fanoCavity.cc File Reference

Main program of the medical/fanoCavity example. More...

#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "PrimaryGeneratorAction.hh"
#include "ActionInitialization.hh"
#include "RunAction.hh"
#include "EventAction.hh"
#include "TrackingAction.hh"
#include "SteppingAction.hh"
#include "SteppingVerbose.hh"
#include "StackingAction.hh"
Include dependency graph for fanoCavity.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the medical/fanoCavity example.

Definition in file fanoCavity.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 65 of file fanoCavity.cc.

65  {
66 
67  //choose the Random engine
69 
70 
71  //Construct the default run manager
72 #ifdef G4MULTITHREADED
73  G4MTRunManager* runManager = new G4MTRunManager;
75  if (argc==3) nThreads = G4UIcommand::ConvertToInt(argv[2]);
76  runManager->SetNumberOfThreads(nThreads);
77 #else
79  G4RunManager* runManager = new G4RunManager;
80 #endif
81 
82  //set mandatory initialization classes
84  PhysicsList* phys;
85 
86  runManager->SetUserInitialization(det = new DetectorConstruction);
87  runManager->SetUserInitialization(phys = new PhysicsList(det));
88 
89  // set user action classes
90  runManager->SetUserInitialization(new ActionInitialization(det));
91 
92  /*
93  //set user action classes
94  RunAction* run = new RunAction(det,kin);
95  EventAction* event = new EventAction(run);
96  TrackingAction* track = new TrackingAction(run);
97  SteppingAction* step = new SteppingAction(det,run,track);
98  StackingAction* stack = new StackingAction(det,run);
99 
100  runManager->SetUserAction(run);
101  runManager->SetUserAction(event);
102  runManager->SetUserAction(track);
103  runManager->SetUserAction(step);
104  runManager->SetUserAction(stack);
105 */
106  //get the pointer to the User Interface manager
108 
109  if (argc!=1) // batch mode
110  {
111  G4String command = "/control/execute ";
112  G4String fileName = argv[1];
113  UI->ApplyCommand(command+fileName);
114  }
115 
116  else // interactive mode :define visualization and UI terminal
117  {
118 #ifdef G4VIS_USE
119  G4VisManager* visManager = new G4VisExecutive;
120  visManager->Initialize();
121 #endif
122 
123 #ifdef G4UI_USE
124  G4UIExecutive * ui = new G4UIExecutive(argc,argv);
125  ui->SessionStart();
126  delete ui;
127 #endif
128 
129 #ifdef G4VIS_USE
130  delete visManager;
131 #endif
132  }
133 
134  //job termination
135  //
136  delete runManager;
137 
138  return 0;
139 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
void SetNumberOfThreads(G4int n)
int G4int
Definition: G4Types.hh:78
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
G4int G4GetNumberOfCores()
Definition: G4Threading.cc:143
static G4int ConvertToInt(const char *st)
Definition: G4UIcommand.cc:447
void Initialize()
static void SetInstance(G4VSteppingVerbose *Instance)
Detector construction class to define materials and geometry.
static void setTheEngine(HepRandomEngine *theNewEngine)
Definition: Random.cc:270
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447
Physics list class.
Definition: PhysicsList.hh:47

Here is the call graph for this function: