Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
lArCal.cc File Reference
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "FCALTestbeamSetup.hh"
#include "FCALSteppingVerbose.hh"
#include "FCALPrimaryGeneratorAction.hh"
#include "G4PhysListFactory.hh"
#include "FCALRunAction.hh"
#include "FCALTBEventAction.hh"
#include "FCALSteppingAction.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 62 of file lArCal.cc.

References G4UImanager::ApplyCommand(), G4UImanager::GetUIpointer(), G4RunManager::Initialize(), G4VisManager::Initialize(), G4UIExecutive::IsGUI(), G4PhysListFactory::ReferencePhysList(), G4UIExecutive::SessionStart(), G4VSteppingVerbose::SetInstance(), CLHEP::HepRandom::setTheEngine(), G4RunManager::SetUserAction(), and G4RunManager::SetUserInitialization().

62  {
63 
64  // choose the Random engine
66 
67  //my Verbose output class
69 
70  // Construct the default run manager
71  G4RunManager * runManager = new G4RunManager;
72 
73  // set mandatory initialization classes
74  FCALTestbeamSetup* detector = new FCALTestbeamSetup;
75  runManager->SetUserInitialization(detector);
76 
77  G4PhysListFactory factory;
78  runManager->SetUserInitialization(factory.ReferencePhysList());
79 
80 #ifdef G4VIS_USE
81  // visualization manager
82  G4VisManager* visManager = new G4VisExecutive;
83  visManager->Initialize();
84 #endif
85 
86  // set user action classes
87  runManager->SetUserAction(new FCALPrimaryGeneratorAction());
88 
90  runManager ->SetUserAction(RunAction);
91 
92  FCALSteppingAction* StepAction = new FCALSteppingAction;
93  runManager->SetUserAction(StepAction);
94 
95  // runManager->SetUserAction(new FCALRunAction);
96 
97  runManager->SetUserAction(new FCALTBEventAction(StepAction));
98 
99 
100  //Initialize G4 kernel
101  runManager->Initialize();
102 
103  // get the pointer to the User Interface manager
104  G4UImanager* UImanager = G4UImanager::GetUIpointer();
105 
106  if (argc==1) // Define UI session for interactive mode.
107  {
108 #ifdef G4UI_USE
109  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
110 #ifdef G4VIS_USE
111  UImanager->ApplyCommand("/control/execute prerunlArcal.mac");
112 #endif
113  if (ui->IsGUI())
114  UImanager->ApplyCommand("/control/execute gui.mac");
115  ui->SessionStart();
116  delete ui;
117 #endif
118  }
119  else // Batch mode
120  {
121  G4String command = "/control/execute ";
122  G4String fileName = argv[1];
123  UImanager->ApplyCommand(command+fileName);
124  }
125 
126  // job termination
127 #ifdef G4VIS_USE
128  delete visManager;
129 #endif
130  delete runManager;
131 
132  return 0;
133 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
void Initialize()
static void SetInstance(G4VSteppingVerbose *Instance)
virtual void Initialize()
static void setTheEngine(HepRandomEngine *theNewEngine)
Definition: Random.cc:170
G4VModularPhysicsList * ReferencePhysList()
G4bool IsGUI() const
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:419
virtual void SetUserAction(G4UserRunAction *userAction)