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

Main program of the runAndEvent/RE02 example. More...

#include "RE02DetectorConstruction.hh"
#include "QGS_BIC.hh"
#include "RE02ActionInitialization.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4SystemOfUnits.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the runAndEvent/RE02 example.

Definition in file RE02.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 56 of file RE02.cc.

56  {
57 
58  // Run manager
59 #ifdef G4MULTITHREADED
60  G4MTRunManager * runManager = new G4MTRunManager;
61  //runManager->SetNumberOfThreads(4);
62 #else
63  G4RunManager * runManager = new G4RunManager;
64 #endif
65 
66  // UserInitialization classes (mandatory)
67  //---
68  // Create Detector
69  RE02DetectorConstruction* detector = new RE02DetectorConstruction;
70  detector->SetPhantomSize(G4ThreeVector(200*mm,200*mm,400*mm)); //Default
71  detector->SetNumberOfSegmentsInPhantom(100,100,200); //Default
72  // If your machine does not have enough memory,
73  // please try to reduce Number of Segements in phantom.
74  //detector->SetNumberOfSegmentsInPhantom(1,1,100); // For small memory size.
75  //
76  detector->SetLeadSegment(TRUE); // Default (Water and Lead)
77  // Water and Lead segments are placed alternately, by defult.,
78  // If you want to simulation homogeneous water phantom, please set it FALSE.
79  //detector->SetLeadSegment(FALSE); // Homogeneous water phantom
80  //
81  runManager->SetUserInitialization(detector);
82  //
83  runManager->SetUserInitialization(new QGS_BIC());
84 
85 #ifdef G4VIS_USE
86  // Visualization, if you choose to have it!
87  G4VisManager* visManager = new G4VisExecutive;
88  visManager->Initialize();
89 #endif
90 
91  // UserAction classes
92  runManager->SetUserInitialization(new RE02ActionInitialization);
93 
94  //Initialize G4 kernel
95  runManager->Initialize();
96 
97  //get the pointer to the User Interface manager
98  G4UImanager * pUI = G4UImanager::GetUIpointer();
99 
100  if(argc==1)
101  // Define (G)UI terminal for interactive mode
102  {
103 #ifdef G4UI_USE
104  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
105 #ifdef G4VIS_USE
106  pUI->ApplyCommand("/control/execute vis.mac");
107 #endif
108  ui->SessionStart();
109  delete ui;
110 #endif
111  }
112  else
113  // Batch mode
114  {
115  G4String command = "/control/execute ";
116  G4String fileName = argv[1];
117  pUI->ApplyCommand(command+fileName);
118  }
119 
120 #ifdef G4VIS_USE
121  delete visManager;
122 #endif
123  delete runManager;
124 
125  return 0;
126 }