LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
XrayTel.cc File Reference
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "XrayTelDetectorConstruction.hh"
#include "XrayTelPhysicsList.hh"
#include "XrayTelActionInitializer.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 99 of file XrayTel.cc.

100 {
101  // Construct the default run manager
102 #ifdef G4MULTITHREADED
103  G4MTRunManager* runManager = new G4MTRunManager;
104 #else
105  G4RunManager* runManager = new G4RunManager;
106 #endif
107 
108  // set mandatory initialization classes
109  runManager->SetUserInitialization(new XrayTelDetectorConstruction ) ;
110  runManager->SetUserInitialization(new XrayTelPhysicsList);
111  runManager->SetUserInitialization(new XrayTelActionInitializer());
112 
113 #ifdef G4VIS_USE
114  // visualization manager
115  G4VisManager* visManager = new G4VisExecutive;
116  visManager->Initialize();
117 #endif
118 
119  //Initialize G4 kernel
120  runManager->Initialize();
121 
122  // get the pointer to the User Interface manager
123  G4UImanager *UImanager = G4UImanager::GetUIpointer();
124  if ( argc==1 ){
125 #ifdef G4UI_USE
126  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
127 #ifdef G4VIS_USE
128  UImanager->ApplyCommand("/control/execute vis.mac");
129 #endif
130  ui->SessionStart();
131  delete ui;
132 #endif
133  }
134  else {
135  // Create a pointer to the User Interface manager
136  G4String command = "/control/execute ";
137  for (int i=2; i<=argc; i++) {
138  G4String macroFileName = argv[i-1];
139  UImanager->ApplyCommand(command+macroFileName);
140  }
141  }
142 
143  // job termination
144 #ifdef G4VIS_USE
145  delete visManager;
146 #endif
147  delete runManager;
148  return 0;
149 }