LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
GammaRayTel.cc File Reference
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "GammaRayTelDetectorConstruction.hh"
#include "GammaRayTelPhysicsList.hh"
#include "GammaRayTelActionInitializer.hh"
#include "FTFP_BERT.hh"
#include "GammaRayTelAnalysis.hh"

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
79  GammaRayTelDetectorConstruction* detector =
80  new GammaRayTelDetectorConstruction;
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
86  runManager->SetUserInitialization(new GammaRayTelPhysicsList);
87 
88  // runManager->SetUserInitialization(new QGSP_BIC);
89  //runManager->SetUserInitialization(new FTFP_BERT);
90 
91  //Initialize actions
92  runManager->SetUserInitialization(new GammaRayTelActionInitializer());
93 
94  // Creation of the analysis manager
95  GammaRayTelAnalysis* analysis = GammaRayTelAnalysis::getInstance();
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 }