LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
TestEm10.cc File Reference

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

#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "PrimaryGeneratorAction.hh"
#include "RunAction.hh"
#include "EventAction.hh"
#include "StackingAction.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the electromagnetic/TestEm10 example.

Definition in file TestEm10.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 57 of file TestEm10.cc.

58 {
59 
60  //choose the Random engine
61 
62  CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
63 
64  // Construct the default run manager
65 
66  G4RunManager * runManager = new G4RunManager;
67 
68  // set mandatory initialization classes
69 
70  DetectorConstruction* detector;
71  detector = new DetectorConstruction;
72 
73  // ALICEDetectorConstruction* detector;
74  // detector = new ALICEDetectorConstruction;
75 
76  runManager->SetUserInitialization(detector);
77  runManager->SetUserInitialization(new PhysicsList(detector));
78 
79  // set user action classes
80  runManager->SetUserAction(new PrimaryGeneratorAction());
81 
82  RunAction* runAction = new RunAction;
83  runManager->SetUserAction(runAction);
84 
85  EventAction* eventAction = new EventAction(runAction);
86  runManager->SetUserAction(eventAction);
87 
88  runManager->SetUserAction( new StackingAction );
89 
90 
91  G4UImanager* UI = G4UImanager::GetUIpointer();
92 
93  if (argc!=1) // batch mode
94  {
95  G4String command = "/control/execute ";
96  G4String fileName = argv[1];
97  UI->ApplyCommand(command+fileName);
98  }
99 
100  else //define visualization and UI terminal for interactive mode
101  {
102 #ifdef G4VIS_USE
103  G4VisManager* visManager = new G4VisExecutive;
104  visManager->Initialize();
105 #endif
106 
107 #ifdef G4UI_USE
108  G4UIExecutive * ui = new G4UIExecutive(argc,argv);
109  ui->SessionStart();
110  delete ui;
111 #endif
112 
113 #ifdef G4VIS_USE
114  delete visManager;
115 #endif
116  }
117 
118  // job termination
119  //
120  delete runManager;
121 
122  return 0;
123 }
TConfigurablePhysicsList< ModularPhysicsList > PhysicsList
Definition: PhysicsList.h:86