Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GammaRayTel.cc File Reference
Include dependency graph for GammaRayTel.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 68 of file GammaRayTel.cc.

69 {
70  // Construct the default run manager
71 #ifdef G4MULTITHREADED
72  G4MTRunManager* runManager = new G4MTRunManager;
73  //runManager->SetNumberOfThreads(2);
74 #else
75  G4RunManager* runManager = new G4RunManager;
76 #endif
77 
78  // Set mandatory user initialization classes
81  runManager->SetUserInitialization(detector);
82 
83  // POSSIBILITY TO SELECT ANOTHER PHYSICS LIST
84  // do not use GammaRayTelPhysicsList, this is old style and crashes at
85  // program exit
87 
88  // runManager->SetUserInitialization(new QGSP_BIC);
89  //runManager->SetUserInitialization(new FTFP_BERT);
90 
91  //Initialize actions
93 
94  // Creation of the analysis manager
96 
97  // Set visualization and user interface
98 #ifdef G4VIS_USE
99  // Visualization manager
100  G4VisManager* visManager = new G4VisExecutive;
101  visManager->Initialize();
102 #endif
103 
104  // Initialize G4 kernel
105  // runManager->Initialize();
106 
107  // Get the pointer to the UI manager
108  G4UImanager* UImanager = G4UImanager::GetUIpointer();
109  if (argc!=1) // batch mode
110  {
111  G4String command = "/control/execute ";
112  G4String fileName = argv[1];
113  UImanager->ApplyCommand(command+fileName);
114  }
115  else
116  {
117 #ifdef G4UI_USE
118  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
119  if (ui->IsGUI())
120  {
121  /* prerunGammaRayTel.mac is loaded by default */
122  UImanager->ApplyCommand("/control/execute prerunGammaRayTel.mac");
123  ui->SessionStart();
124  }
125  delete ui;
126 #endif
127  }
128  // Job termination
129 #ifdef G4VIS_USE
130  delete visManager;
131 #endif
132  delete analysis;
133  delete runManager;
134  return 0;
135 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
static GammaRayTelAnalysis * getInstance()
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
void Initialize()
G4bool IsGUI() const
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447

Here is the call graph for this function: