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

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