LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
GammaRayTel.cc File Reference
#include "G4Types.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.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 65 of file GammaRayTel.cc.

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