Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
GammaRayTel.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 //
26 //
27 // $Id: GammaRayTel.cc 110103 2018-05-15 11:33:34Z gcosmo $
28 //
29 //
30 // ------------------------------------------------------------
31 // GEANT 4 main program
32 // CERN Geneva Switzerland
33 //
34 //
35 // ------------ GammaRayTel example main program ------
36 // by F.Longo, R.Giannitrapani & G.Santin (29 nov 2000)
37 // See README file for details on this example
38 // 20.11.01 G.Santin: new analysis management, and some modification in the
39 // construction of some Action's
40 // ************************************************************
41 
42 #include "G4Types.hh"
43 
44 #ifdef G4MULTITHREADED
45 #include "G4MTRunManager.hh"
46 #else
47 #include "G4RunManager.hh"
48 #endif
49 
50 #include "G4UImanager.hh"
51 
52 #ifdef G4VIS_USE
53 #include "G4VisExecutive.hh"
54 #endif
55 
56 #ifdef G4UI_USE
57 #include "G4UIExecutive.hh"
58 #endif
59 
63 
64 //#include "QGSP_BIC.hh"
65 #include "FTFP_BERT.hh"
66 
67 #include "GammaRayTelAnalysis.hh"
68 
69 // This is the main function
70 int main(int argc, char** argv)
71 {
72  // Construct the default run manager
73 #ifdef G4MULTITHREADED
74  G4MTRunManager* runManager = new G4MTRunManager;
75  // runManager->SetNumberOfThreads(1);
76 #else
77  G4RunManager* runManager = new G4RunManager;
78 #endif
79 
80  // Set mandatory user initialization classes
83  runManager->SetUserInitialization(detector);
84 
85  // POSSIBILITY TO SELECT ANOTHER PHYSICS LIST
86  // do not use GammaRayTelPhysicsList, this is old style and crashes at
87  // program exit
89 
90  // runManager->SetUserInitialization(new QGSP_BIC);
91  //runManager->SetUserInitialization(new FTFP_BERT);
92 
93  //Initialize actions
95 
96  // Creation of the analysis manager
98 
99  // Set visualization and user interface
100 #ifdef G4VIS_USE
101  // Visualization manager
102  G4VisManager* visManager = new G4VisExecutive;
103  visManager->Initialize();
104 #endif
105 
106  // Initialize G4 kernel
107  // runManager->Initialize();
108 
109  // Get the pointer to the UI manager
110  G4UImanager* UImanager = G4UImanager::GetUIpointer();
111  if (argc!=1) // batch mode
112  {
113  G4String command = "/control/execute ";
114  G4String fileName = argv[1];
115  UImanager->ApplyCommand(command+fileName);
116  }
117  else
118  {
119 #ifdef G4UI_USE
120  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
121  if (ui->IsGUI())
122  {
123  /* prerunGammaRayTel.mac is loaded by default */
124  UImanager->ApplyCommand("/control/execute prerunGammaRayTel.mac");
125  ui->SessionStart();
126  }
127  delete ui;
128 #endif
129  }
130  // Job termination
131 #ifdef G4VIS_USE
132  delete visManager;
133 #endif
134  delete analysis;
135  delete runManager;
136  return 0;
137 }
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:466
static GammaRayTelAnalysis * getInstance()
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:73
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
int main(int argc, char **argv)
Definition: genwindef.cc:359
void Initialize()
G4bool IsGUI() const