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

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

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

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the medical/fanoCavity2 example.

Definition in file fanoCavity2.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 64 of file fanoCavity2.cc.

64  {
65 
66  //choose the Random engine
68 
69 
70 #ifdef G4MULTITHREADED
71  G4MTRunManager* runManager = new G4MTRunManager;
73  if (argc==3) nThreads = G4UIcommand::ConvertToInt(argv[2]);
74  runManager->SetNumberOfThreads(nThreads);
75 #else
77  G4RunManager* runManager = new G4RunManager;
78 #endif
79 
80 
81  //my Verbose output class
82  //G4VSteppingVerbose::SetInstance(new SteppingVerbose);
83 
84  //Construct the default run manager
85  //G4RunManager * runManager = new G4RunManager;
86 
87  //set mandatory initialization classes
89  PhysicsList* phys;
90 
91 
92  runManager->SetUserInitialization(det = new DetectorConstruction);
93  runManager->SetUserInitialization(phys = new PhysicsList());
94 
95  // set user action classes
96  runManager->SetUserInitialization(new ActionInitialization(det));
97 
98 
99  //get the pointer to the User Interface manager
100  G4UImanager* UImanager = G4UImanager::GetUIpointer();
101 
102 #ifdef G4VIS_USE
103  G4VisManager* visManager = new G4VisExecutive;
104  visManager->Initialize();
105 #endif
106 
107  if (argc!=1) // batch mode
108  {
109  G4String command = "/control/execute ";
110  G4String fileName = argv[1];
111  UImanager->ApplyCommand(command+fileName);
112  }
113 
114  else // interactive mode :define visualization and UI terminal
115  {
116 #ifdef G4UI_USE
117  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
118 #ifdef G4VIS_USE
119  UImanager->ApplyCommand("/control/execute vis.mac");
120 #endif
121  ui->SessionStart();
122  delete ui;
123 #endif
124 
125 #ifdef G4VIS_USE
126  delete visManager;
127 #endif
128  }
129 
130  //job termination
131  //
132  delete runManager;
133 
134  return 0;
135 }
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: