Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE02.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
28 //
29 //
30 // $Id$
31 //
32 //
33 
35 #include "QGS_BIC.hh"
37 #include "RE02RunAction.hh"
38 #include "RE02EventAction.hh"
39 
40 #include "G4RunManager.hh"
41 #include "G4UImanager.hh"
42 #include "G4SystemOfUnits.hh"
43 
44 #ifdef G4UI_USE
45 #include "G4UIExecutive.hh"
46 #endif
47 
48 #ifdef G4VIS_USE
49 #include "G4VisExecutive.hh"
50 #endif
51 
52 //
53 int main(int argc,char** argv) {
54 
55  // Run manager
56  G4RunManager * runManager = new G4RunManager;
57 
58  // UserInitialization classes (mandatory)
59  //---
60  // Create Detector
62  detector->SetPhantomSize(G4ThreeVector(200*mm,200*mm,400*mm)); //Default
63  detector->SetNumberOfSegmentsInPhantom(100,100,200); //Default
64  // If your machine does not have enough memory,
65  // please try to reduce Number of Segements in phantom.
66  //detector->SetNumberOfSegmentsInPhantom(1,1,100); // For small memory size.
67  //
68  detector->SetLeadSegment(TRUE); // Default (Water and Lead)
69  // Water and Lead segments are placed alternately, by defult.,
70  // If you want to simulation homogeneous water phantom, please set it FALSE.
71  //detector->SetLeadSegment(FALSE); // Homogeneous water phantom
72  //
73  runManager->SetUserInitialization(detector);
74  //
75  runManager->SetUserInitialization(new QGS_BIC());
76 
77 #ifdef G4VIS_USE
78  // Visualization, if you choose to have it!
79  G4VisManager* visManager = new G4VisExecutive;
80  visManager->Initialize();
81 #endif
82 
83  // UserAction classes
85  runManager->SetUserAction(new RE02RunAction);
86  runManager->SetUserAction(new RE02EventAction);
87 
88  //Initialize G4 kernel
89  runManager->Initialize();
90 
91  //get the pointer to the User Interface manager
93 
94  if(argc==1)
95  // Define (G)UI terminal for interactive mode
96  {
97 #ifdef G4UI_USE
98  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
99 #ifdef G4VIS_USE
100  pUI->ApplyCommand("/control/execute vis.mac");
101 #endif
102  ui->SessionStart();
103  delete ui;
104 #endif
105  }
106  else
107  // Batch mode
108  {
109  G4String command = "/control/execute ";
110  G4String fileName = argv[1];
111  pUI->ApplyCommand(command+fileName);
112  }
113 
114 #ifdef G4VIS_USE
115  delete visManager;
116 #endif
117  delete runManager;
118 
119  return 0;
120 }
121 
122 //
123