LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
TestEm0.cc File Reference

Main program of the electromagnetic/TestEm0 example. More...

#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "PrimaryGeneratorAction.hh"
#include "RunAction.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the electromagnetic/TestEm0 example.

Definition in file TestEm0.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 49 of file TestEm0.cc.

49  {
50 
51  // Construct the default run manager
52  G4RunManager * runManager = new G4RunManager;
53 
54  // set mandatory initialization classes
57  runManager->SetUserInitialization(det = new DetectorConstruction);
58  runManager->SetUserInitialization(new PhysicsList);
59  runManager->SetUserAction(prim = new PrimaryGeneratorAction(det));
60 
61  // set user action classes
62  runManager->SetUserAction(new RunAction(det,prim));
63 
64  if (argc!=1) // batch mode
65  {
66  G4String command = "/control/execute ";
67  G4String fileName = argv[1];
68  G4UImanager::GetUIpointer()->ApplyCommand(command+fileName);
69  }
70 
71  else // define UI terminal for interactive mode
72  {
73 #ifdef G4UI_USE
74  G4UIExecutive * ui = new G4UIExecutive(argc,argv);
75  ui->SessionStart();
76  delete ui;
77 #endif
78  }
79  // job termination
80  //
81  delete runManager;
82 
83  return 0;
84 }