Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
RE02.cc
이 파일의 문서화 페이지로 가기
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: RE02.cc 109785 2018-05-09 08:15:23Z gcosmo $
31 //
32 //
33 
35 #include "QGS_BIC.hh"
37 
38 #ifdef G4MULTITHREADED
39 #include "G4MTRunManager.hh"
40 #else
41 #include "G4RunManager.hh"
42 #endif
43 
44 #include "G4UImanager.hh"
45 #include "G4SystemOfUnits.hh"
46 
47 #include "G4UIExecutive.hh"
48 #include "G4VisExecutive.hh"
49 
50 //
51 int main(int argc,char** argv) {
52 
53  // Instantiate G4UIExecutive if there are no arguments (interactive mode)
54  G4UIExecutive* ui = nullptr;
55  if ( argc == 1 ) {
56  ui = new G4UIExecutive(argc, argv);
57  }
58 
59  // Run manager
60 #ifdef G4MULTITHREADED
61  G4MTRunManager * runManager = new G4MTRunManager;
62  //runManager->SetNumberOfThreads(4);
63 #else
64  G4RunManager * runManager = new G4RunManager;
65 #endif
66 
67  // UserInitialization classes (mandatory)
68  //---
69  // Create Detector
71  detector->SetPhantomSize(G4ThreeVector(200*mm,200*mm,400*mm)); //Default
72  detector->SetNumberOfSegmentsInPhantom(100,100,200); //Default
73  // If your machine does not have enough memory,
74  // please try to reduce Number of Segements in phantom.
75  //detector->SetNumberOfSegmentsInPhantom(1,1,100); // For small memory size.
76  //
77  detector->SetLeadSegment(TRUE); // Default (Water and Lead)
78  // Water and Lead segments are placed alternately, by defult.,
79  // If you want to simulation homogeneous water phantom, please set it FALSE.
80  //detector->SetLeadSegment(FALSE); // Homogeneous water phantom
81  //
82  runManager->SetUserInitialization(detector);
83  //
84  runManager->SetUserInitialization(new QGS_BIC());
85 
86  // Visualization, if you choose to have it!
87  G4VisManager* visManager = new G4VisExecutive;
88  visManager->Initialize();
89 
90  // UserAction classes
92 
93  //Initialize G4 kernel
94  runManager->Initialize();
95 
96  //get the pointer to the User Interface manager
98 
99  if(ui)
100  // Define (G)UI terminal for interactive mode
101  {
102  pUI->ApplyCommand("/control/execute vis.mac");
103  ui->SessionStart();
104  delete ui;
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  delete visManager;
115  delete runManager;
116 
117  return 0;
118 }
119 
120 //
121 
CLHEP::Hep3Vector G4ThreeVector
TQGS_BIC< G4VModularPhysicsList > QGS_BIC
Definition: QGS_BIC.hh:63
static constexpr double mm
Definition: G4SIunits.hh:115
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:466
void SetNumberOfSegmentsInPhantom(G4int nx, G4int ny, G4int nz)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:73
void SetPhantomSize(G4ThreeVector size)
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
Definition of the RE02DetectorConstruction class.
Definition of the RE02ActionInitialization class.
#define TRUE
Definition: globals.hh:55
void SetLeadSegment(G4bool flag=TRUE)
int main(int argc, char **argv)
Definition: genwindef.cc:359
void Initialize()
virtual void Initialize()