Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE02.cc File Reference

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

Include dependency graph for RE02.cc:

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
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
93 
94  //Initialize G4 kernel
95  runManager->Initialize();
96 
97  //get the pointer to the User Interface manager
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 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
static constexpr double mm
Definition: G4SIunits.hh:115
CLHEP::Hep3Vector G4ThreeVector
void SetPhantomSize(G4ThreeVector size)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
void SetLeadSegment(G4bool flag=TRUE)
TQGS_BIC< G4VModularPhysicsList > QGS_BIC
Definition: QGS_BIC.hh:63
#define TRUE
Definition: globals.hh:55
void SetNumberOfSegmentsInPhantom(G4int nx, G4int ny, G4int nz)
void Initialize()
virtual void Initialize()
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447

Here is the call graph for this function: